Kaynağa Gözat

Fix flaky kotlin coroutine test (#5732)

Lauri Tulmin 2 yıl önce
ebeveyn
işleme
4e8ccc3126

+ 11 - 11
instrumentation/kotlinx-coroutines/javaagent/src/test/kotlin/io/opentelemetry/javaagent/instrumentation/kotlinxcoroutines/KotlinCoroutinesInstrumentationTest.kt

@@ -224,25 +224,25 @@ class KotlinCoroutinesInstrumentationTest {
 
     testing.waitAndAssertTraces(
       { trace ->
-        trace.hasSpansSatisfyingExactly(
-          {
-            it.hasName("parent")
+        trace.satisfiesExactlyInAnyOrder(
+          Consumer {
+            assertThat(it).hasName("parent")
               .hasNoParent()
           },
-          {
-            it.hasName("future1")
+          Consumer {
+            assertThat(it).hasName("future1")
               .hasParent(trace.getSpan(0))
           },
-          {
-            it.hasName("keptPromise")
+          Consumer {
+            assertThat(it).hasName("keptPromise")
               .hasParent(trace.getSpan(0))
           },
-          {
-            it.hasName("keptPromise2")
+          Consumer {
+            assertThat(it).hasName("keptPromise2")
               .hasParent(trace.getSpan(0))
           },
-          {
-            it.hasName("brokenPromise")
+          Consumer {
+            assertThat(it).hasName("brokenPromise")
               .hasParent(trace.getSpan(0))
           },
         )