AuroraTwinkle commented on code in PR #24574:
URL: https://github.com/apache/pulsar/pull/24574#discussion_r2239044547
##########
pulsar-broker/src/test/java/org/apache/pulsar/client/impl/ServiceUrlQuarantineTest.java:
##########
@@ -53,10 +53,10 @@ public class ServiceUrlQuarantineTest extends
ProducerConsumerBase {
private PulsarClientImpl pulsarClientWithBinaryServiceUrlDisableQuarantine;
private PulsarClientImpl pulsarClientWithHttpServiceUrl;
private PulsarClientImpl pulsarClientWithHttpServiceUrlDisableQuarantine;
- private static final int BROKER_SERVICE_PORT = 6666;
- private static final int WEB_SERVICE_PORT = 8888;
+ private static final int BROKER_SERVICE_PORT =
PortManager.nextLockedFreePort();
+ private static final int WEB_SERVICE_PORT =
PortManager.nextLockedFreePort();
Review Comment:
ok
##########
pulsar-broker/src/test/java/org/apache/pulsar/client/impl/ServiceUrlQuarantineTest.java:
##########
@@ -67,8 +67,8 @@ protected void setup() throws Exception {
StringBuilder binaryServiceUrlBuilder = new
StringBuilder(pulsar.getBrokerServiceUrl());
StringBuilder httpServiceUrlBuilder = new
StringBuilder(pulsar.getWebServiceAddress());
for (int i = 0; i < UNAVAILABLE_NODES; i++) {
-
binaryServiceUrlBuilder.append(",127.0.0.1:").append(ThreadLocalRandom.current().nextInt(100,
1000));
-
httpServiceUrlBuilder.append(",127.0.0.1:").append(ThreadLocalRandom.current().nextInt(100,
1000));
+
binaryServiceUrlBuilder.append(",127.0.0.1:").append(PortManager.nextLockedFreePort());
+
httpServiceUrlBuilder.append(",127.0.0.1:").append(PortManager.nextLockedFreePort());
Review Comment:
> these ports should be tracked and released at cleanup. PortManager is
stateful and that's the reason.
ok
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]