Skip to content

Commit 71188fe

Browse files
authored
Do not call contributeTestData with WorkflowRun lock held (#738)
1 parent 4961c2f commit 71188fe

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

src/main/java/hudson/tasks/junit/JUnitResultArchiver.java

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,15 @@ public static TestResultSummary parseAndSummarize(
291291
task.isKeepTestNames())
292292
.summarizeResult(testResults, build, pipelineTestDetails, workspace, launcher, listener, storage);
293293
}
294+
var data = new ArrayList<TestResultAction.Data>();
295+
if (task.getTestDataPublishers() != null) {
296+
for (var tdp : task.getTestDataPublishers()) {
297+
var d = tdp.contributeTestData(build, workspace, launcher, listener, result);
298+
if (d != null) {
299+
data.add(d);
300+
}
301+
}
302+
}
294303

295304
synchronized (build) {
296305
// TODO can the build argument be omitted now, or is it used prior to the call to addAction?
@@ -320,14 +329,7 @@ public static TestResultSummary parseAndSummarize(
320329
}
321330
}
322331

323-
if (task.getTestDataPublishers() != null) {
324-
for (TestDataPublisher tdp : task.getTestDataPublishers()) {
325-
TestResultAction.Data d = tdp.contributeTestData(build, workspace, launcher, listener, result);
326-
if (d != null) {
327-
action.addData(d);
328-
}
329-
}
330-
}
332+
data.forEach(action::addData);
331333

332334
if (appending) {
333335
build.save();

0 commit comments

Comments
 (0)