@@ -18,6 +18,7 @@ import hudson.model.Result;
18
18
import java.text.SimpleDateFormat ;
19
19
import java.util.Date ;
20
20
import java.util.TimeZone ;
21
+ import java.util.concurrent.ConcurrentHashMap ;
21
22
22
23
/*
23
24
// For in-place tests as Replay pipeline:
@@ -652,8 +653,19 @@ def call(Map dynacfgBase = [:], Map dynacfgPipeline = [:]) {
652
653
} // stage item: par1["Discover slow build matrix"]
653
654
} // if slowBuild...
654
655
656
+ try {
657
+ String qtxt = " Quick-test phase planned parallel stages (overall, not only dynamatrix): " + par1. values(). count { it instanceof Closure }
658
+ echo qtxt
659
+ manager. addShortText(qtxt)
660
+ } catch (Throwable ignore) {} // no-op
661
+
655
662
// Walk the plank
656
- parallel par1
663
+ try {
664
+ parallel par1
665
+ } catch (Throwable t) {
666
+ echo " [ERROR] Something failed in the parallel stage: ${ t} "
667
+ currentBuild. result = ' FAILURE'
668
+ }
657
669
658
670
echo " Completed the 'Quick tests and prepare the bigger dynamatrix' stage"
659
671
} // stage-quick tests
@@ -674,6 +686,24 @@ def call(Map dynacfgBase = [:], Map dynacfgPipeline = [:]) {
674
686
echo " [Quick tests and prepare the bigger dynamatrix summary] Discovered ${ Math.max(stagesBinBuild.size() - 1, 0)} 'slow build' combos to run" + (dynacfgPipeline?. failFast ? " ; failFast mode is enabled: " + (dynacfgPipeline?. failFastSafe ? " dynamatrix 'safe'" : " parallel step" ) + " implementation" : " " )
675
687
echo " [Quick tests and prepare the bigger dynamatrix summary] ${ currentBuild.result} "
676
688
if (! (currentBuild. result in [null , ' SUCCESS' ])) {
689
+ // The "parallel par1" above failed...
690
+ try {
691
+ // Not reporting counts from our "dynamatrix" object here, it is empty up here.
692
+ // The yellow badge reported until now came from another, was made (and hidden
693
+ // and scrapped) by shellcheck() step => prepareDynamatrix() step.
694
+ txt = " Quick-test phase: FAILED"
695
+ // DO NOT remove badges - let last words be seen!
696
+ // manager.removeBadges()
697
+ manager. addShortText(txt)
698
+ createSummary(
699
+ text : txt,
700
+ icon : ' /images/svgs/warning.svg' // '/images/48x48/warning.png'
701
+ )
702
+ } catch (Throwable t) {
703
+ echo " WARNING: Tried to addShortText() and createSummary(), but failed to; are the Groovy Postbuild plugin and jenkins-badge-plugin installed?"
704
+ if (dynamatrixGlobalState. enableDebugTrace) echo t. toString()
705
+ }
706
+
677
707
if (Utils . isClosure(dynacfgPipeline?. notifyHandler)) {
678
708
try {
679
709
// Can depend on plugins not available at this Jenkins
@@ -884,7 +914,8 @@ def call(Map dynacfgBase = [:], Map dynacfgPipeline = [:]) {
884
914
885
915
// Remove Jenkins-defined results; and also the
886
916
// data Dynamatrix.groovy classifies; do any remain?
887
- Map<String , Integer > mapresOther = (Map<String , Integer > )(mapCountStages. clone())
917
+ Map<String , Integer > mapresOther = new ConcurrentHashMap<String , Integer > ()
918
+ mapresOther. putAll(mapCountStages)
888
919
for (String r in [
889
920
' SUCCESS' , ' FAILURE' , ' UNSTABLE' , ' ABORTED' , ' NOT_BUILT' ,
890
921
' STARTED' , ' RESTARTED' , ' COMPLETED' , ' ABORTED_SAFE' ,
0 commit comments