Skip to content
This repository was archived by the owner on Aug 5, 2022. It is now read-only.

Commit 9a7d27b

Browse files
committed
CI Jenkinsfile: grab lock during add to global data
Multiple workers add to global summary buffer, or upload artifacts to master, safer to have a lock. Signed-off-by: Olev Kartau <olev.kartau@intel.com>
1 parent b044671 commit 9a7d27b

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

Jenkinsfile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,12 @@ try {
146146
} finally {
147147
// read tests summary prepared by tester-exec.sh
148148
// Here one tester adds it's summary piece to the global buffer.
149-
global_sum_log += readFile "results-summary-${test_device}.${img}.log"
150-
archiveArtifacts allowEmptyArchive: true,
151-
artifacts: '*.log, *.xml'
149+
// Grab lock as we deal with global data from multiple workers
150+
lock(resource: "global_data") {
151+
global_sum_log += readFile "results-summary-${test_device}.${img}.log"
152+
archiveArtifacts allowEmptyArchive: true,
153+
artifacts: '*.log, *.xml'
154+
}
152155
}
153156
// without locking we may lose tester result set(s)
154157
// if testers run xunit step in nearly same time

0 commit comments

Comments
 (0)