Skip to content

Commit

Permalink
e2e: fix CNI Logging level test case
Browse files Browse the repository at this point in the history
It can happen that clock of the cluster nodes is not aligned
to the clock of test runner. In such cases, asking a pod for logs
since a given time might end in an empty response, as the requested
time can be in the future (from the cluster perspective).

Use the pod's CreationTimestamp timestamp field to be sure
to pass to the API server a meaningful value.

Signed-off-by: Andrea Panattoni <apanatto@redhat.com>
  • Loading branch information
zeeke committed Feb 27, 2024
1 parent 5fcd26d commit 5b1f712
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions test/conformance/tests/test_sriov_operator.go
Original file line number Diff line number Diff line change
Expand Up @@ -1013,11 +1013,9 @@ var _ = Describe("[sriov] operator", func() {
Expect(err).ToNot(HaveOccurred())
waitForNetAttachDef(sriovNetworkName, namespaces.Test)

podDeployTime := time.Now()

testPod := createTestPod(node, []string{sriovNetworkName})

recentMultusLogs := getMultusPodLogs(testPod.Spec.NodeName, podDeployTime)
recentMultusLogs := getMultusPodLogs(testPod.Spec.NodeName, testPod.ObjectMeta.CreationTimestamp.Time)

Expect(recentMultusLogs).To(
ContainElement(
Expand Down

0 comments on commit 5b1f712

Please sign in to comment.