Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-bli committed Aug 29, 2024
1 parent 47c4b6a commit 9b113c9
Showing 1 changed file with 13 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 9b113c9

Please sign in to comment.