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

Fix flaky e2e test TestProxyLoadBalancerModeDSR #6702

Merged
merged 1 commit into from
Oct 8, 2024

Conversation

tnqn
Copy link
Member

@tnqn tnqn commented Sep 29, 2024

After creating or updating a Service, wait for 2 seconds before running traffic tests to ensure the Service is fully realized.

Add a timestamp to help debug this test in the future.

Fixes #6704

@antrea-bot
Copy link
Collaborator

Can one of the admins verify this patch?

@tnqn tnqn force-pushed the dsr-test branch 2 times, most recently from 159db08 to 6f228af Compare September 30, 2024 13:26
@tnqn tnqn changed the title WIP: Fix flaky e2e test TestProxyLoadBalancerModeDSR Fix flaky e2e test TestProxyLoadBalancerModeDSR Sep 30, 2024
@tnqn tnqn marked this pull request as ready for review September 30, 2024 13:29
@tnqn tnqn added area/test/e2e Issues or PRs related to Antrea specific end-to-end testing. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. labels Sep 30, 2024
antoninbas
antoninbas previously approved these changes Sep 30, 2024
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.

LGTM, thanks for taking care of this

@@ -1184,7 +1193,7 @@ func TestProxyLoadBalancerModeDSR(t *testing.T) {
hostNames := sets.New[string]()
for i := 0; i < 10; i++ {
hostName := curlServiceWithPath(clientPod, clientNetns, "hostname")
t.Logf("Request #%d from %s got hostname: %s", i, clientPod, hostName)
t.Logf("[%s] Request #%d from %s got hostname: %s", time.Now().Format(microTimestampFormat), i, clientPod, hostName)
Copy link
Contributor

Choose a reason for hiding this comment

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

A comment here would be nice, in case someone updates this test in the future

We add a microsecond timestamp to the log message, which can be compared to the timestamp of the AntreaProxy messages in the Antrea Agent's logs. This is useful for troubleshooting test failures, in case there is a race condition with Service realization.

Copy link
Member Author

Choose a reason for hiding this comment

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

done, thanks

After creating or updating a Service, wait for 2 seconds before running
traffic tests to ensure the Service is fully realized.

Add a timestamp to help debug this test in the future.

Signed-off-by: Quan Tian <[email protected]>
@antoninbas
Copy link
Contributor

/test-e2e

@antoninbas
Copy link
Contributor

/test-e2e
/test-kind-e2e

@antoninbas antoninbas merged commit 8f52407 into antrea-io:main Oct 8, 2024
53 of 58 checks passed
hangyan pushed a commit to hangyan/antrea that referenced this pull request Oct 29, 2024
After creating or updating a Service, wait for 2 seconds before running
traffic tests to ensure the Service is fully realized.

Add a timestamp to help debug this test in the future.

Signed-off-by: Quan Tian <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/test/e2e Issues or PRs related to Antrea specific end-to-end testing. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TestProxyLoadBalancerModeDSR test failed occasionally
3 participants