Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test/rdoc/test_rdoc_generator_json_index.rb: pend in test_generate in ppc64le. #1050

Merged

Conversation

junaruga
Copy link
Member

@junaruga junaruga commented Nov 2, 2023

This PR is a workaround for the #1048 to always pass the test in ruby/ruby's Travis CI.


We observed that this test randomly fails in the ruby/ruby Travis ppc64le case. This commit is to pend the test_generate if the assertion for the generated file's modified time fails in a ppc64le environment.

Note that I didn't use the word "Travis CI" or Travis CI specific environment variables such as TRAVIS and TRAVIS_CPU_ARCH[1] in the code. Because I wanted to prioritize the rdoc's independence from the ruby/ruby.

[1] https://docs.travis-ci.com/user/environment-variables/#default-environment-variables


Note that RUBY_PLATFORM prints the following text in RubyCI's ppc64le Ubuntu server.

$ ruby -e 'puts RUBY_PLATFORM'
powerpc64le-linux-gnu

If the issue happens, the result of the test should be printed like this in ruby/rdoc repository. Note this is not actual log. I created it to explain it.

$ bundle exec rake test
...
Pending: test_generate(TestRDocGeneratorJsonIndex):
  Unstable test in ppc64le.
  <2023-10-30 15:38:35.936097453 +0100> expected but was
  <2023-10-30 15:38:35 +0100>.
/home/jaruga/var/git/ruby/rdoc/test/rdoc/test_rdoc_generator_json_index.rb:112:in `test_generate'
     109:     # https://github.com/ruby/rdoc/issues/1048
     110:     if orig_file.mtime.inspect != generated_file.mtime.inspect &&
     111:       RUBY_PLATFORM =~ /powerpc64le/
  => 112:       pend <<~EOC
     113:         Unstable test in ppc64le.
     114:         <#{orig_file.mtime.inspect}> expected but was
     115:         <#{generated_file.mtime.inspect}>.
...
2249 tests, 5715 assertions, 0 failures, 0 errors, 1 pendings, 0 omissions, 0 notifications
99.9555% passed
...

… ppc64le.

We observed that this test randomly fails in the ruby/ruby Travis ppc64le case.
This commit is to pend the test_generate if the assertion for the generated
file's modified time fails in a ppc64le environment.

Note that I didn't use the word "Travis CI" or Travis CI specific environment variables
such as `TRAVIS` and `TRAVIS_CPU_ARCH`[1] in the code. Because I wanted to prioritize the
rdoc's independence from the ruby/ruby.

[1] https://docs.travis-ci.com/user/environment-variables/#default-environment-variables
@junaruga junaruga merged commit 42cdad1 into ruby:master Nov 3, 2023
21 checks passed
@junaruga
Copy link
Member Author

junaruga commented Nov 3, 2023

All the tests passed. Let me merge the PR.

@junaruga junaruga deleted the wip/rdoc-generator-json-index-pend-ppc64le branch November 3, 2023 10:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant