Skip to content

Commit 8e664e1

Browse files
committed
e2e: serial: config: restore previous check
We can't reliably depend on isNROOperAvailableAt because older versions (pre 4.21) don't expose the value, so all the checks will fail (observedGeneration stuck at 0). So we need to write tests carefully supporting both flows. Signed-off-by: Francesco Romani <fromani@redhat.com>
1 parent b83b84a commit 8e664e1

1 file changed

Lines changed: 22 additions & 18 deletions

File tree

test/e2e/serial/tests/configuration.go

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -232,25 +232,29 @@ var _ = Describe("[serial][disruptive] numaresources configuration management",
232232
g.Expect(isNROOperUpToDate(updatedOperObj)).To(BeTrue())
233233
}).WithTimeout(10*time.Minute).WithPolling(30*time.Second).Should(Succeed(), "failed to update RTE daemonset node selector")
234234

235-
dss, err := objects.GetDaemonSetsByNamespacedName(fxt.Client, ctx, updatedOperObj.Status.DaemonSets...)
236-
Expect(err).ToNot(HaveOccurred())
237-
238-
Expect(dss).To(HaveLen(len(nroOperObj.Spec.NodeGroups)), "daemonsets found owned by NRO object doesn't align with specified NodeGroups")
239-
for _, ds := range dss {
240-
e2efixture.By("check RTE daemonset %q", ds.Name)
241-
if ds.Name == objectnames.GetComponentName(updatedOperObj.Name, roleMCPTest) {
242-
By("check the correct match labels for the new RTE daemonset")
243-
Expect(ds.Spec.Template.Spec.NodeSelector).To(Equal(testMCP.Spec.NodeSelector.MatchLabels))
235+
// Eventually is not strictly needed but till all the supported version report ObservedGeneration in status
236+
// (aka oldest supported version is 4.20) we can't really depend on `isNROOperUpToDate`
237+
Eventually(func(g Gomega) {
238+
dss, err := objects.GetDaemonSetsByNamespacedName(fxt.Client, ctx, updatedOperObj.Status.DaemonSets...)
239+
g.Expect(err).ToNot(HaveOccurred())
240+
241+
g.Expect(dss).To(HaveLen(len(nroOperObj.Spec.NodeGroups)), "daemonsets found owned by NRO object doesn't align with specified NodeGroups")
242+
for _, ds := range dss {
243+
e2efixture.By("check RTE daemonset %q", ds.Name)
244+
if ds.Name == objectnames.GetComponentName(updatedOperObj.Name, roleMCPTest) {
245+
By("check the correct match labels for the new RTE daemonset")
246+
g.Expect(ds.Spec.Template.Spec.NodeSelector).To(Equal(testMCP.Spec.NodeSelector.MatchLabels))
247+
}
248+
By("check the correct image")
249+
cnt := ds.Spec.Template.Spec.Containers[0] // shortcut
250+
g.Expect(cnt.Image).To(Equal(serialconfig.GetRteCiImage()))
251+
252+
By("checking the correct LogLevel")
253+
found, match := matchLogLevelToKlog(&cnt, newLogLevel)
254+
g.Expect(found).To(BeTrue(), "-v flag doesn't exist in container %q args under DaemonSet: %q", cnt.Name, ds.Name)
255+
g.Expect(match).To(BeTrue(), "LogLevel %s doesn't match the existing -v flag in container: %q managed by DaemonSet: %q", updatedOperObj.Spec.LogLevel, cnt.Name, ds.Name)
244256
}
245-
By("check the correct image")
246-
cnt := ds.Spec.Template.Spec.Containers[0] // shortcut
247-
Expect(cnt.Image).To(Equal(serialconfig.GetRteCiImage()))
248-
249-
By("checking the correct LogLevel")
250-
found, match := matchLogLevelToKlog(&cnt, newLogLevel)
251-
Expect(found).To(BeTrue(), "-v flag doesn't exist in container %q args under DaemonSet: %q", cnt.Name, ds.Name)
252-
Expect(match).To(BeTrue(), "LogLevel %s doesn't match the existing -v flag in container: %q managed by DaemonSet: %q", updatedOperObj.Spec.LogLevel, cnt.Name, ds.Name)
253-
}
257+
}).WithTimeout(10*time.Minute).WithPolling(30*time.Second).Should(Succeed(), "failed to update RTE daemonset node selector")
254258
})
255259

256260
It("[test_id:54916] should be able to modify the configurable values under the NUMAResourcesScheduler CR", Label(label.Tier2, "schedrst"), Label("feature:schedrst"), func() {

0 commit comments

Comments
 (0)