yifan-c commented on code in PR #171:
URL: https://github.com/apache/cassandra-sidecar/pull/171#discussion_r1928060371
##########
server/src/test/java/org/apache/cassandra/sidecar/CassandraSidecarDaemonTest.java:
##########
@@ -87,14 +89,15 @@ void testSuccessfulStartup() throws Exception
CassandraSidecarDaemon.main(NO_ARGS);
WebClient client = WebClient.create(Vertx.vertx());
- HttpResponse<String> response = client.get(9043, "localhost",
"/api/v1/__health")
- .as(BodyCodec.string())
- .send()
- .toCompletionStage()
- .toCompletableFuture()
- .get(10, TimeUnit.SECONDS);
- assertThat(response.statusCode()).isEqualTo(OK.code());
- assertThat(response.body()).isEqualTo("{\"status\":\"OK\"}");
+ loopAssert(10, () -> {
+ HttpResponse<String> response = getBlocking(client.get(9043,
"localhost", "/api/v1/__health")
Review Comment:
Yes. The reason is that
`org.apache.cassandra.sidecar.CassandraSidecarDaemon#main` is non-blocking.
When the test request is sent, the server might not yet bind to the port.
I have seen the test is marked as flaky on CircleCI.
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]