test(scaletest): fix worksapcebuild retry (#11836)

This commit is contained in:
Mathias Fredriksson 2024-01-26 15:49:19 +02:00 committed by GitHub
parent 02124758fb
commit 52c08a98bb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 1 deletions

View File

@ -278,6 +278,10 @@ func Test_Runner(t *testing.T) {
require.Error(t, err)
require.ErrorContains(t, err, "test error")
require.Equal(t, 1, strings.Count(logsStr, "Retrying build"))
require.Equal(t, 2*2, strings.Count(logsStr, "test error")) // once per error, once per logged sdk response.
split := strings.Split(logsStr, "Retrying build")
// Ensure the error is present both before and after the retry.
for _, s := range split {
require.Contains(t, s, "test error")
}
})
}