Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Modify connection pool spec to sleep longer for rubinius, without slo…

…wing others down

Rubinius seems to require a longer sleep on the connection pool
spec in order to work correctly.  This makes rubinius sleep 30
times longer in that spec.  Hopefully this will reduce the
frequency of false positives.
  • Loading branch information...
commit 69524e79ffce5a44639e54955e3db1af8d811989 1 parent 8409e07
@jeremyevans authored
Showing with 5 additions and 4 deletions.
  1. +5 −4 spec/core/connection_pool_spec.rb
View
9 spec/core/connection_pool_spec.rb
@@ -166,14 +166,15 @@ def value
specify "should let only one thread access the connection at any time" do
cc,c1, c2 = nil
+ m = (defined?(RUBY_ENGINE) && RUBY_ENGINE == 'rbx') ? 30 : 1
t1 = Thread.new {@pool.hold {|c| cc = c; c1 = c.dup; while c == 'herro';sleep 0.01;end}}
- sleep 0.2
+ sleep 0.02 * m
cc.should == 'herro'
c1.should == 'herro'
t2 = Thread.new {@pool.hold {|c| c2 = c.dup; while c == 'hello';sleep 0.01;end}}
- sleep 0.1
+ sleep 0.02 * m
# connection held by t1
t1.should be_alive
@@ -187,7 +188,7 @@ def value
@pool.allocated.should == {t1=>cc}
cc.gsub!('rr', 'll')
- sleep 0.1
+ sleep 0.05 * m
# connection held by t2
t1.should_not be_alive
@@ -199,7 +200,7 @@ def value
@pool.allocated.should == {t2=>cc}
cc.gsub!('ll', 'rr')
- sleep 0.1
+ sleep 0.05 * m
#connection released
t2.should_not be_alive
Please sign in to comment.
Something went wrong with that request. Please try again.