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

ruby-changes:52335

From: normal <ko1@a...>
Date: Sun, 26 Aug 2018 21:41:28 +0900 (JST)
Subject: [ruby-changes:52335] normal:r64543 (trunk): test/ruby/test_io.rb (test_recycled_fd_close): Linux workaround

normal	2018-08-26 21:41:21 +0900 (Sun, 26 Aug 2018)

  New Revision: 64543

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=64543

  Log:
    test/ruby/test_io.rb (test_recycled_fd_close): Linux workaround
    
    Arch Linux CI still seems to timeout on this test...
    
    Note, I can't reproduce the failures in these tests on a
    FreeBSD 11.1 VM while infinite-looping, even without the
    "th.join(0.001)".  It doesn't seem related to the use of
    rb_wait_for_single_fd (r64529).
    
    cf. https://rubyci.org/logs/rubyci.s3.amazonaws.com/arch/ruby-trunk/log/20180826T090003Z.fail.html.gz

  Modified files:
    trunk/test/ruby/test_io.rb
Index: test/ruby/test_io.rb
===================================================================
--- test/ruby/test_io.rb	(revision 64542)
+++ test/ruby/test_io.rb	(revision 64543)
@@ -3781,6 +3781,15 @@ __END__ https://github.com/ruby/ruby/blob/trunk/test/ruby/test_io.rb#L3781
           IO.pipe do |r, w|
             th = Thread.new { r.read(1) }
             w.write(dot)
+
+            # XXX not sure why this is needed on Linux, otherwise
+            # the "good" reader thread doesn't always join properly
+            # because the reader never sees the first write
+            if RUBY_PLATFORM =~ /linux/
+              # assert_equal can fail if this is another char...
+              w.write(dot)
+            end
+
             assert_same th, th.join(15), '"good" reader timeout'
             assert_equal(dot, th.value)
           end
@@ -3798,7 +3807,10 @@ __END__ https://github.com/ruby/ruby/blob/trunk/test/ruby/test_io.rb#L3807
             end
           end
           Thread.pass until th.stop?
+
+          # XXX not sure why, this reduces Linux CI failures
           assert_nil th.join(0.001)
+
           r.close
           assert_same th, th.join(30), '"bad" reader timeout'
           assert_match(/stream closed/, th.value.message)

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

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