-
Notifications
You must be signed in to change notification settings - Fork 130
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
Set up file logging when shutting down the Jenkins test instance. #657
Conversation
This should help to identify race conditions
if (exception.getSuppressed().length > 0) { | ||
throw exception; | ||
} | ||
} | ||
|
||
private static final class TemporaryConsoleLogTweak implements AutoCloseable { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this temporary, and how will we ensure that it does not become permanent?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not meant to be temporary, I renamed the class to clarify the intent.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not meant to be temporary
What would its value be after we diagnose and fix the bug seen in https://github.com/jenkinsci/jenkins/pull/8511/checks?check_run_id=17000216956?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If there is no more race condition, I would fine removing it, but the thing is with this kind of issue is that it always pop up at an unexpected time and you often don't have enough data to investigate. On the other hand its impact is very light (under normal condition this adds one stacktrace writing queue.xml
) since you wouldn't expect much xmlfile write being donc between stopping the test Jenkins instance and the cleanup sequence.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fine with the merge of this PR if and only if it is reverted once its diagnostic value has been exhausted.
Clarify that this is not temporary, just applied within the block.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks helpful; has it be shown to work anywhere?
I tested this change locally against the test failing in https://github.com/jenkinsci/jenkins/pull/8511/checks?check_run_id=17000216956, it shows correctly the |
Ah so this is going to print
at the end of every test, which is not really desirable, since it is adding noise about a normal event. We would certainly want to know about writes after |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might work. Hard to predict.
Yeah, at least this is not polluting every test log anymore. |
I reran all of |
Matching change to jenkinsci/jenkins#8513
This should help to identify race conditions during tests without causing too much noise as it only kicks in just before cleaning up the instance.
Testing done
Submitter checklist