test(cassandra): fix port collision in certification tests#4284
Open
test(cassandra): fix port collision in certification tests#4284
Conversation
Signed-off-by: stywzn <jhonynnis@gmail.com>
Author
|
Hi @sicoyle, the Build, Lint, Unit Test CI failed due to an unrelated flaky test in TestPostgresConfigurationWithIAM (configuration/postgres/postgres_test.go: FATAL: password authentication failed for user "testuser"). Since my changes are strictly isolated to fixing the Cassandra port collision, could you please help re-trigger the failing CI workflows? Thank you! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR fixes the flaky certification tests for the Cassandra state store, specifically the port collision issue when starting the second sidecar (
cassandra-sidecar-dockerDefault2).Previously, the tests requested 2 free ports and used hardcoded mathematical offsets (
+2,+4) to assign ports for subsequent sidecars. In highly concurrent CI environments, these blindly guessed ports are often already in use by other processes, leading toaddress already in usefatal errors and test failures.This has been resolved by properly requesting the exact number of required free ports (6 for
TestCassandra, 4 forTestCluster) directly from the OS, eliminating the anti-pattern of hardcoded port increments.Fixes #4179
(Note: I have signed off on my commits.)