This is an automated email from the ASF dual-hosted git repository.
jamesnetherton pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-quarkus.git
The following commit(s) were added to refs/heads/main by this push:
new 11ffdee Fix intermittent failure in native MicroprofileMetricsIT
11ffdee is described below
commit 11ffdee595adae979e99e108d9ab49de3fe9cf2b
Author: James Netherton <[email protected]>
AuthorDate: Mon Apr 12 13:36:00 2021 +0100
Fix intermittent failure in native MicroprofileMetricsIT
Fixex #2460
---
.../microprofile/it/health/MicroProfileHealthTest.java | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git
a/integration-tests/microprofile/src/test/java/org/apache/camel/quarkus/component/microprofile/it/health/MicroProfileHealthTest.java
b/integration-tests/microprofile/src/test/java/org/apache/camel/quarkus/component/microprofile/it/health/MicroProfileHealthTest.java
index 4f08d1e..3bbd62a 100644
---
a/integration-tests/microprofile/src/test/java/org/apache/camel/quarkus/component/microprofile/it/health/MicroProfileHealthTest.java
+++
b/integration-tests/microprofile/src/test/java/org/apache/camel/quarkus/component/microprofile/it/health/MicroProfileHealthTest.java
@@ -163,7 +163,7 @@ class MicroProfileHealthTest {
}
@Test
- public void testFailureThreshold() throws InterruptedException {
+ public void testFailureThreshold() {
try {
RestAssured.get("/microprofile-health/route/checkIntervalThreshold/stop")
.then()
@@ -192,6 +192,19 @@ class MicroProfileHealthTest {
RestAssured.get("/microprofile-health/route/checkIntervalThreshold/start")
.then()
.statusCode(204);
+
+ // Wait for the threshold check to report status UP
+ Awaitility.await().atMost(10, TimeUnit.SECONDS).pollDelay(50,
TimeUnit.MILLISECONDS).until(() -> {
+ JsonPath result = RestAssured.when().get("/health").then()
+ .contentType(ContentType.JSON)
+ .header("Content-Type",
containsString("charset=UTF-8"))
+ .extract()
+ .jsonPath();
+
+ String status = result.getString("status");
+ List<String> routeStatus =
result.getList("checks.data.'route:checkIntervalThreshold'");
+ return status.equals("UP") && routeStatus.contains("UP");
+ });
}
}
}