summaryrefslogtreecommitdiff
path: root/bootstraptest/test_thread.rb
diff options
context:
space:
mode:
Diffstat (limited to 'bootstraptest/test_thread.rb')
-rw-r--r--bootstraptest/test_thread.rb30
1 files changed, 20 insertions, 10 deletions
diff --git a/bootstraptest/test_thread.rb b/bootstraptest/test_thread.rb
index 38a55ff229..4040b68a27 100644
--- a/bootstraptest/test_thread.rb
+++ b/bootstraptest/test_thread.rb
@@ -242,9 +242,22 @@ assert_equal 'true', %{
end
}
+assert_equal 'true', %{
+ Thread.new{}.join
+ begin
+ Process.waitpid2 fork{
+ Thread.new{
+ sleep 0.1
+ }.join
+ }
+ true
+ rescue NotImplementedError
+ true
+ end
+}
+
assert_equal 'ok', %{
- open("zzz.rb", "w") do |f|
- f.puts <<-END
+ File.write("zzz_t1.rb", <<-END)
begin
Thread.new { fork { GC.start } }.join
pid, status = Process.wait2
@@ -253,8 +266,7 @@ assert_equal 'ok', %{
$result = :ok
end
END
- end
- require "./zzz.rb"
+ require "./zzz_t1.rb"
$result
}
@@ -289,7 +301,7 @@ assert_normal_exit %q{
}.each {|t|
t.join
}
-}
+} unless rjit_enabled? # flaky
assert_equal 'ok', %q{
def m
@@ -408,8 +420,7 @@ assert_equal 'ok', %q{
}
assert_equal 'ok', %{
- open("zzz.rb", "w") do |f|
- f.puts <<-'end;' # do
+ File.write("zzz_t2.rb", <<-'end;') # do
begin
m = Thread::Mutex.new
parent = Thread.current
@@ -431,8 +442,7 @@ assert_equal 'ok', %{
$result = :ok
end
end;
- end
- require "./zzz.rb"
+ require "./zzz_t2.rb"
$result
}
@@ -483,7 +493,7 @@ assert_equal 'foo', %q{
[th1, th2].each {|t| t.join }
GC.start
f.call.source
-}
+} unless rjit_enabled? # flaky
assert_normal_exit %q{
class C
def inspect