Bug #4466

test_should_run_all_without_any_leaks somtimes fails

Added by Tomoyuki Chikanaga about 3 years ago. Updated almost 3 years ago.

[ruby-dev:43300]
Status:Closed
Priority:Normal
Assignee:Shota Fukumori
Category:lib
Target version:1.9.3
ruby -v:ruby 1.9.3dev (2011-03-04 trunk 31020) [i686-linux] Backport:

Description

=begin
Linux 上で test/testunit/test_parallel.rb が時々以下の Failure になります。

3) Failure:
testshouldrunallwithoutanyleaks(TestParallel::TestParallel) [/opt/ruby-trunk/src/ruby-trunk/test/testunit/testparallel.rb:156]:
Expected /.+SF.+F.*$/ to match "Run options: -j t2\n\n# Running ptests:\n\n..SFF..\nRetrying...\n\n.SF.\n\n\n\nFinished ptests in 0.068964s, 101.5022 tests/s, 43.5010 assertions/s.\n\n 1) Skipped:\nptest
alwaysskip(TestE) [/opt/ruby-trunk/src/ruby-trunk/test/testunit/testsforparallel/testforth.rb:10]:\nSkipped, no message given\n\n 2) Failure:\nptestalwaysfail(TestE) [/opt/ruby-trunk/src/ruby-trunk/test/testunit/testsforparallel/test_forth.rb:14]:\n expected but was\n.\n\n7 tests, 3 assertions, 1 failures, 0 errors, 1 skips\n".

このテストが実行している子テストのテストケースの順番が入れ替わることがあるのに対応していないみたいです。
".SF" と "F" という塊があることを確認すれば良いのであれば以下のような変更でどうでしょうか。

Index: test/testunit/testparallel.rb
===================================================================
--- test/testunit/test
parallel.rb (revision 31020)
+++ test/testunit/testparallel.rb (working copy)
@@ -153,7 +153,7 @@
def test
shouldrunallwithoutanyleaks
spawn
runner
buf = timeout(10){@testout.read}
- assert
match(/.+SF.+F.*$/,buf)
+ assert_match(/\+SF.F|.F..+SF).$/,buf)
end

  def test_should_retry_failed_on_workers

=end

Associated revisions

Revision 31023
Added by Tomoyuki Chikanaga about 3 years ago

  • test/testunit/testparallel.rb (testshouldrunallwithoutany_leaks): consider that the order of testcase could change. [Bug #4466]

Revision 31043
Added by Tomoyuki Chikanaga about 3 years ago

  • test/testunit/testparallel.rb (testshouldrunallwithoutany_leaks): accomplish r31023. [Bug #4466]

History

#1 Updated by Shota Fukumori about 3 years ago

  • Category changed from test to lib
  • Status changed from Open to Assigned

=begin
sora_hです。

なるほど。それコミットしてしまって良いです。

パッチを感謝します。 :)

--sora_h
=end

#2 Updated by Shota Fukumori about 3 years ago

  • Status changed from Assigned to Closed

=begin
It seems fixed at r31023 (committed by nagachika).
Closing.
=end

Also available in: Atom PDF