Skip to content

test: Refactor disconnect handling integration tests#424

Open
dave-tucker wants to merge 2 commits into
ovn-kubernetes:mainfrom
dave-tucker:timeout
Open

test: Refactor disconnect handling integration tests#424
dave-tucker wants to merge 2 commits into
ovn-kubernetes:mainfrom
dave-tucker:timeout

Conversation

@dave-tucker

@dave-tucker dave-tucker commented Jul 25, 2025

Copy link
Copy Markdown
Collaborator

DRY up the disconnect handling test logic.
Fix a data race in the MonitorCondition tests.

@dave-tucker
dave-tucker requested a review from jcaamano July 25, 2025 15:55
@dave-tucker

dave-tucker commented Jul 25, 2025

Copy link
Copy Markdown
Collaborator Author

The refactor for to DRY up the tests and fix a data race could be removed if required - but this has affected CI stability and the ability to iterate on this locally.

This is related to #368 but with less code churn.
I don't think we need to set socket options on the TCP socket or set a Deadline on the underlying connection - use of the context Deadline should hopefully be sufficient in this case.

I think we can revisit #368 afterwards to extract any other relevant changes to the inactivity handling logic.

EDIT: It was pointed out to me that:
a. The context deadline won't work - as discussed in #368
b. That this doesn't fix the issue with echo waiting on the rpcMutex as recently reported in #391

This PR is now just the test refactor.

@dave-tucker dave-tucker changed the title Attempt to fix deadlock test: Refactor disconnect handling integration tests Jul 25, 2025
@dave-tucker dave-tucker mentioned this pull request Aug 15, 2025
@dave-tucker
dave-tucker force-pushed the timeout branch 4 times, most recently from 494d7b8 to 7ae7af0 Compare March 2, 2026 16:01
Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
The TestWithInactivity and TestWithReconnect logic is pretty much
identical. Move the common code into testReconnect. This also
removes the 2 ovsClients. Only a single client is used now.
A test may change the options at the beginning of the test.

Adds a TestWithFastInactivity variant with an aggressive timer
to try and reproduce ovn-kubernetes#391.

This also fixes data races in the MonitorCondition tests.

In addition, migrates from dockertest to testcontainers.
The former had issues running using Podman Desktop on macOS.
The latter is much more stable.

Signed-off-by: Dave Tucker <dave@dtucker.co.uk>
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.

1 participant