-
Notifications
You must be signed in to change notification settings - Fork 55
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
Defending against corrupt builds #282
Merged
jglick
merged 1 commit into
jenkinsci:master
from
Vlatombe:defend-against-corrupt-builds
Mar 14, 2024
Merged
Defending against corrupt builds #282
jglick
merged 1 commit into
jenkinsci:master
from
Vlatombe:defend-against-corrupt-builds
Mar 14, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Vlatombe
commented
Mar 14, 2024
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.
(ignore ws)
jglick
approved these changes
Mar 14, 2024
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.
Following up #247.
Vlatombe
added a commit
to Vlatombe/junit-plugin
that referenced
this pull request
Sep 26, 2024
I've seen builds failing in the wild during `junit` step execution with an exception like ``` java.lang.NullPointerException: Cannot invoke "hudson.model.Run.getRootDir()" because "this.run" is null at PluginClassLoader for junit//hudson.tasks.junit.TestResultAction.getDataFilePath(TestResultAction.java:154) at PluginClassLoader for junit//hudson.tasks.junit.TestResultAction.loadCached(TestResultAction.java:317) at PluginClassLoader for junit//hudson.tasks.junit.TestResultAction.load(TestResultAction.java:279) at PluginClassLoader for junit//hudson.tasks.junit.TestResultAction.getResult(TestResultAction.java:166) at PluginClassLoader for junit//hudson.tasks.junit.TestResultAction.getResult(TestResultAction.java:70) at PluginClassLoader for junit//hudson.tasks.test.AbstractTestResultAction.findCorrespondingResult(AbstractTestResultAction.java:286) at PluginClassLoader for junit//hudson.tasks.test.TestResult.getPreviousResult(TestResult.java:146) at PluginClassLoader for junit//hudson.tasks.junit.TestResult.getPreviousResult(TestResult.java:467) at PluginClassLoader for junit//hudson.tasks.junit.CaseResult.getPreviousResult(CaseResult.java:768) at PluginClassLoader for junit//hudson.tasks.junit.CaseResult.recomputeFailedSinceIfNeeded(CaseResult.java:669) at PluginClassLoader for junit//hudson.tasks.junit.CaseResult.freeze(CaseResult.java:950) at PluginClassLoader for junit//hudson.tasks.junit.SuiteResult.freeze(SuiteResult.java:730) at PluginClassLoader for junit//hudson.tasks.junit.TestResult.freeze(TestResult.java:1119) at PluginClassLoader for junit//hudson.tasks.junit.TestResultAction.setResult(TestResultAction.java:125) at PluginClassLoader for junit//hudson.tasks.junit.TestResultAction.<init>(TestResultAction.java:96) at PluginClassLoader for junit//hudson.tasks.junit.JUnitResultArchiver.parseAndSummarize(JUnitResultArchiver.java:301) at PluginClassLoader for junit//hudson.tasks.junit.pipeline.JUnitResultsStepExecution.run(JUnitResultsStepExecution.java:62) at PluginClassLoader for junit//hudson.tasks.junit.pipeline.JUnitResultsStepExecution.run(JUnitResultsStepExecution.java:27) at PluginClassLoader for workflow-step-api//org.jenkinsci.plugins.workflow.steps.SynchronousNonBlockingStepExecution.lambda$start$0(SynchronousNonBlockingStepExecution.java:47) at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539) at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136) at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635) at java.base/java.lang.Thread.run(Thread.java:840) ``` While the root cause for such corruption is still to be identified, the plugin should defend against that condition and ignore such a build. Similar to jenkinsci/parallel-test-executor-plugin#282
6 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I've seen some builds failing during
splitTests
execution with an exception likeThere may be a bug in the JUnit plugin, or some problem with pipeline persistence that causes it to load the build partially corrupted. In any case, the plugin should defend itself against such state and skip such build.
I don't know how to recreate such a broken run state, so no added test for now.
Testing done
Submitter checklist