summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-08-26 12:41:21 +0000
committernormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-08-26 12:41:21 +0000
commite0311eb847bfa1c526aac4485889548ad8152ce3 (patch)
tree4ddadf979095d4248a12da713f5d9acf6096b62a
parent70d6c1a102aea1a26ae4799c4ce67451618c8bcc (diff)
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 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64543 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--test/ruby/test_io.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/ruby/test_io.rb b/test/ruby/test_io.rb
index f2e9128e8a..7843fa0877 100644
--- a/test/ruby/test_io.rb
+++ b/test/ruby/test_io.rb
@@ -3781,6 +3781,15 @@ __END__
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__
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)