Skip to content

Conversation

@MarkEWaite
Copy link
Contributor

@MarkEWaite MarkEWaite commented Sep 28, 2025

Prevent testProviderRefresh test failures due to log ordering differences

Accept either the typical ordering of log messages or an alternate ordering of log messages in testProviderRefresh. The same messages are used in each case, but the sequence of messages changes.

Accepting either ordering assures that we won't have plugin BOM failures due to timing differences or other differences in test infrastructure.

Change prompted by test failures in:

Discussion started when jenkinsci/bom#5718 (comment) detected a failure in this test when run within the plugin bill of materials.

Discussion continued when jenkinsci/bom#5720 (comment) tested more deeply and found that it failed more than 5% of my test runs locally.

Additional local testing confirmed that the order of the log messages was sometimes slightly different than the original assertion expected. This change accepts either ordering.

Testing done

  • Before this change, the test would fail 5% of the time on in the 60+ tests I ran on my AMD Ryzen 5 5600X 6-Core Processor on Red Hat Enterprise Linux 8 when run with
    mvn -Dtest=GithubAppCredentialsTest#testProviderRefresh test

  • After this change, the test passes 100% of the time in the 36 test runs that I ran

No documentation changes are needed. This is only a change in a test.

May be easier to review with whitespace ignored.

Submitter checklist

  • Link to JIRA ticket in description, if appropriate.
  • Change is code complete and matches issue description
  • Automated tests have been added to exercise the changes
  • Reviewer's manual test instructions provided in PR description. See Reviewer's first task below.

Reviewer checklist

  • Run the changes and verify that the change matches the issue description
  • Reviewed the code
  • Verified that the appropriate tests have been written or valid explanation given

Documentation changes

  • Link to jenkins.io PR, or an explanation for why no doc changes are needed

Users/aliases to notify

  • @jtnord (most recent editor of the test)
  • @bitwiseman (original author of the test)
  • @Dohbedoh (participant in okhttp API pull request)

…nces

Accept either the typical ordering of log messages or an alternate
ordering of log messages in testProviderRefresh.  The same messages are
used in each case, but the sequence of messages changes.

Accepting either ordering assures that we won't have plugin BOM failures
due to timing differences or other differences in test infrastructure.

jenkinsci/bom#5718 (comment)
detected a failure in this test when run within the plugin bill of
materials.

jenkinsci/bom#5720 (comment) tested
more deeply and found that it failed more than 5% of my test runs locally.

Additional local testing confirmed that the order of the log messages was
sometimes slightly different than the original assertion expected. This
change accepts either ordering.

Testing done:

* Before this change, the test would fail 5% of the time on my
  AMD Ryzen 5 5600X 6-Core Processor on Red Hat Enterprise Linux 8
  when run with
  `mvn -Dtest=GithubAppCredentialsTest#testProviderRefresh test`

* After this change, the test passes 100% of the time in the 36 test
  runs that I used to check it
@MarkEWaite MarkEWaite requested a review from a team as a code owner September 28, 2025 14:43
Copy link
Contributor

@Dohbedoh Dohbedoh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @MarkEWaite !

@jglick jglick merged commit 50ffb78 into jenkinsci:master Sep 30, 2025
17 checks passed
@MarkEWaite MarkEWaite deleted the prevent-flakes-from-testProviderRefresh branch December 3, 2025 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants