Skip to content

Delete builds in QueueTest to prevent Windows test failures#26104

Merged
MarkEWaite merged 2 commits intojenkinsci:masterfrom
MarkEWaite:fix-QueueTest-failures
Jan 12, 2026
Merged

Delete builds in QueueTest to prevent Windows test failures#26104
MarkEWaite merged 2 commits intojenkinsci:masterfrom
MarkEWaite:fix-QueueTest-failures

Conversation

@MarkEWaite
Copy link
Contributor

@MarkEWaite MarkEWaite commented Jan 11, 2026

Delete builds in QueueTest to prevent Windows test failures

The Windows file system prevents cleanup of the builds and jobs directories while the test has them open. Stopping the builds and deleting them is enough to close the directories and allow them to be deleted.

Also removes noisy test logging from QueueTest because no one is reading the test logs. They add megabytes to the output and may obscure useful messages.

This pull request improves the execution time of the modified test. The test previously required 30 seconds to complete. It now completes in less than 2 seconds.

Testing done

  • Before this change, testGetCauseOfBlockageForNonConcurrentFreestyle failed in about 50% of runs on my 7 different Windows agents
  • After this change, testGetCauseOfBlockageForNonConcurrentFreestyle passes all runs on my 7 different Windows agents

Proposed changelog entries

  • N/A

Proposed changelog category

/label skip-changelog

Proposed upgrade guidelines

N/A

Submitter checklist

  • The issue, if it exists, is well-described.
  • The changelog entries and upgrade guidelines are appropriate for the audience affected by the change (users or developers, depending on the change) and are in the imperative mood (see examples). Fill in the Proposed upgrade guidelines section only if there are breaking changes or changes that may require extra steps from users during upgrade.
  • There is automated testing or an explanation as to why this change has no tests.
  • New public classes, fields, and methods are annotated with @Restricted or have @since TODO Javadocs, as appropriate.
  • New deprecations are annotated with @Deprecated(since = "TODO") or @Deprecated(forRemoval = true, since = "TODO"), if applicable.
  • UI changes do not introduce regressions when enforcing the current default rules of Content Security Policy Plugin. In particular, new or substantially changed JavaScript is not defined inline and does not call eval to ease future introduction of Content Security Policy (CSP) directives (see documentation).
  • For dependency updates, there are links to external changelogs and, if possible, full differentials.
  • For new APIs and extension points, there is a link to at least one consumer.

Desired reviewers

N/A

Before the changes are marked as ready-for-merge:

Maintainer checklist

  • There are at least two (2) approvals for the pull request and no outstanding requests for change.
  • Conversations in the pull request are over, or it is explicit that a reviewer is not blocking the change.
  • Changelog entries in the pull request title and/or Proposed changelog entries are accurate, human-readable, and in the imperative mood.
  • Proper changelog labels are set so that the changelog can be generated automatically.
  • If the change needs additional upgrade steps from users, the upgrade-guide-needed label is set and there is a Proposed upgrade guidelines section in the pull request title (see example).
  • If it would make sense to backport the change to LTS, be a Bug or Improvement, and either the issue or pull request must be labeled as lts-candidate to be considered.

No one is reading the test logs.  They add megabytes to the output and
may obscure useful messages.
…ailures

The Windows file system prevents cleanup of the builds and jobs directory
while the test has them open.  Stopping the builds and deleting them is
enough to close the directory and allow it to be deleted.

Testing done:

* Before this change, testGetCauseOfBlockageForNonConcurrentFreestyle
  failed in about 50% of runs on my 7 different Windows agents
* After this change, testGetCauseOfBlockageForNonConcurrentFreestyle
  passes all runs on my 7 different Windows agents
@MarkEWaite MarkEWaite added skip-changelog Should not be shown in the changelog tests This PR adds/removes/updates test cases labels Jan 11, 2026
@MarkEWaite
Copy link
Contributor Author

The Launchable report shows that the test has been flaky for a long time. The graphs look like this:

screencapture-app-launchableinc-organizations-jenkins-workspaces-jenkins-data-test-paths-class-hudson-model-QueueTest-2026-01-11-06_52_04-edit

@MarkEWaite MarkEWaite changed the title Stop and delete builds 1 and 2 in QueueTest to prevent Windows test failures Delete builds 1 and 2 in QueueTest to prevent Windows test failures Jan 12, 2026
@MarkEWaite MarkEWaite changed the title Delete builds 1 and 2 in QueueTest to prevent Windows test failures Delete builds in QueueTest to prevent Windows test failures Jan 12, 2026
@MarkEWaite
Copy link
Contributor Author

@alecharp would you be willing to review this improvement to the test? I'd really like to reduce the flakiness of QueueTest.testGetCauseOfBlockageForNonConcurrentFreestyle on Windows.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes Windows test failures in QueueTest by properly cleaning up build resources and removes noisy debug logging. The changes address file system locking issues on Windows that prevented proper cleanup of build directories during test execution, reducing test execution time from 30 seconds to under 2 seconds.

Changes:

  • Removed unused debug logging infrastructure (LogRecorder field and related imports)
  • Removed noisy System.out.println statements that printed queue.xml and build.xml contents
  • Modified testGetCauseOfBlockageForNonConcurrentFreestyle to explicitly stop and delete builds for proper cleanup

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@MarkEWaite
Copy link
Contributor Author

The analysis in the Copilot session matches with my analysis from code review and multiple test runs. Very nice!

@MarkEWaite MarkEWaite merged commit 06a4115 into jenkinsci:master Jan 12, 2026
24 checks passed
@MarkEWaite MarkEWaite deleted the fix-QueueTest-failures branch January 12, 2026 22:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip-changelog Should not be shown in the changelog tests This PR adds/removes/updates test cases

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants