diff options
author | k0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-07-24 12:19:47 +0000 |
---|---|---|
committer | k0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-07-24 12:19:47 +0000 |
commit | e8df28d9aedbf60dfae8c7615da3e9a130a2ee44 (patch) | |
tree | b619776c78715ccb3a6c1c406787b1134efbcc54 /test/ruby/test_jit.rb | |
parent | afba9cd7fe77da110d4f2a596531bad4ff185e61 (diff) | |
download | ruby-e8df28d9aedbf60dfae8c7615da3e9a130a2ee44.tar.gz |
test_jit.rb: give up debugging cc1 issue
in a short term, and add retries to prevent random CI failures by it.
I remember this and will address it later for sure.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64032 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_jit.rb')
-rw-r--r-- | test/ruby/test_jit.rb | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/test/ruby/test_jit.rb b/test/ruby/test_jit.rb index b20ae881b8..60768812ff 100644 --- a/test/ruby/test_jit.rb +++ b/test/ruby/test_jit.rb @@ -730,19 +730,6 @@ class TestJIT < Test::Unit::TestCase out, err = eval_with_jit(script, verbose: 1, min_calls: min_calls) actual = err.scan(/^#{JIT_SUCCESS_PREFIX}:/).size - # Debugging on CI - if err.include?("error trying to exec 'cc1': execvp: No such file or directory") && RbConfig::CONFIG['CC'].start_with?('gcc') - $stderr.puts "\ntest/ruby/test_jit.rb: DEBUG OUTPUT:" - cc1 = %x`gcc -print-prog-name=cc1`.rstrip - if $?.success? - $stderr.puts "cc1 path: #{cc1}" - $stderr.puts "executable?: #{File.executable?(cc1)}" - $stderr.puts "ls:\n#{IO.popen(['ls', '-la', File.dirname(cc1)], &:read)}" - else - $stderr.puts 'Failed to fetch cc1 path' - end - end - # Make sure that the script has insns expected to be tested used_insns = method_insns(script) insns.each do |insn| @@ -799,11 +786,22 @@ class TestJIT < Test::Unit::TestCase # Run Ruby script with --jit-wait (Synchronous JIT compilation). # Returns [stdout, stderr] def eval_with_jit(env = nil, script, **opts) - stdout, stderr, status = super - assert_equal(true, status.success?, "Failed to run script with JIT:\n#{code_block(script)}\nstdout:\n#{code_block(stdout)}\nstderr:\n#{code_block(stderr)}") + stdout, stderr = nil, nil + # retry 3 times while cc1 error happens. + 3.times do |i| + stdout, stderr, status = super + assert_equal(true, status.success?, "Failed to run script with JIT:\n#{code_block(script)}\nstdout:\n#{code_block(stdout)}\nstderr:\n#{code_block(stderr)}") + break unless retried_stderr?(stderr) + end [stdout, stderr] end + # We're retrying cc1 not found error on gcc, which should be solved in the future but ignored for now. + def retried_stderr?(stderr) + RbConfig::CONFIG['CC'].start_with?('gcc') && + stderr.include?("error trying to exec 'cc1': execvp: No such file or directory") + end + def code_block(code) "```\n#{code}\n```\n\n" end |