Code cleanup around opensearch process info (#15709)

* Code cleanup around opensearch process info

* Code cleanup

* fixed naming and test

* fixed test

* fixed test

* code cleanup

* code cleanup
This commit is contained in:
Tomas Dvorak
2023-06-19 06:36:32 +02:00
committed by GitHub
parent 8dd21cc4f4
commit 9105655645
15 changed files with 118 additions and 108 deletions

View File

@@ -108,7 +108,7 @@ public class DatanodeSecuritySetupIT {
.withStopStrategy(StopStrategies.stopAfterAttempt(120))
.retryIfException(input -> input instanceof NoHttpResponseException)
.retryIfException(input -> input instanceof SocketException)
.retryIfResult(input -> !input.extract().body().path("process.info.status").equals("AVAILABLE"))
.retryIfResult(input -> !input.extract().body().path("opensearch.node.state").equals("AVAILABLE"))
.build();
retryer.call(() -> RestAssured.given()

View File

@@ -55,16 +55,14 @@ public class DatanodeStartupIT {
.withStopStrategy(StopStrategies.stopAfterAttempt(120))
.retryIfException(input -> input instanceof NoHttpResponseException)
.retryIfException(input -> input instanceof SocketException)
.retryIfResult(input -> !input.extract().body().path("process.info.status").equals("AVAILABLE"))
.retryIfResult(input -> !input.extract().body().path("opensearch.node.state").equals("AVAILABLE"))
.build();
final Integer datanodeRestApiPort = backend.getDatanodeRestPort();
retryer.call(() -> this.getStatus(datanodeRestApiPort))
final Integer datanodeRestApiPort = backend.getDatanodeRestPort();
retryer.call(() -> this.getStatus(datanodeRestApiPort))
.assertThat()
.body("process.info.node_name", Matchers.equalTo("node1"))
.body("process.info.pid", Matchers.notNullValue())
.body("process.info.user", Matchers.equalTo("opensearch"));
.body("opensearch.node.node_name", Matchers.equalTo("node1"))
.body("opensearch.node.process.pid", Matchers.notNullValue());
} catch (RetryException retryException) {
LOG.error("DataNode Container logs follow:\n" + backend.getLogs());
throw retryException;

View File

@@ -127,7 +127,7 @@ class CommandLineProcessTest {
}
@Test
void testExitCode() throws IOException, ExecutionException, InterruptedException, TimeoutException {
void testExitCode() throws ExecutionException, InterruptedException, TimeoutException {
final CompletableFuture<Integer> exitCodeFuture = new CompletableFuture<>();
final ProcessListener listener = new ProcessListener() {