diff --git a/test/e2e/flowaggregator_test.go b/test/e2e/flowaggregator_test.go index 8475134f194..5949b469902 100644 --- a/test/e2e/flowaggregator_test.go +++ b/test/e2e/flowaggregator_test.go @@ -1042,7 +1042,7 @@ func checkRecordsForFlowsCollector(t *testing.T, data *TestData, srcIP, dstIP, s flowEndReason := int64(getUint64FieldFromRecord(t, record, "flowEndReason")) var recBandwidth float64 // flowEndReason == 3 means the end of flow detected - if exportTime >= flowStartTime+iperfTimeSec || flowEndReason == 3 { + if exportTime >= flowStartTime+iperfTimeSec && flowEndReason == 3 { // Check average bandwidth on the last record. octetTotalCount := getUint64FieldFromRecord(t, record, "octetTotalCount") recBandwidth = float64(octetTotalCount) * 8 / float64(iperfTimeSec) / 1000000 @@ -1110,7 +1110,7 @@ func checkRecordsForFlowsClickHouse(t *testing.T, data *TestData, srcIP, dstIP, exportTime := record.FlowEndSeconds.Unix() var recBandwidth float64 // flowEndReason == 3 means the end of flow detected - if exportTime >= flowStartTime+iperfTimeSec || record.FlowEndReason == 3 { + if exportTime >= flowStartTime+iperfTimeSec && record.FlowEndReason == 3 { octetTotalCount := record.OctetTotalCount recBandwidth = float64(octetTotalCount) * 8 / float64(exportTime-flowStartTime) / 1000000 } else { @@ -1424,7 +1424,7 @@ func getCollectorOutput(t *testing.T, srcIP, dstIP, srcPort string, isDstService exportTime := int64(getUint64FieldFromRecord(t, record, "flowEndSeconds")) flowEndReason := int64(getUint64FieldFromRecord(t, record, "flowEndReason")) // flowEndReason == 3 means the end of flow detected - if exportTime >= flowStartTime+iperfTimeSec || flowEndReason == 3 { + if exportTime >= flowStartTime+iperfTimeSec && flowEndReason == 3 { return true, nil } } @@ -1488,7 +1488,7 @@ func getClickHouseOutput(t *testing.T, data *TestData, srcIP, dstIP, srcPort str flowStartTime := record.FlowStartSeconds.Unix() exportTime := record.FlowEndSeconds.Unix() // flowEndReason == 3 means the end of flow detected - if exportTime >= flowStartTime+iperfTimeSec || record.FlowEndReason == 3 { + if exportTime >= flowStartTime+iperfTimeSec && record.FlowEndReason == 3 { return true, nil } }