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.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/bootstraptest/test_thread.rb b/bootstraptest/test_thread.rb
index 43bb2fe772..873e955291 100644
--- a/bootstraptest/test_thread.rb
+++ b/bootstraptest/test_thread.rb
@@ -213,3 +213,19 @@ assert_equal 'true', %{
true
end
}
+
+assert_finish 3, %{
+ th = Thread.new {sleep 2}
+ th.join(1)
+ th.join
+}
+
+assert_finish 3, %{
+ require 'timeout'
+ th = Thread.new {sleep 2}
+ begin
+ Timeout.timeout(1) {th.join}
+ rescue Timeout::Error
+ end
+ th.join
+}