mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-11 13:02:14 +00:00
Fix GC integration test race
During TestCreateWithNonExistentOwner, when creating a pod with a non-existent owner, assume it's possible the pod will be deleted before we start checking for the pod's existence. Assuming that the pod still exists immediately after Create returns is flaky if the GC reacts very quickly.
This commit is contained in:
parent
f4afdecef8
commit
5334e164c7
@ -418,8 +418,8 @@ func TestCreateWithNonExistentOwner(t *testing.T) {
|
||||
if err != nil {
|
||||
t.Fatalf("Failed to list pods: %v", err)
|
||||
}
|
||||
if len(pods.Items) != 1 {
|
||||
t.Fatalf("Expect only 1 pod")
|
||||
if len(pods.Items) > 1 {
|
||||
t.Fatalf("Unexpected pod list: %v", pods.Items)
|
||||
}
|
||||
// wait for the garbage collector to delete the pod
|
||||
if err := integration.WaitForPodToDisappear(podClient, garbageCollectedPodName, 5*time.Second, 30*time.Second); err != nil {
|
||||
|
Loading…
Reference in New Issue
Block a user