From 15a66805d846b0a964c7a0a450c5b92f18a40ce9 Mon Sep 17 00:00:00 2001 From: nobu Date: Thu, 15 Dec 2011 01:10:45 +0000 Subject: * 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 --- test/ruby/test_require.rb | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'test') 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 -- cgit v1.2.3