1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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
This commit is contained in:
nobu 2011-12-15 01:10:45 +00:00
parent 7c5105c120
commit 15a66805d8
2 changed files with 9 additions and 5 deletions

View file

@ -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

View file

@ -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