[8.17](backport #7058) [flakiness]: utilise socket helper funcs in unit-tests #7167
+3
−2
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.
What does this PR do?
This PR fixes a failing test case,
TestConnInfoConnCloseThenAnotherConn
, which was caused by the generation of overly long Unix socket paths. On macOS, UNIX-domain addresses are limited to 104 characters, while Linux imposes a 108-character limit. The previous implementation ingetAddress
did not validate or handle excessive path lengths, causing the test to fail on macOS and occasionally on Linux.To resolve this, the PR updates
getAddress
to utilize the existingSocketURLWithFallback
helper function frompkg/utils/socket_unix.go
, which ensures that socket paths remain within system limits.Why is it important?
This change is essential to prevent flakiness in the test suite and ensure that the test runs reliably across different platforms. By leveraging the existing socket utility functions, we ensure that socket paths adhere to OS-imposed constraints, reducing test failures and improving CI stability.
Checklist
./changelog/fragments
using the changelog tool.Disruptive User Impact
This change only affects the test suite and does not impact users.
How to test this PR locally
Run the following test command locally and verify that it no longer fails due to socket path length issues:
Related issues
failed to start connection credentials listener: listen unix ...: bind: invalid argument
#6977This is an automatic backport of pull request #7058 done by [Mergify](https://mergify.com).