[前][次][番号順一覧][スレッド一覧]

ruby-changes:33640

From: akr <ko1@a...>
Date: Sat, 26 Apr 2014 08:07:34 +0900 (JST)
Subject: [ruby-changes:33640] akr:r45721 (trunk): * test/ruby/test_process.rb (test_rlimit_nofile): Don't limit

akr	2014-04-26 08:07:28 +0900 (Sat, 26 Apr 2014)

  New Revision: 45721

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=45721

  Log:
    * 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.

  Modified files:
    trunk/ChangeLog
    trunk/test/ruby/test_process.rb
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 45720)
+++ ChangeLog	(revision 45721)
@@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sat Apr 26 08:05:36 2014  Tanaka Akira  <akr@f...>
+
+	* 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@g...>
 
 	* lib/fileutils.rb (rmdir): rescue Errno::EEXIST in addition to
Index: test/ruby/test_process.rb
===================================================================
--- test/ruby/test_process.rb	(revision 45720)
+++ test/ruby/test_process.rb	(revision 45721)
@@ -65,8 +65,11 @@ class TestProcess < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_process.rb#L65
     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)

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]