janhoy commented on code in PR #903:
URL: https://github.com/apache/solr-operator/pull/903#discussion_r4623064850


##########
tests/e2e/resource_utils_test.go:
##########
@@ -832,6 +832,15 @@ func cleanupTest(ctx context.Context, parentResource 
client.Object) {
        for _, item := range serviceList.Items {
                Expect(k8sClient.Delete(ctx, &item)).To(Or(Succeed(), 
MatchError("services \""+item.Name+"\" not found")))
        }
+
+       // The next spec in this namespace reuses the same pod names. If an old 
pod is still terminating, its StatefulSet
+       // cannot create the replacement, and only retries with an ever-growing 
backoff once the old pod is gone.
+       By("waiting for all pods to be deleted")
+       Eventually(func(g Gomega) {
+               podList := &corev1.PodList{}
+               g.Expect(k8sClient.List(ctx, podList, 
client.InNamespace(parentResource.GetNamespace()))).To(Succeed(), "List all of 
the pods in the namespace")
+               g.Expect(podList.Items).To(BeEmpty(), "Pods still exist in the 
namespace after cleanup")
+       }).WithContext(ctx).Within(time.Minute * 3).Should(Succeed())

Review Comment:
   Agreed. Over four local full-suite runs the wait took 1.6s at the median and 
33s at most, the slowest being the specs with a ZooKeeper pod and its 30s grace 
period. Lowered it to a minute in 2ec08f4.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to