Skip to content

Commit

Permalink
Add debug information to flaky test
Browse files Browse the repository at this point in the history
  • Loading branch information
radcortez committed Aug 10, 2022
1 parent ba3587b commit 22acc74
Showing 1 changed file with 7 additions and 0 deletions.
Expand Up @@ -19,11 +19,16 @@
import static org.hamcrest.Matchers.equalTo;
import static org.junit.jupiter.api.Assertions.*;

import java.util.Collections;
import java.util.List;
import java.util.Locale;
import java.util.Map;
import java.util.concurrent.TimeUnit;

import io.restassured.RestAssured;
import io.restassured.filter.log.RequestLoggingFilter;
import io.restassured.filter.log.ResponseLoggingFilter;
import io.restassured.http.Header;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
Expand Down Expand Up @@ -119,7 +124,9 @@ void bus() {
assertEquals("hello to bus", messages.get(0));

await().atMost(5, TimeUnit.SECONDS).until(() -> getSpans().size() == 3);
RestAssured.filters(new RequestLoggingFilter(), new ResponseLoggingFilter());
List<Map<String, Object>> spans = getSpans();
RestAssured.replaceFiltersWith(Collections.emptyList());
assertEquals(3, spans.size());

assertEquals(spans.get(0).get("traceId"), spans.get(1).get("traceId"));
Expand Down

0 comments on commit 22acc74

Please sign in to comment.