Skip to content

Commit 726c240

Browse files
authored
Changing the waiting strategy on some IT tests (#24022)
* change waiting strategy * remove unused imports * remove test that did not exist in 6.2 * Revert "remove test that did not exist in 6.2" This reverts commit 936eb93.
1 parent a9e9d66 commit 726c240

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

full-backend-tests/src/test/java/org/graylog/searchbackend/datanode/DatanodeOpensearchProxyIT.java

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
*/
1717
package org.graylog.searchbackend.datanode;
1818

19-
import com.github.rholder.retry.RetryException;
2019
import io.restassured.response.ValidatableResponse;
2120
import org.assertj.core.api.Assertions;
2221
import org.graylog.testing.completebackend.Lifecycle;
@@ -31,7 +30,6 @@
3130

3231
import java.util.Collections;
3332
import java.util.List;
34-
import java.util.concurrent.ExecutionException;
3533

3634
import static java.time.Duration.ofSeconds;
3735
import static org.awaitility.Awaitility.waitAtMost;
@@ -50,19 +48,24 @@ void setUp(GraylogApis apis) {
5048
}
5149

5250
@FullBackendTest
53-
void testProxyPlaintextGet() throws ExecutionException, RetryException {
54-
waitAtMost(ofSeconds(30)).untilAsserted(() -> {
51+
void testProxyPlaintextGet() {
52+
waitAtMost(ofSeconds(30)).until(() -> {
5553
final ValidatableResponse response = apis.get("/datanodes/any/opensearch/_cat/indices", 200);
5654
final String responseBody = response.extract().body().asString();
57-
Assertions.assertThat(responseBody).contains("graylog_0").contains("gl-system-events_0");
55+
return responseBody.contains("graylog_0") && responseBody.contains("gl-system-events_0");
5856
});
5957
}
6058

6159
@FullBackendTest
6260
void testProxyJsonGet() {
63-
waitAtMost(ofSeconds(30)).untilAsserted(() -> {
64-
final ValidatableResponse response = apis.get("/datanodes/any/opensearch/_mapping", 200);
65-
response.assertThat().body("graylog_0.mappings.properties.gl2_accounted_message_size.type", Matchers.equalTo("long"));
61+
waitAtMost(ofSeconds(30)).until(() -> {
62+
try {
63+
final ValidatableResponse response = apis.get("/datanodes/any/opensearch/_mapping", 200);
64+
response.assertThat().body("graylog_0.mappings.properties.gl2_accounted_message_size.type", Matchers.equalTo("long"));
65+
} catch (AssertionError e) {
66+
return false;
67+
}
68+
return true;
6669
});
6770
}
6871

0 commit comments

Comments
 (0)