mirror of
https://github.com/ddworken/hishtory.git
synced 2024-11-23 00:34:27 +01:00
Increment the test_retry_count metric for failures too to ensure that it captures tests that fail all retries
This commit is contained in:
parent
f64362fbba
commit
f589a0b1ba
@ -207,7 +207,7 @@ func runTestsWithRetries(parentT *testing.T, testName string, testFunc func(t te
|
||||
|
||||
func runTestsWithExtraRetries(parentT *testing.T, testName string, testFunc func(t testing.TB), numRetries int) {
|
||||
for i := 1; i <= numRetries; i++ {
|
||||
rt := &retryingTester{nil, i == numRetries, true, testName}
|
||||
rt := &retryingTester{nil, i == numRetries, true, testName, numRetries}
|
||||
parentT.Run(fmt.Sprintf("%s/%d", testName, i), func(t *testing.T) {
|
||||
rt.T = t
|
||||
testFunc(rt)
|
||||
@ -231,6 +231,7 @@ type retryingTester struct {
|
||||
isFinalRun bool
|
||||
succeeded bool
|
||||
testName string
|
||||
numRetries int
|
||||
}
|
||||
|
||||
func (t *retryingTester) Fatalf(format string, args ...any) {
|
||||
@ -239,6 +240,7 @@ func (t *retryingTester) Fatalf(format string, args ...any) {
|
||||
if t.isFinalRun {
|
||||
if GLOBAL_STATSD != nil {
|
||||
GLOBAL_STATSD.Incr("test_failure", []string{"test:" + t.testName, "os:" + runtime.GOOS}, 1.0)
|
||||
GLOBAL_STATSD.Distribution("test_retry_count", float64(t.numRetries), []string{"test:" + t.testName, "os:" + runtime.GOOS}, 1.0)
|
||||
}
|
||||
t.T.Fatalf(format, args...)
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user