From 79086bb454f604cc993f57b270333d409eb8d900 Mon Sep 17 00:00:00 2001 From: naruse Date: Wed, 4 Apr 2012 09:29:43 +0000 Subject: 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 --- test/ruby/test_sleep.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'test/ruby') 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 -- cgit v1.2.3