Skip to content

Commit 90c7ce9

Browse files
committed
Always run the tests on RBX
1 parent 3184108 commit 90c7ce9

File tree

1 file changed

+26
-25
lines changed

1 file changed

+26
-25
lines changed

spec/mysql2/client_spec.rb

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,8 @@ def run_gc
155155
end
156156

157157
it "should not leave dangling connections after garbage collection" do
158+
pending('Rubinius misbehaves') if defined?(Rubinius)
159+
158160
run_gc
159161

160162
client = Mysql2::Client.new(DatabaseCredentials['root'])
@@ -413,32 +415,31 @@ def run_gc
413415
}.should raise_error(Mysql2::Error)
414416
end
415417

416-
if !defined? Rubinius
417-
# XXX this test is not deterministic (because Unix signal handling is not)
418-
# and may fail on a loaded system
419-
it "should run signal handlers while waiting for a response" do
420-
mark = {}
421-
trap(:USR1) { mark[:USR1] = Time.now }
422-
begin
423-
mark[:START] = Time.now
424-
pid = fork do
425-
sleep 0.1 # wait for client query to start
426-
Process.kill(:USR1, Process.ppid)
427-
sleep # wait for explicit kill to prevent GC disconnect
428-
end
429-
@client.query('SELECT SLEEP(0.2)')
430-
mark[:END] = Time.now
431-
mark.include?(:USR1).should be_true
432-
(mark[:USR1] - mark[:START]).should >= 0.1
433-
(mark[:USR1] - mark[:START]).should < 0.13
434-
(mark[:END] - mark[:USR1]).should > 0.09
435-
(mark[:END] - mark[:START]).should >= 0.2
436-
(mark[:END] - mark[:START]).should < 0.23
437-
Process.kill(:TERM, pid)
438-
Process.waitpid2(pid)
439-
ensure
440-
trap(:USR1, 'DEFAULT')
418+
# XXX this test is not deterministic (because Unix signal handling is not)
419+
# and may fail on a loaded system
420+
it "should run signal handlers while waiting for a response" do
421+
pending('Rubinius misbehaves') if defined?(Rubinius)
422+
mark = {}
423+
trap(:USR1) { mark[:USR1] = Time.now }
424+
begin
425+
mark[:START] = Time.now
426+
pid = fork do
427+
sleep 0.1 # wait for client query to start
428+
Process.kill(:USR1, Process.ppid)
429+
sleep # wait for explicit kill to prevent GC disconnect
441430
end
431+
@client.query('SELECT SLEEP(0.2)')
432+
mark[:END] = Time.now
433+
mark.include?(:USR1).should be_true
434+
(mark[:USR1] - mark[:START]).should >= 0.1
435+
(mark[:USR1] - mark[:START]).should < 0.13
436+
(mark[:END] - mark[:USR1]).should > 0.09
437+
(mark[:END] - mark[:START]).should >= 0.2
438+
(mark[:END] - mark[:START]).should < 0.23
439+
Process.kill(:TERM, pid)
440+
Process.waitpid2(pid)
441+
ensure
442+
trap(:USR1, 'DEFAULT')
442443
end
443444
end
444445

0 commit comments

Comments
 (0)