Skip to content

Commit 27c0dbd

Browse files
loktev-duniversal-itengineer
authored andcommitted
fix(ci): add wait condition to E2E error messages (#1514)
Added the wait condition information to E2E test timeout error messages in the WaitResources function. When a kubectl wait command times out, the error message now includes the condition that was being waited for (e.g., condition=AgentReady=True). Signed-off-by: Daniil Loktev <[email protected]> (cherry picked from commit eb54391) Signed-off-by: Maksim Fedotov <[email protected]>
1 parent d755db0 commit 27c0dbd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/e2e/util_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,13 +341,13 @@ func WaitResources(resources []string, resource kc.Resource, opts kc.WaitOptions
341341
res := kubectl.WaitResource(resource, name, waitOpts)
342342
if res.Error() != nil {
343343
mu.Lock()
344-
waitErr = append(waitErr, fmt.Sprintf("cmd: %s\nstderr: %s", res.GetCmd(), res.StdErr()))
344+
waitErr = append(waitErr, fmt.Sprintf("cmd: %s\nstderr: %s\nwaited for: %s", res.GetCmd(), res.StdErr(), opts.For))
345345
mu.Unlock()
346346
}
347347
}()
348348
}
349349
wg.Wait()
350-
Expect(waitErr).To(BeEmpty())
350+
Expect(waitErr).To(BeEmpty(), "should observe resources in '%s' state before %s timeout", opts.For, opts.Timeout.String())
351351
}
352352

353353
func GetStorageClassFromEnv(envName string) (*storagev1.StorageClass, error) {

0 commit comments

Comments
 (0)