diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-12-15 01:10:45 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-12-15 01:10:45 +0000 |
commit | 15a66805d846b0a964c7a0a450c5b92f18a40ce9 (patch) | |
tree | 0df1d5e9f6e3fb8f5c223235a0f0e928e3ad3208 | |
parent | 7c5105c1202ead44c79786af607740d4aeb8d412 (diff) | |
download | ruby-15a66805d846b0a964c7a0a450c5b92f18a40ce9.tar.gz |
* 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
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | test/ruby/test_require.rb | 9 |
2 files changed, 9 insertions, 5 deletions
@@ -1,3 +1,8 @@ +Thu Dec 15 10:10:43 2011 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * test/ruby/test_require.rb (test_race_exception): get rid of + not-guaranteed timing issue. [ruby-core:41655] [Bug #5754] + Wed Dec 14 21:58:42 2011 NAKAMURA Usaku <usa@ruby-lang.org> * test/ruby/test_io_m17n.rb 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 |