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

test/digest/test_digest.rb: Apply EnvUtil.apply_timeout_scale to timeout

The test seems to fail sometimes due to a warning message of circular
require on very slow machine.

```
  1) Failure:
TestDigest::TestDigestParen#test_race_mixed [/export/home/rubyci/unstable10s/tmp/build/20200326T091911Z/ruby/test/digest/test_digest.rb:263]:
assert_separately failed with error message
pid 12458 exit 0
| /export/home/rubyci/unstable10s/tmp/build/20200326T091911Z/ruby/.ext/common/digest.rb:17: warning: /export/home/rubyci/unstable10s/tmp/build/20200326T091911Z/ruby/.ext/common/digest.rb:17: warning: loading in progress, circular require considered harmful - /export/home/rubyci/unstable10s/tmp/build/20200326T091911Z/ruby/test/digest/digest/foo.rb
| 	from -:10:in  `block (2 levels) in <main>'
| 	from /export/home/rubyci/unstable10s/tmp/build/20200326T091911Z/ruby/.ext/common/digest.rb:17:in  `const_missing'
| 	from /export/home/rubyci/unstable10s/tmp/build/20200326T091911Z/ruby/.ext/common/digest.rb:17:in  `require'
|
```
https://rubyci.org/logs/rubyci.s3.amazonaws.com/unstable10s/ruby-master/log/20200326T091911Z.fail.html.gz
This commit is contained in:
Yusuke Endoh 2020-03-27 15:31:14 +09:00
parent 39c965f230
commit 16c90f0678

View file

@ -247,10 +247,10 @@ module TestDigest
end
def test_race
assert_separately(['-rdigest', "-I#{File.dirname(__FILE__)}"], <<-'end;')
assert_separately(['-rdigest', "-I#{File.dirname(__FILE__)}"], <<-"end;")
assert_nothing_raised {
t = Thread.start {
sleep 0.1
sleep #{ EnvUtil.apply_timeout_scale(0.1) }
Digest(:Foo).new
}
Digest(:Foo).new
@ -260,10 +260,10 @@ module TestDigest
end
def test_race_mixed
assert_separately(['-rdigest', "-I#{File.dirname(__FILE__)}"], <<-'end;')
assert_separately(['-rdigest', "-I#{File.dirname(__FILE__)}"], <<-"end;")
assert_nothing_raised {
t = Thread.start {
sleep 0.1
sleep #{ EnvUtil.apply_timeout_scale(0.1) }
Thread.current.report_on_exception = false
Digest::Foo.new
}