Made tests less brittle

This commit is contained in:
Marcin Grzejszczak
2018-11-02 13:36:29 +01:00
parent 9b2def2be1
commit c9aade8853

View File

@@ -89,11 +89,13 @@ public class TraceWebAsyncClientAutoConfigurationTests {
initialSpan.finish();
}
then(this.accumulator
.getSpans().stream().filter(span -> Span.Kind.CLIENT == span.kind())
.findFirst().get()).matches(
span -> span.duration() >= TimeUnit.MILLISECONDS.toMicros(100));
then(this.tracer.tracer().currentSpan()).isNull();
Awaitility.await().untilAsserted(() -> {
then(this.accumulator
.getSpans().stream().filter(span -> Span.Kind.CLIENT == span.kind())
.findFirst().get()).matches(
span -> span.duration() >= TimeUnit.MILLISECONDS.toMicros(100));
then(this.tracer.tracer().currentSpan()).isNull();
});
}
@Test