Skip to content

Commit

Permalink
Failing test for brianmario#213
Browse files Browse the repository at this point in the history
  • Loading branch information
tamird authored and eam committed Dec 18, 2013
1 parent 3ca5204 commit 24f3cc5
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions spec/mysql2/client_spec.rb
Expand Up @@ -125,6 +125,25 @@ def connect *args
final_count.should == before_count
end

it "should not close connections when running in a child process" do
GC.start
sleep 1 if defined? Rubinius # Let the rbx GC thread do its work
client = Mysql2::Client.new(DatabaseCredentials['root'])

fork do
client.query('SELECT 1')
client = nil
GC.start
sleep 1 if defined? Rubinius # Let the rbx GC thread do its work
end

Process.wait

# this will throw an error if the underlying socket was shutdown by the
# child's GC
expect { client.query('SELECT 1') }.to_not raise_exception
end

it "should be able to connect to database with numeric-only name" do
lambda {
creds = DatabaseCredentials['numericuser']
Expand Down

0 comments on commit 24f3cc5

Please sign in to comment.