Skip to content

[E2E] Unstable test GlobalTenantResource should replicate resources to all Tenants #1651

@Svarrogh1337

Description

@Svarrogh1337

Bug description

E2E tests are unstable due to GlobalTenantResource should replicate resources to all Tenants.

Logs:

Creating a GlobalTenantResource object [It] should replicate resources to all Tenants
/home/runner/work/capsule/capsule/e2e/globaltenantresource_test.go:185

[FAILED] Timed out after 40.001s.
Expected
<[]v1.Secret | len:0, cap:0>: nil
to have length 4

Additional context

Example e2e job here
Source:

It("should replicate resources to all Tenants", func() {
solarNs, windNs := []string{"solar-one", "solar-two", "solar-three"}, []string{"wind-one", "wind-two", "wind-three"}
By("creating solar Namespaces", func() {
for _, ns := range solarNs {
NamespaceCreation(&corev1.Namespace{ObjectMeta: metav1.ObjectMeta{Name: ns}}, solar.Spec.Owners[0], defaultTimeoutInterval).Should(Succeed())
}
})
By("creating wind Namespaces", func() {
for _, ns := range windNs {
NamespaceCreation(&corev1.Namespace{ObjectMeta: metav1.ObjectMeta{Name: ns}}, wind.Spec.Owners[0], defaultTimeoutInterval).Should(Succeed())
}
})
for _, ns := range append(solarNs, windNs...) {
By(fmt.Sprintf("waiting for replicated resources in %s Namespace", ns), func() {
Eventually(func() []corev1.Secret {
r, err := labels.NewRequirement("labels.energy.io", selection.DoubleEquals, []string{"replicate"})
if err != nil {
return nil
}
secrets := corev1.SecretList{}
err = k8sClient.List(context.TODO(), &secrets, &client.ListOptions{LabelSelector: labels.NewSelector().Add(*r), Namespace: ns})
if err != nil {
return nil
}
return secrets.Items
}, defaultTimeoutInterval, defaultPollInterval).Should(HaveLen(4))
})
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions