Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use labels to enhance records filtering in FA e2e tests #5731

Merged
merged 1 commit into from
Dec 4, 2023

Conversation

yuntanghsu
Copy link
Contributor

@yuntanghsu yuntanghsu commented Nov 18, 2023

In this pull request, we:

  1. Set a label to Perftest Pods before initiating traffic in each subtest to filter records in both the IPFIX collector Pod and the ClickHouse.
  2. Remove the --since-time flag used during log retrieval from the IPFIX collector Pod in the e2e test.
  3. Cease reliance on timestamps for record filtering due to potential time discrepancies between the testbed and Kubernetes nodes, which might hinder the retrieval of desired logs.

resolve #5730

@yuntanghsu yuntanghsu changed the title Add timesleep in flow-visiblity e2e test Remove --time-since Flag in IPFIX Collector Log Retrieval Nov 18, 2023
@yuntanghsu yuntanghsu force-pushed the rm_ipfix_timesince branch 2 times, most recently from abc51e5 to 968b45d Compare November 20, 2023 17:35
@yuntanghsu yuntanghsu changed the title Remove --time-since Flag in IPFIX Collector Log Retrieval Remove --since-time Flag in IPFIX Collector Log Retrieval Nov 20, 2023
@yuntanghsu yuntanghsu marked this pull request as draft November 21, 2023 00:29
@yuntanghsu yuntanghsu force-pushed the rm_ipfix_timesince branch 8 times, most recently from 9ce0eb8 to 6c8789f Compare November 21, 2023 22:07
@yuntanghsu yuntanghsu marked this pull request as ready for review November 21, 2023 22:07
test/e2e/flowaggregator_test.go Outdated Show resolved Hide resolved
test/e2e/flowaggregator_test.go Show resolved Hide resolved
@yuntanghsu yuntanghsu force-pushed the rm_ipfix_timesince branch 2 times, most recently from de429cf to 70d2b32 Compare November 22, 2023 21:47
Copy link
Contributor

@antoninbas antoninbas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the PR title & description probably need to be updated?

test/e2e/flowaggregator_test.go Outdated Show resolved Hide resolved
@@ -1335,10 +1361,10 @@ func checkPodAndNodeDataClickHouse(data *TestData, t *testing.T, record *ClickHo
assert.Equal(record.DestinationPodName, dstPod, "Record with dstIP does not have Pod name: %s", dstPod)
assert.Equal(record.DestinationPodNamespace, data.testNamespace, "Record does not have correct destinationPodNamespace: %s", data.testNamespace)
assert.Equal(record.DestinationNodeName, dstNode, "Record does not have correct destinationNodeName: %s", dstNode)
assert.Equal(record.SourcePodLabels, fmt.Sprintf("{\"antrea-e2e\":\"%s\",\"app\":\"iperf\"}", srcPod), "Record does not have correct label for source Pod")
assert.Equal(record.DestinationPodLabels, fmt.Sprintf("{\"antrea-e2e\":\"%s\",\"app\":\"iperf\"}", dstPod), "Record does not have correct label for destination Pod")
assert.Contains(record.SourcePodLabels, fmt.Sprintf("\"antrea-e2e\":\"%s\",\"app\":\"iperf\"", srcPod), "Record does not have correct label for source Pod")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that relies on the labels being ordered alphabetically in the record. Is that guaranteed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, when we add labels in Flow-Aggregator, we first use json.marshall for the label map, then convert it into a string.
And json.marshall will sort the map key lexicographically.
What I do here is just remove the curly bracket as we have extra label here.

test/e2e/flowaggregator_test.go Outdated Show resolved Hide resolved
test/e2e/flowaggregator_test.go Show resolved Hide resolved
@antoninbas antoninbas requested a review from heanlan November 23, 2023 00:04
@yuntanghsu yuntanghsu changed the title Remove --since-time Flag in IPFIX Collector Log Retrieval Enhance Records Filtering: Utilizing Labels Instead of Timestamp in IPFIX Collector and ClickHouse Nov 23, 2023
@yuntanghsu yuntanghsu changed the title Enhance Records Filtering: Utilizing Labels Instead of Timestamp in IPFIX Collector and ClickHouse Enhance Records Filtering: Utilizing Labels Instead of Timestamp in the e2e test Nov 23, 2023
@yuntanghsu yuntanghsu changed the title Enhance Records Filtering: Utilizing Labels Instead of Timestamp in the e2e test Enhance Records Filtering: Utilizing Labels In The E2E Test Nov 23, 2023
@antoninbas antoninbas changed the title Enhance Records Filtering: Utilizing Labels In The E2E Test Use labels to enhance records filtering in FA e2e tests Nov 27, 2023
Copy link
Contributor

@antoninbas antoninbas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this fix #5730, I don't see a reference to the issue anywhere?

Also waiting for @heanlan and @dreamtalen to review

test/e2e/flowaggregator_test.go Outdated Show resolved Hide resolved
test/e2e/framework.go Outdated Show resolved Hide resolved
test/e2e/flowaggregator_test.go Outdated Show resolved Hide resolved
test/e2e/flowaggregator_test.go Outdated Show resolved Hide resolved
Copy link
Contributor

@dreamtalen dreamtalen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM overall

test/e2e/flowaggregator_test.go Outdated Show resolved Hide resolved
In this commit, we:
1. Set a label to Perftest Pods before initiating traffic in each subtest to filter records in both the IPFIX collector Pod and the ClickHouse.
2. Remove the --since-time flag used during log retrieval from the IPFIX collector Pod in the e2e test.
3. Cease reliance on timestamps for record filtering due to potential time discrepancies between the testbed and Kubernetes nodes, which might hinder the retrieval of desired logs.

Signed-off-by: Yun-Tang Hsu <hsuy@vmware.com>
Copy link
Contributor

@heanlan heanlan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@antoninbas
Copy link
Contributor

/test-e2e

@antoninbas antoninbas merged commit 2a38ef5 into antrea-io:main Dec 4, 2023
46 of 51 checks passed
yuntanghsu added a commit to yuntanghsu/antrea that referenced this pull request Jan 22, 2024
In this commit, we:

1. Add a label to Perftest Pods before initiating traffic in each subtest to filter records in both the IPFIX collector Pod and the ClickHouse.
2. Remove the --since-time flag used during log retrieval from the IPFIX collector Pod in the e2e test.
3. Stop relying on timestamps for record filtering due to potential time discrepancies between the testbed and Kubernetes nodes, which might hinder the retrieval of desired records.

Signed-off-by: Yun-Tang Hsu <hsuy@vmware.com>
antoninbas pushed a commit that referenced this pull request Jan 23, 2024
In this commit, we:

1. Add a label to Perftest Pods before initiating traffic in each subtest to filter records in both the IPFIX collector Pod and the ClickHouse.
2. Remove the --since-time flag used during log retrieval from the IPFIX collector Pod in the e2e test.
3. Stop relying on timestamps for record filtering due to potential time discrepancies between the testbed and Kubernetes nodes, which might hinder the retrieval of desired records.

Signed-off-by: Yun-Tang Hsu <hsuy@vmware.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Test] "E2e tests on a Kind cluster on Linux for Flow Visibility" job keeps failing
4 participants