mirror of
https://github.com/Graylog2/graylog2-server.git
synced 2026-03-13 09:32:21 +08:00
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:
@@ -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()
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user