From 9b113c956663b38115a10599c23a1fcdc3e8ba80 Mon Sep 17 00:00:00 2001 From: Bing Li Date: Thu, 29 Aug 2024 12:26:19 -0700 Subject: [PATCH] fix test --- .../snowpark_test/OpenTelemetrySuite.scala | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/test/scala/com/snowflake/snowpark_test/OpenTelemetrySuite.scala b/src/test/scala/com/snowflake/snowpark_test/OpenTelemetrySuite.scala index 278437fd..aba7a142 100644 --- a/src/test/scala/com/snowflake/snowpark_test/OpenTelemetrySuite.scala +++ b/src/test/scala/com/snowflake/snowpark_test/OpenTelemetrySuite.scala @@ -449,16 +449,28 @@ class OpenTelemetrySuite extends OpenTelemetryEnabled { } test("actions should be processed in the span time period") { + val time1 = System.currentTimeMillis() val result = ActionInfo("ClassA", "functionB", "fileC", 123, "chainD").emit { Thread.sleep(1) val time = System.currentTimeMillis() Thread.sleep(1) time } + val time2 = System.currentTimeMillis() val l = testSpanExporter.getFinishedSpanItems val spanStart = l.get(0).getStartEpochNanos / 1000000 val spanEnd = l.get(0).getEndEpochNanos / 1000000 - assert(spanStart < spanEnd) + // scalastyle:off + println( + s""" + |XXXXX + |time1: $time1 + |time2: $time2 + |result: $result + |spanStart: $spanStart + |spanEnd: $spanEnd + |""".stripMargin) + // scalastyle:on assert(spanStart < result) assert(result < spanEnd) }