mirror of
https://github.com/tailscale/tailscale.git
synced 2025-04-21 06:01:42 +00:00
cmd/testwrapper: print failed tests preventing retry (#15270)
Updates tailscale/corp#26637 Signed-off-by: Paul Scott <paul@tailscale.com>
This commit is contained in:
parent
cd391b37a6
commit
eb680edbce
@ -259,6 +259,7 @@ func main() {
|
|||||||
fmt.Printf("\n\nAttempt #%d: Retrying flaky tests:\n\nflakytest failures JSON: %s\n\n", thisRun.attempt, j)
|
fmt.Printf("\n\nAttempt #%d: Retrying flaky tests:\n\nflakytest failures JSON: %s\n\n", thisRun.attempt, j)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fatalFailures := make(map[string]struct{}) // pkg.Test key
|
||||||
toRetry := make(map[string][]*testAttempt) // pkg -> tests to retry
|
toRetry := make(map[string][]*testAttempt) // pkg -> tests to retry
|
||||||
for _, pt := range thisRun.tests {
|
for _, pt := range thisRun.tests {
|
||||||
ch := make(chan *testAttempt)
|
ch := make(chan *testAttempt)
|
||||||
@ -301,11 +302,24 @@ func main() {
|
|||||||
if tr.isMarkedFlaky {
|
if tr.isMarkedFlaky {
|
||||||
toRetry[tr.pkg] = append(toRetry[tr.pkg], tr)
|
toRetry[tr.pkg] = append(toRetry[tr.pkg], tr)
|
||||||
} else {
|
} else {
|
||||||
|
fatalFailures[tr.pkg+"."+tr.testName] = struct{}{}
|
||||||
failed = true
|
failed = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if failed {
|
if failed {
|
||||||
fmt.Println("\n\nNot retrying flaky tests because non-flaky tests failed.")
|
fmt.Println("\n\nNot retrying flaky tests because non-flaky tests failed.")
|
||||||
|
|
||||||
|
// Print the list of non-flakytest failures.
|
||||||
|
// We will later analyze the retried GitHub Action runs to see
|
||||||
|
// if non-flakytest failures succeeded upon retry. This will
|
||||||
|
// highlight tests which are flaky but not yet flagged as such.
|
||||||
|
if len(fatalFailures) > 0 {
|
||||||
|
tests := slicesx.MapKeys(fatalFailures)
|
||||||
|
sort.Strings(tests)
|
||||||
|
j, _ := json.Marshal(tests)
|
||||||
|
fmt.Printf("non-flakytest failures: %s\n", j)
|
||||||
|
}
|
||||||
|
fmt.Println()
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user