mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
TestWatchRestartsIfTimeoutNotReached: fix
This fixes the following error:
> test/integration/apimachinery/watch_restart_test.go:232:5: call to (*T).Fatalf from a non-test goroutine
Update: the previous fix (commit 1ce55e3afe
that uses panic)
looks way too severe; it seems it is enough to call t.Errorf and return
from goroutine. The test will time out and fail anyway.
Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com>
This commit is contained in:
parent
e3ed3ba7c9
commit
8820f4d381
@ -121,7 +121,8 @@ func TestWatchRestartsIfTimeoutNotReached(t *testing.T) {
|
||||
patch := fmt.Sprintf(`{"metadata": {"annotations": {"count": "%d"}}}`, counter)
|
||||
_, err := c.CoreV1().Secrets(secret.Namespace).Patch(context.TODO(), secret.Name, types.StrategicMergePatchType, []byte(patch), metav1.PatchOptions{})
|
||||
if err != nil {
|
||||
panic(fmt.Sprintf("Failed to patch secret: %v", err))
|
||||
t.Errorf("Failed to patch secret: %v", err)
|
||||
return
|
||||
}
|
||||
|
||||
*referenceOutput = append(*referenceOutput, fmt.Sprintf("%d", counter))
|
||||
|
Loading…
Reference in New Issue
Block a user