Skip to content

Commit

Permalink
Flaky: TestAllocatorCrossNamespace (googleforgames#1604)
Browse files Browse the repository at this point in the history
Skip errors where the pod was not found. It's likely been deleted by
another cleanup process at the same time.

🏇 conditions 🏇

Closes googleforgames#1603
  • Loading branch information
markmandel authored and ilkercelikyilmaz committed Oct 23, 2020
1 parent 9bd1fe7 commit 739d014
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/e2e/allocator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ import (
"google.golang.org/grpc"
"google.golang.org/grpc/credentials"
corev1 "k8s.io/api/core/v1"
k8serrors "k8s.io/apimachinery/pkg/api/errors"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/util/uuid"
"k8s.io/apimachinery/pkg/util/wait"
Expand Down Expand Up @@ -273,6 +274,10 @@ func restartAllocator(t *testing.T) {
continue
}
if err := kubeCore.Pods(agonesSystemNamespace).Delete(pod.Name, &metav1.DeleteOptions{}); err != nil {
if k8serrors.IsNotFound(err) {
logrus.WithField("pod", pod.Name).WithError(err).Warn("Attempt at deletion failed")
continue
}
t.Fatalf("deleting pods failed: %s", err)
}
}
Expand Down

0 comments on commit 739d014

Please sign in to comment.