aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-04-25 23:07:28 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-04-25 23:07:28 +0000
commit79c09eb597748d179d97926fafbcd5f2db344e32 (patch)
tree6beaa597b6a1ba8e5500a9fcb0027ed7188173aa
parent1377f38c9b55c9f22647b30af22e1704c426df69 (diff)
downloadruby-79c09eb597748d179d97926fafbcd5f2db344e32.tar.gz
* test/ruby/test_process.rb (test_rlimit_nofile): Don't limit
RLIMIT_NOFILE too small. This fix sporadic "[ASYNC BUG] thread_timer: select" on GNU/Linux. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45721 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog6
-rw-r--r--test/ruby/test_process.rb7
2 files changed, 11 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 50650a4347..5947f4b609 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Sat Apr 26 08:05:36 2014 Tanaka Akira <akr@fsij.org>
+
+ * test/ruby/test_process.rb (test_rlimit_nofile): Don't limit
+ RLIMIT_NOFILE too small.
+ This fix sporadic "[ASYNC BUG] thread_timer: select" on GNU/Linux.
+
Fri Apr 25 22:54:34 2014 Naohisa Goto <ngotogenome@gmail.com>
* lib/fileutils.rb (rmdir): rescue Errno::EEXIST in addition to
diff --git a/test/ruby/test_process.rb b/test/ruby/test_process.rb
index 85303abe14..ee0c44da54 100644
--- a/test/ruby/test_process.rb
+++ b/test/ruby/test_process.rb
@@ -65,8 +65,11 @@ class TestProcess < Test::Unit::TestCase
return unless rlimit_exist?
with_tmpchdir {
write_file 's', <<-"End"
- # if limit=0, this test freeze pn OpenBSD
- limit = /openbsd/ =~ RUBY_PLATFORM ? 1 : 0
+ # Too small RLIMIT_NOFILE causes problems.
+ # [OpenBSD] Setting to zero freezes this test.
+ # [GNU/Linux] EINVAL on poll(). EINVAL on ruby's internal poll() ruby with "[ASYNC BUG] thread_timer: select".
+ pipes = IO.pipe
+ limit = pipes.map {|io| io.fileno }.min
result = 1
begin
Process.setrlimit(Process::RLIMIT_NOFILE, limit)