summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-04-22 01:46:45 +0000
committernaruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-04-22 01:46:45 +0000
commitf46ffca1c766cdb20dabb27e9bbe60a124e28bcd (patch)
tree09021c86cc0d1e10ee560608e813453ba16a35f9 /test
parentcc19bcf11fdb008e74efdffab78b6680d2728385 (diff)
avoid thread switching.
The test may fail if thread switches to d or e before assertions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35423 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_thread.rb11
1 files changed, 8 insertions, 3 deletions
diff --git a/test/ruby/test_thread.rb b/test/ruby/test_thread.rb
index 7ea56c57d8..946d522cd9 100644
--- a/test/ruby/test_thread.rb
+++ b/test/ruby/test_thread.rb
@@ -439,9 +439,14 @@ class TestThread < Test::Unit::TestCase
assert(c.stop?)
d.kill
- assert_equal(["aborting", false], [d.status, d.stop?])
-
- assert_equal(["run", false], [e.status, e.stop?])
+ # to avoid thread switching...
+ ds1 = d.status
+ ds2 = d.stop?
+ es1 = e.status
+ es2 = e.stop?
+ assert_equal(["aborting", false], [ds1, ds2])
+
+ assert_equal(["run", false], [es1, es2])
ensure
a.kill if a