@@ -155,6 +155,8 @@ def run_gc
155
155
end
156
156
157
157
it "should not leave dangling connections after garbage collection" do
158
+ pending ( 'Rubinius misbehaves' ) if defined? ( Rubinius )
159
+
158
160
run_gc
159
161
160
162
client = Mysql2 ::Client . new ( DatabaseCredentials [ 'root' ] )
@@ -413,32 +415,31 @@ def run_gc
413
415
} . should raise_error ( Mysql2 ::Error )
414
416
end
415
417
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
441
430
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' )
442
443
end
443
444
end
444
445
0 commit comments