summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bootstraptest/pending.rb8
-rwxr-xr-xbootstraptest/runner.rb6
-rw-r--r--bootstraptest/test_thread.rb6
3 files changed, 12 insertions, 8 deletions
diff --git a/bootstraptest/pending.rb b/bootstraptest/pending.rb
index fa4e04c6dad..744c0adac10 100644
--- a/bootstraptest/pending.rb
+++ b/bootstraptest/pending.rb
@@ -37,11 +37,3 @@ assert_normal_exit %q{
r.instance_eval { initialize r, r }
r.inspect
}
-
-# This test randomly fails on AppVeyor msys2 with:
-# test_thread.rb: A non-blocking socket operation could not be completed immediately. - read would block
-assert_finish 3, %{
- th = Thread.new {sleep 0.2}
- th.join(0.1)
- th.join
-}
diff --git a/bootstraptest/runner.rb b/bootstraptest/runner.rb
index a5d5d219cf9..c2a3790236c 100755
--- a/bootstraptest/runner.rb
+++ b/bootstraptest/runner.rb
@@ -383,8 +383,14 @@ def assert_finish(timeout_seconds, testsrc, message = '')
end
if io.respond_to?(:read_nonblock)
if IO.select([io], nil, nil, diff)
+ tries = 0
begin
io.read_nonblock(1024)
+ rescue IO::WaitReadable
+ IO.select([io])
+ tries += 1
+ break if tries > 3
+ retry
rescue Errno::EAGAIN, EOFError
break
end while true
diff --git a/bootstraptest/test_thread.rb b/bootstraptest/test_thread.rb
index 2b549b9ed95..d16295de8be 100644
--- a/bootstraptest/test_thread.rb
+++ b/bootstraptest/test_thread.rb
@@ -249,6 +249,12 @@ assert_equal 'ok', %{
}
assert_finish 3, %{
+ th = Thread.new {sleep 0.2}
+ th.join(0.1)
+ th.join
+}
+
+assert_finish 3, %{
require 'timeout'
th = Thread.new {sleep 0.2}
begin