[前][次][番号順一覧][スレッド一覧]

ruby-changes:60532

From: Yusuke <ko1@a...>
Date: Fri, 27 Mar 2020 15:33:09 +0900 (JST)
Subject: [ruby-changes:60532] 16c90f0678 (master): test/digest/test_digest.rb: Apply EnvUtil.apply_timeout_scale to timeout

https://git.ruby-lang.org/ruby.git/commit/?id=16c90f0678

From 16c90f0678751e96cd8ddfa426ecdabfde10a28c Mon Sep 17 00:00:00 2001
From: Yusuke Endoh <mame@r...>
Date: Fri, 27 Mar 2020 15:31:14 +0900
Subject: 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

diff --git a/test/digest/test_digest.rb b/test/digest/test_digest.rb
index 4cae455..c9b2c68 100644
--- a/test/digest/test_digest.rb
+++ b/test/digest/test_digest.rb
@@ -247,10 +247,10 @@ module TestDigest https://github.com/ruby/ruby/blob/trunk/test/digest/test_digest.rb#L247
     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 https://github.com/ruby/ruby/blob/trunk/test/digest/test_digest.rb#L260
     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
           }
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]