summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-12-15 01:10:45 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-12-15 01:10:45 +0000
commit15a66805d846b0a964c7a0a450c5b92f18a40ce9 (patch)
tree0df1d5e9f6e3fb8f5c223235a0f0e928e3ad3208 /test
parent7c5105c1202ead44c79786af607740d4aeb8d412 (diff)
* test/ruby/test_require.rb (test_race_exception): get rid of
not-guaranteed timing issue. [ruby-core:41655] [Bug #5754] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34046 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r--test/ruby/test_require.rb9
1 files changed, 4 insertions, 5 deletions
diff --git a/test/ruby/test_require.rb b/test/ruby/test_require.rb
index 858ea6170a..9186a6f623 100644
--- a/test/ruby/test_require.rb
+++ b/test/ruby/test_require.rb
@@ -344,7 +344,7 @@ class TestRequire < Test::Unit::TestCase
attr_accessor :scratch
end
- def test_race_excption
+ def test_race_exception
bug5754 = '[ruby-core:41618]'
tmp = Tempfile.new(%w"bug5754 .rb")
path = tmp.path
@@ -357,7 +357,6 @@ raise "con1"
EOS
tmp.close
- start = false
fin = false
TestRequire.scratch = scratch = []
@@ -390,9 +389,9 @@ raise "con1"
assert_nothing_raised(ThreadError, bug5754) {t1.join}
assert_nothing_raised(ThreadError, bug5754) {t2.join}
- assert_equal([false, true], [t1_res, t2_res], bug5754)
+ assert_equal(true, (t1_res ^ t2_res), bug5754)
assert_equal([:pre, t2, :post, :t2, :t1], scratch, bug5754)
-
- tmp.close(true)
+ ensure
+ tmp.close(true) if tmp
end
end