Repository navigation
[Test] Eliminate OPC UA sink port allocation race - #18817
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #18817 +/- ##
=========================================
Coverage 45.84% 45.85%
Complexity 712 712
=========================================
Files 5498 5498
Lines 397462 397462
Branches 51733 51733
=========================================
+ Hits 182228 182256 +28
+ Misses 215234 215206 -28 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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
OpcUaSinkTestprobes ephemeral ports withServerSocket(0)and closes the sockets before starting the Milo servers. The quality and normal sinks allocate their port pairs independently, so both can receive the same TCP port, or another process can claim a released port before startup. The secondcustomize()then fails withBindException: Address already in useandNo endpoints bound.Bind the test servers directly to TCP port
0so the OS allocates each listening port during bind. Use distinct configured HTTPS port values to distinguish independent servers in the sink's shared-server map; the current TCP-only transport does not bind HTTPS. The lifecycle test keeps the same key for both sinks, preserving the existing sharing and conflict checks. Reuse the quality-parameter helper and remove the port-probing helpers.Validation
mvn clean test -pl library-pipe/opc-ua-sink -Dtest.port.closed=true -Ddevelocity.off=truepassed: 29 tests, 0 failures, 0 errors, 1 existing performance-test skip.mvn surefire:test -pl library-pipe/opc-ua-sink -Dtest=OpcUaSinkTest -Dtest.port.closed=true -Ddevelocity.off=true10 times: all 40 test executions passed, with no endpoint-binding errors.This PR has:
Key changed/added classes
OpcUaSinkTest