diff --git a/test/e2e/fixtures.go b/test/e2e/fixtures.go index 45af883bccd..655202dd9ec 100644 --- a/test/e2e/fixtures.go +++ b/test/e2e/fixtures.go @@ -275,7 +275,7 @@ func setupTestForFlowAggregator(tb testing.TB, o flowVisibilityTestOptions) (*Te if err := NewPodBuilder("ipfix-collector", testData.testNamespace, ipfixCollectorImage).InHostNetwork().Create(testData); err != nil { tb.Errorf("Error when creating the ipfix collector Pod: %v", err) } - ipfixCollectorIP, err := testData.podWaitForIPs(defaultTimeout, "ipfix-collector", testData.testNamespace) + ipfixCollectorIP, err := testData.podWaitForIPs(defaultTimeout, ipfixPodName, testData.testNamespace) if err != nil || len(ipfixCollectorIP.IPStrings) == 0 { tb.Errorf("Error when waiting to get ipfix collector Pod IP: %v", err) return nil, v4Enabled, v6Enabled, err diff --git a/test/e2e/flowaggregator_test.go b/test/e2e/flowaggregator_test.go index 5949b469902..a15c7950139 100644 --- a/test/e2e/flowaggregator_test.go +++ b/test/e2e/flowaggregator_test.go @@ -1407,12 +1407,10 @@ func getCollectorOutput(t *testing.T, srcIP, dstIP, srcPort string, isDstService // In the ToExternalFlows test, flow record will arrive 5.5s (exporterActiveFlowExportTimeout+aggregatorActiveFlowRecordTimeout) after executing wget command // We set the timeout to 9s (5.5s plus one more aggregatorActiveFlowRecordTimeout) to make the ToExternalFlows test more stable err := wait.PollImmediate(defaultInterval, defaultTimeout, func() (bool, error) { - var rc int var err error - // `pod-running-timeout` option is added to cover scenarios where ipfix flow-collector has crashed after being deployed - rc, collectorOutput, _, err = data.RunCommandOnNode(controlPlaneNodeName(), fmt.Sprintf("kubectl logs --pod-running-timeout=%v ipfix-collector -n %s", aggregatorInactiveFlowRecordTimeout.String(), data.testNamespace)) - if err != nil || rc != 0 { - return false, err + collectorOutput, err = data.GetPodLogs(context.TODO(), data.testNamespace, ipfixPodName, "") + if err != nil { + return false, nil } // Checking that all the data records which correspond to the iperf flow are received diff --git a/test/e2e/framework.go b/test/e2e/framework.go index 7973fb7f9d2..956927e104f 100644 --- a/test/e2e/framework.go +++ b/test/e2e/framework.go @@ -134,6 +134,7 @@ const ( toolboxImage = "projects.registry.vmware.com/antrea/toolbox:1.2-1" ipfixCollectorImage = "projects.registry.vmware.com/antrea/ipfix-collector:v0.6.2" ipfixCollectorPort = "4739" + ipfixPodName = "ipfix-collector" clickHouseHTTPPort = "8123" nginxLBService = "nginx-loadbalancer"