@@ -58,6 +58,7 @@ public class QOutProcessor {
5858
5959 public static final String MASK_PATTERN = "#### A masked pattern was here ####" ;
6060 public static final String PARTIAL_MASK_PATTERN = "#### A PARTIAL masked pattern was here ####" ;
61+ public static final String MASKED_VERTEX_KILLED_PATTERN = "[Masked Vertex killed due to OTHER_VERTEX_FAILURE]" ;
6162 private static final PatternReplacementPair MASK_STATS = new PatternReplacementPair (
6263 Pattern .compile (" Num rows: [1-9][0-9]* Data size: [1-9][0-9]*" ),
6364 " Num rows: ###Masked### Data size: ###Masked###" );
@@ -197,6 +198,7 @@ public void maskPatterns(String fname) throws Exception {
197198 out = new BufferedWriter (new OutputStreamWriter (new FileOutputStream (file ), "UTF-8" ));
198199
199200 boolean lastWasMasked = false ;
201+ boolean lastWasVertexKilled = false ;
200202
201203 while (null != (line = in .readLine ())) {
202204 LineProcessingResult result = processLine (line );
@@ -209,10 +211,22 @@ public void maskPatterns(String fname) throws Exception {
209211 lastWasMasked = true ;
210212 result .partialMaskWasMatched = false ;
211213 }
214+ lastWasVertexKilled = false ;
215+ } else if (result .line .equals (MASKED_VERTEX_KILLED_PATTERN )) {
216+ // Deduplicate consecutive standalone vertex-killed lines — the number of sibling
217+ // vertices still alive when the kill propagates is non-deterministic.
218+ if (!lastWasVertexKilled ) {
219+ out .write (result .line );
220+ out .write ("\n " );
221+ lastWasVertexKilled = true ;
222+ }
223+ lastWasMasked = false ;
224+ result .partialMaskWasMatched = false ;
212225 } else {
213226 out .write (result .line );
214227 out .write ("\n " );
215228 lastWasMasked = false ;
229+ lastWasVertexKilled = false ;
216230 result .partialMaskWasMatched = false ;
217231 }
218232 }
@@ -350,7 +364,16 @@ private final static class PatternReplacementPair {
350364 // We do not want the test to fail because of this.
351365 ppm .add (new PatternReplacementPair (
352366 Pattern .compile ("Vertex killed, vertexName=(.*?),.*\\ [\\ 1\\ ] killed\\ /failed due to:OTHER_VERTEX_FAILURE\\ ]" ),
353- "[Masked Vertex killed due to OTHER_VERTEX_FAILURE]" ));
367+ MASKED_VERTEX_KILLED_PATTERN ));
368+
369+ // Collapse multiple consecutive embedded [Masked Vertex killed] tokens on the same line
370+ // (the long FAILED: summary line repeats one token per killed vertex).
371+ ppm .add (new PatternReplacementPair (Pattern .compile ("(\\ Q" + MASKED_VERTEX_KILLED_PATTERN + "\\ E){2,}" ),
372+ MASKED_VERTEX_KILLED_PATTERN ));
373+
374+ // The number of vertices killed when a DAG fails is a scheduling race condition —
375+ // depends on how many sibling vertices are still running at the moment the kill propagates.
376+ ppm .add (new PatternReplacementPair (Pattern .compile ("killedVertices:[0-9]+" ), "killedVertices:#Masked#" ));
354377
355378 partialPlanMask = ppm .toArray (new PatternReplacementPair [ppm .size ()]);
356379 }
0 commit comments