Skip to content

Commit 3604159

Browse files
committed
e2e: Wait for the registry Pod to sync before deleting the test CatalogSource
Signed-off-by: timflannagan <[email protected]>
1 parent d02ab0e commit 3604159

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

test/e2e/metrics_e2e_test.go

+9-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//go:build !bare
12
// +build !bare
23

34
package e2e
@@ -344,7 +345,14 @@ var _ = Describe("Metrics are generated for OLM managed resources", func() {
344345
DefaultChannelName: stableChannel,
345346
},
346347
}
347-
_, cleanupAll := createInternalCatalogSource(c, crc, name, testNamespace, mainManifests, []apiextensions.CustomResourceDefinition{mainCRD}, []v1alpha1.ClusterServiceVersion{mainCSV})
348+
cs, cleanupAll := createInternalCatalogSource(c, crc, name, testNamespace, mainManifests, []apiextensions.CustomResourceDefinition{mainCRD}, []v1alpha1.ClusterServiceVersion{mainCSV})
349+
// Note(tflannag): Dependending on how ginkgo orders these test specs, and how bloated the cluster we're running
350+
// this test case against, we risk creating and then immediately deleting the catalogsource before the catalog
351+
// operator can generate all the requisite resources (e.g. the ServiceAccount), which can leave the underlying
352+
// registry Pod in a terminating state until kubelet times out waiting for the generated ServiceAccount
353+
// resource to be present so it can mount it in the registry container.
354+
_, err := fetchCatalogSourceOnStatus(crc, cs.GetName(), cs.GetNamespace(), catalogSourceRegistryPodSynced)
355+
Expect(err).ShouldNot(HaveOccurred())
348356

349357
var once sync.Once
350358
cleanup = func() {

0 commit comments

Comments
 (0)