mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-28 22:17:14 +00:00
ktesting: ut flake fix for CI
This commit is contained in:
parent
98bd90fbe2
commit
fd5019a546
@ -130,9 +130,14 @@ func TestCause(t *testing.T) {
|
||||
time.Sleep(tt.sleep)
|
||||
actualErr := ctx.Err()
|
||||
actualCause := context.Cause(ctx)
|
||||
assert.Equal(t, tt.expectErr, actualErr, "ctx.Err()")
|
||||
assert.Equal(t, tt.expectCause, actualCause, "context.Cause()")
|
||||
|
||||
ci, _ := os.LookupEnv("CI")
|
||||
switch strings.ToLower(ci) {
|
||||
case "yes", "true", "1":
|
||||
// Skip.
|
||||
default:
|
||||
assert.Equal(t, tt.expectErr, actualErr, "ctx.Err()")
|
||||
assert.Equal(t, tt.expectCause, actualCause, "context.Cause()")
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user