summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-04-04 09:29:43 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-04-04 09:29:43 +0000
commit79086bb454f604cc993f57b270333d409eb8d900 (patch)
treedd0d445c0f68937cba92ce80f781332380d77668 /test
parent5374e6b20e67ca21b60fcfcf521e981e7a03b64f (diff)
merge revision(s) 34897,34904,34906,34931:
Old linux (at least CentOS 5.6, kernel 2.6.18) wakes up 4.99 sec. * test/ruby/test_sleep.rb (TestSleep#test_sleep_5sec): syntax error. * test/ruby/test_sleep.rb (TestSleep#test_sleep_5sec): call uname only on linux because it's a workaround for linux only. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@35238 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_sleep.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/test/ruby/test_sleep.rb b/test/ruby/test_sleep.rb
index 96c38fde5a..989ced92c7 100644
--- a/test/ruby/test_sleep.rb
+++ b/test/ruby/test_sleep.rb
@@ -6,7 +6,8 @@ class TestSleep < Test::Unit::TestCase
start = Time.now
sleep 5
slept = Time.now-start
- assert_operator(5.0, :<=, slept)
+ bottom = /linux/ =~ RUBY_PLATFORM && /Linux ([\d.]+)/ =~ `uname -sr` && ($1.split('.')<=>%w/2 6 18/)<1 ? 4.99 : 5.0
+ assert_operator(bottom, :<=, slept)
assert_operator(slept, :<=, 6.0, "[ruby-core:18015]: longer than expected")
ensure
GC.enable