Skip to content

Commit ee7b5a8

Browse files
Merge pull request #30039 from stbenjam/fix-counts
TRT-2224: Fix edge case where failures are not counted
2 parents 867bce8 + 3aa1abe commit ee7b5a8

File tree

1 file changed

+26
-4
lines changed

1 file changed

+26
-4
lines changed

pkg/test/ginkgo/cmd_runsuite.go

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -565,7 +565,19 @@ func (o *GinkgoRunSuiteOptions) Run(suite *TestSuite, clusterConfig *clusterdisc
565565
tests = append(tests, retry)
566566
}
567567
if len(flaky) > 0 {
568-
failing = repeatFailures
568+
// Explicitly remove flakes from the failing list
569+
var withoutFlakes []*testCase
570+
flakeLoop:
571+
for _, t := range failing {
572+
for _, f := range flaky {
573+
if t.name == f {
574+
continue flakeLoop
575+
}
576+
}
577+
withoutFlakes = append(withoutFlakes, t)
578+
}
579+
failing = withoutFlakes
580+
569581
sort.Strings(flaky)
570582
fmt.Fprintf(o.Out, "Flaky tests:\n\n%s\n\n", strings.Join(flaky, "\n"))
571583
}
@@ -579,14 +591,24 @@ func (o *GinkgoRunSuiteOptions) Run(suite *TestSuite, clusterConfig *clusterdisc
579591
if t.name == st && t.failed {
580592
continue testLoop
581593
}
582-
withoutPreconditionFailures = append(withoutPreconditionFailures, t)
583594
}
595+
withoutPreconditionFailures = append(withoutPreconditionFailures, t)
584596
}
585597
tests = withoutPreconditionFailures
586-
failing = repeatFailures
598+
599+
var failingWithoutPreconditionFailures []*testCase
600+
failingLoop:
601+
for _, f := range failing {
602+
for _, st := range skipped {
603+
if f.name == st {
604+
continue failingLoop
605+
}
606+
}
607+
failingWithoutPreconditionFailures = append(failingWithoutPreconditionFailures, f)
608+
}
609+
failing = failingWithoutPreconditionFailures
587610
sort.Strings(skipped)
588611
fmt.Fprintf(o.Out, "Skipped tests that failed a precondition:\n\n%s\n\n", strings.Join(skipped, "\n"))
589-
590612
}
591613
}
592614

0 commit comments

Comments
 (0)