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

Prevent multiBranchPipelineIndex failure due to DirectoryNotEmptyException #2505

Merged

Conversation

MarkEWaite
Copy link
Contributor

@MarkEWaite MarkEWaite commented Sep 21, 2023

Fix multiBranchPipelineIndex test failure

  • Do not exit test until no activity

https://github.com/jenkinsci/bom/runs/16996428210 shows the failure happened in 2 of the 4 configurations that are tested by the plugin bill of materials.

This pull request resolves the issue by

  • Wait for Jenkins to be quiet before exiting the test (may not prevent all test failures)

We like having the blueocean plugin in the Jenkins plugin bill of materials so that we can detect issues more quickly.

Submitter checklist

  • Link to JIRA ticket in description, if appropriate.
  • Change is code complete and matches issue description
  • Appropriate unit or acceptance tests or explanation to why this change has no tests
  • Reviewer's manual test instructions provided in PR description. See Reviewer's first task below.

Reviewer checklist

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

The test failed on a plugin bill of materials run for 2 of the 4 tested
configurations.  The failure message was a

Caused by: java.nio.file.DirectoryNotEmptyException: blueocean-pipeline-api-impl/target/tmp/j h2197780848444070882/jobs/p

This is a rather heavy-handed way to avoid the intermittent test failure,
since it will stop running the test in all environments, all the time.

The other tests in this class that use the runAllTests flag have used
it since 2016.  I didn't find any reference that indicated the tests
are enabled by any operation in the repository itself.  They might
be executed on a CI system that defines the RUN_MULTIBRANCH_TESTS
environment variable.
Avoid intermittent DirectoryNotEmptyException in the test by delaying
exit until Jenkins is quiet.
@MarkEWaite MarkEWaite requested a review from a team as a code owner September 21, 2023 14:38
Copy link
Member

@jglick jglick left a comment

Choose a reason for hiding this comment

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

Similar to #2468. TBH it is not clear to me what tests like this are even doing to begin with. That you get a 200 response from some HTTP endpoint? But it does not seem to assert the contents of the response at all. Apparently this is a multibranch project, and perhaps after branch indexing completes there are some builds? Or just branch projects with no builds?

@jglick
Copy link
Member

jglick commented Sep 22, 2023

@olamy olamy merged commit d95cf09 into jenkinsci:master Sep 23, 2023
14 checks passed
@MarkEWaite MarkEWaite deleted the exclude-multiBranchPipelineIndex-test branch October 21, 2023 11:15
MarkEWaite added a commit to jenkinsci/bom that referenced this pull request Oct 21, 2023
Would be better to exclude only for Jenkins 2.387.x, since the test has
been fixed in jenkinsci/blueocean-plugin#2505 ,
but there is not currently a way to exclude a test for a single line.

Includes a TODO comment that the exclusion should be removed when the
2.387.x line is no longer included in the plugin bill of materials.

https://github.com/jenkinsci/bom/pull/2593/checks?check_run_id=17920234324
shows the most recent failure only happeend on the 2.387.x line.
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