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

Avoid cleanup failures in GitStatusTest & GitSCMTest #802

Merged
merged 2 commits into from
Dec 20, 2019

Conversation

MarkEWaite
Copy link
Contributor

@MarkEWaite MarkEWaite commented Dec 19, 2019

Avoid cleanup failures in GitStatusTest & GitSCMTest

GitSCMTest and GitStatusTest both fail intermittently on ci.jenkins.io Windows computers. The failures are due to a busy log file or a busy job directory. The failures are not due to busy git files or busy git directories. I assume some component is holding a file open at that point in the test.

Rather than spend significant time trying to find the component of JenkinsRule that is holding the build log open, it is simpler to use a "sleep" variant in one test and to skip the tests on the ci.jenkins.io Windows computers in the other test.

Tests continue to execute when run by developers. Tests continue to execute in my Windows and Linux and FreeBSD test environment.

Checklist

  • I have read the CONTRIBUTING doc
  • I have added tests that verify my changes
  • Unit tests pass locally with my changes
  • I have added documentation as necessary
  • No Javadoc warnings were introduced with my changes
  • No spotbugs warnings were introduced with my changes
  • I have interactively tested my changes

Types of changes

  • Dependency or infrastructure update

@MarkEWaite MarkEWaite force-pushed the fix-GitStatus-test-failures branch 2 times, most recently from 87714ed to 9df2af9 Compare December 20, 2019 02:45
Parent pom 2.54 includes a Jenkins Test Harness version which no longer
hides exceptions on test cleanup. Rather than spending enormous effort
identifying why build log files are still open at the end of a test
on ci.jenkins.io, apply workarounds specific to ci.jenkins.io which
either skip the tests or apply additional workarounds in hopes the tests
will pass.

The GitStatusTest fails on ci.jenkins.io Windows agents when attempting
to remove a build log file.  The test uses notifyCommit in a mocked
environment with JenkinsRule.  That seems to leave the build log
busy even after the test completes.  Skip those tests on Windows when
running on ci.jenkins.io.  Run them in all other locations.  They pass
consistently on the 4 Windows machines in my CI cluster, but fail too
frequently on ci.jenkins.io.

The GitSCMTest fails on ci.jenkins.io Windows agents when attempting
to remove a build log file.  On ci.jenkins.io Windows computers, wait
up to 5 seconds for the JenkinsRule instance to be idle before exiting
the specific test.  I hope that will reduce the intermittent failures
without requiring that all methods in the test are disabled.
@MarkEWaite MarkEWaite force-pushed the fix-GitStatus-test-failures branch from 557244e to f92e0a3 Compare December 20, 2019 16:07
@MarkEWaite MarkEWaite changed the title GitStatusTest notifyCommit wait up to 9 seconds GitStatusTest and GitSCMTest avoid JTH cleanup failures Dec 20, 2019
@MarkEWaite MarkEWaite changed the title GitStatusTest and GitSCMTest avoid JTH cleanup failures Avoid cleanup failures in GitStatusTest & GitSCMTest Dec 20, 2019
@MarkEWaite MarkEWaite merged commit 5f1103c into jenkinsci:master Dec 20, 2019
@MarkEWaite MarkEWaite deleted the fix-GitStatus-test-failures branch December 20, 2019 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant