Skip to content

Commit

Permalink
Fix flaky OpentelemetryReactiveIT#testSecurityEvents
Browse files Browse the repository at this point in the history
(cherry picked from commit 1b9a34b)
  • Loading branch information
michalvavrik authored and jedla97 committed Nov 27, 2024
1 parent a5aec9c commit 40182bb
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ public void testSecurityEvents() {
int pageLimit = 10;
String serviceName = "pingservice";
String operationName = "GET /admin";
doSecurityEndpointRequest();
await().atMost(30, TimeUnit.SECONDS).pollInterval(Duration.ofSeconds(1)).untilAsserted(() -> {
doSecurityEndpointRequest();
thenRetrieveTraces(pageLimit, "1h", serviceName, operationName);
assertSecurityEventsAndLogsPresent();
});
Expand Down Expand Up @@ -143,7 +143,7 @@ private void thenRetrieveTraces(int pageLimit, String lookBack, String serviceNa

private void assertSecurityEventsAndLogsPresent() {
resp.then().body(
"data[0].spans.findAll { span -> span.operationName == 'GET /admin' }[0].logs.flatten().findAll { log -> log.fields.find { field -> field.key == 'event' && field.value == 'quarkus.security.authorization.success' } }",
"data.flatten().spans.flatten().findAll { span -> span.operationName == 'GET /admin' }.logs.flatten().findAll { log -> log.fields.find { field -> field.key == 'event' && field.value == 'quarkus.security.authorization.success' } }",
is(not(empty())));
}

Expand Down

0 comments on commit 40182bb

Please sign in to comment.