lukasz-antoniak commented on code in PR #340:
URL: https://github.com/apache/cassandra-sidecar/pull/340#discussion_r3182114673


##########
integration-tests/src/integrationTest/org/apache/cassandra/sidecar/routes/CassandraNodeOperationsIntegrationTest.java:
##########
@@ -76,7 +76,7 @@ void testNodeDrainOperationSuccess()
         trustedClient().put(serverWrapper.serverPort, "localhost", 
ApiEndpointsV1.NODE_DRAIN_ROUTE)
                        .send());
 
-        assertThat(drainResponse.statusCode()).isEqualTo(OK.code());
+        assertThat(drainResponse.statusCode()).isIn(OK.code(), 
ACCEPTED.code());

Review Comment:
   Below in the assertions, we check that job status is in created, running or 
succeeded state:
   ```
   assertThat(responseBody.getString("jobStatus")).isIn(
   OperationalJobStatus.CREATED.name(),
   OperationalJobStatus.RUNNING.name(),
   OperationalJobStatus.SUCCEEDED.name()
   );
   ```
   `ACCEPTED` maps to running state, and this test was flaky when I have 
executed complete test suite.
   ```
   OperationalJobStatus status = job.status();
   LOGGER.info("Job completion status={} jobId={}", status, job.jobId());
   if (status.isCompleted())
   {
       context.response().setStatusCode(HttpResponseStatus.OK.code());
   }
   else
   {
       context.response().setStatusCode(HttpResponseStatus.ACCEPTED.code());
   }
   ```



-- 
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]

Reply via email to