[
https://issues.apache.org/jira/browse/CASSANDRASC-113?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17824579#comment-17824579
]
ASF subversion and git services commented on CASSANDRASC-113:
-------------------------------------------------------------
Commit af0060f1325bf8edf74171f60326a3427e13e01d in cassandra-sidecar's branch
refs/heads/trunk from Francisco Guerrero
[ https://gitbox.apache.org/repos/asf?p=cassandra-sidecar.git;h=af0060f ]
CASSANDRASC-113 Fix flaky JmxClientTest (#105)
In this PR, we fix the race condition that occurs when determining the port
number to use for the registry.
Currently, the port is determined in the `availablePort` method, where a socket
is determined by using port
0. The OS will assign a port number for the socket, but we immediately close
the socket, and use the determined
port number to run the test. This PR brings a better approach by directly using
port 0 while creating the
registry, thus avoiding the intermediate step and directly using the port that
originally was assigned
to the registry without releasing it until the end of the test.
Additionally in this PR, we rename the integration test JmxClientTest which
name is colliding with the
unit test. This allows for a better IDE integration and debugging experience.
Patch by Francisco Guerrero; Reviewed by Yifan Cai for CASSANDRASC-113
> Fix flaky JmxClientTest
> -----------------------
>
> Key: CASSANDRASC-113
> URL: https://issues.apache.org/jira/browse/CASSANDRASC-113
> Project: Sidecar for Apache Cassandra
> Issue Type: Bug
> Components: Configuration
> Reporter: Francisco Guerrero
> Assignee: Francisco Guerrero
> Priority: Normal
> Labels: pull-request-available
>
> JmxClientTests can fail when there is a race between registry port assignment
> and the test starting to use the port.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]