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

Use waitForMessage instead of assertLogContains #866

Merged
merged 6 commits into from
Apr 11, 2020

Conversation

MarkEWaite
Copy link
Contributor

Use waitForMessage instead of assertLogContains

Jesse Glick noted in a comment that some flaky pipeline tests in other plugins could be resolved by switching from assertLogContains to waitForMessage. Since the git plugin has shown a tendency to flaky tests on Windows, let's use Jesse's recommendation as well.

Checklist

  • I have read the CONTRIBUTING doc
  • 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
  • Any dependent changes have been merged and published in upstream modules (like git-client-plugin)

Types of changes

  • Test

Jesse Glick noted that some flaky pipeline tests in other plugins
could be resolved by switching from assertLogContains to
waitForMessage. Since the git plugin has shown a tendency to flaky
tests on Windows, let's use Jesse's recommendation as well.

See jenkinsci/bom#110 (comment)
Easier to diagnose a failure if the assertion describes the expectation
Wait briefly for newly scheduled job to start.  Once job has started,
waitForAllJobsToComplete will hold the test until job completes.  Windows
can remove log files once job completes.  Wait on non-Windows reduces
log file InterruptedException from rule teardown before job completion.
Wait on non-Windows not strictly required but gives one less exception
in the test log.
@MarkEWaite MarkEWaite merged commit 8fbb81e into jenkinsci:master Apr 11, 2020
@MarkEWaite MarkEWaite deleted the use-waitForMessage branch April 11, 2020 18:16
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