Skip to content

Commit

Permalink
Fix the assertion in MetricApmIT (elastic#104420) (elastic#105620)
Browse files Browse the repository at this point in the history
The test should print out the assertions that were not matched if it has not managed to finish within 30s
relates elastic#103286
  • Loading branch information
pgomulka authored Feb 22, 2024
1 parent 6efe4bc commit aa94139
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import org.elasticsearch.xcontent.XContentParserConfiguration;
import org.elasticsearch.xcontent.spi.XContentProvider;
import org.hamcrest.Matcher;
import org.hamcrest.Matchers;
import org.hamcrest.StringDescription;
import org.junit.ClassRule;
import org.junit.Rule;
Expand Down Expand Up @@ -107,8 +106,10 @@ public void testApmIntegration() throws Exception {

client().performRequest(new Request("GET", "/_use_apm_metrics"));

assertTrue("Timeout when waiting for assertions to complete.", finished.await(30, TimeUnit.SECONDS));
assertThat(sampleAssertions, Matchers.equalTo(Collections.emptyMap()));
assertTrue(
"Timeout when waiting for assertions to complete. Remaining assertions to match: " + sampleAssertions,
finished.await(30, TimeUnit.SECONDS)
);
}

private <T> Map.Entry<String, Predicate<Map<String, Object>>> assertion(
Expand Down

0 comments on commit aa94139

Please sign in to comment.