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

Skip LogRotatorTest#ableToDeleteCurrentBuild on Windows #9923

Merged
merged 2 commits into from
Nov 2, 2024

Conversation

dwnusbaum
Copy link
Member

Trying to fix another observed flake from #9810, see https://github.com/jenkinsci/jenkins/pull/9810/files/9aaa7ba3fe523c07a4ed8d63281dbe86db064465#r1819518792.

Testing done

I ran these tests manually a little bit to check various things, but I do not have easy access to Windows to run the tests in a loop to check flakiness in a robust way. The observed failure is due to log rotation failing to delete a build with this exception:

Also:   java.nio.file.AccessDeniedException: C:\Jenkins\agent\workspace\Core_jenkins_PR-9921\test\target\j h17634935987546233869\jobs\test0\builds\1 -> C:\Jenkins\agent\workspace\Core_jenkins_PR-9921\test\target\j h17634935987546233869\jobs\test0\builds\.1
		at java.base/sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:89)
		at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:103)
		at java.base/sun.nio.fs.WindowsFileCopy.move(WindowsFileCopy.java:317)
		at java.base/sun.nio.fs.WindowsFileSystemProvider.move(WindowsFileSystemProvider.java:293)
		at java.base/java.nio.file.Files.move(Files.java:1432)
		at hudson.model.Run.delete(Run.java:1598)
		at hudson.tasks.LogRotator.perform(LogRotator.java:179)
jenkins.util.io.CompositeIOException: Failed to rotate logs for [test0 #1]
	at hudson.tasks.LogRotator.perform(LogRotator.java:236)
	at hudson.model.Job.logRotate(Job.java:490)
	at jenkins.model.GlobalBuildDiscarderListener.onFinalized(GlobalBuildDiscarderListener.java:51)
	at hudson.model.listeners.RunListener.lambda$fireFinalized$3(RunListener.java:260)
	at jenkins.util.Listeners.lambda$notify$0(Listeners.java:59)
	at jenkins.util.Listeners.notify(Listeners.java:67)
	at hudson.model.listeners.RunListener.fireFinalized(RunListener.java:258)
	at hudson.model.Run.onEndBuilding(Run.java:1985)
	at hudson.model.Run.execute(Run.java:1892)
	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:44)
	at hudson.model.ResourceController.execute(ResourceController.java:101)
	at hudson.model.Executor.run(Executor.java:446)

My best hypothesis is that the move failed because something else was accessing the directory in question, but given the AccessDeniedException that did not have the typical The process cannot access the file because it is being used by another process message, perhaps the problem was something else entirely.

Proposed changelog entries

N/A

Proposed upgrade guidelines

N/A

Submitter checklist

Desired reviewers

@mention

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

Maintainer checklist

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.

FWIW I ran the test (in trunk) 5× on Windows 10 and it passed every time.

Copy link
Contributor

@MarkEWaite MarkEWaite left a comment

Choose a reason for hiding this comment

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

This PR is now ready for merge. We will merge it after approximately 24 hours if there is no negative feedback.

/label ready-for-merge

@comment-ops-bot comment-ops-bot bot added the ready-for-merge The PR is ready to go, and it will be merged soon if there is no negative feedback label Oct 31, 2024
@MarkEWaite MarkEWaite merged commit bec45d7 into jenkinsci:master Nov 2, 2024
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-for-merge The PR is ready to go, and it will be merged soon if there is no negative feedback 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.

3 participants