Commit b09cb40
authored
test(instrumentation-express): update to use correct span kind enum; also fix test flakiness (#2421)
This is a follow-up on #2408 (comment)
to update one more usage of SpanKind.* to testUtils.OtlpSpanKind.*.
While testing this locally I also noticed that the instr-express tests
using runTestFixture are flaky. The issue is that TestCollector#sortedSpans
can get the span ordering wrong when spans start in the same millisecond
(the resolution of span.startTimeUnixNano). This happens with Express
middleware spans on a fast machine. I've updated sortedSpans to
fallback to using span.parentSpanId to attempt to get more reliable
sorting.1 parent bc69fff commit b09cb40
File tree
2 files changed
+28
-4
lines changed- packages/opentelemetry-test-utils/src
- plugins/node/opentelemetry-instrumentation-express/test
2 files changed
+28
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
113 | | - | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
114 | 122 | | |
115 | 123 | | |
116 | 124 | | |
117 | 125 | | |
118 | 126 | | |
119 | 127 | | |
120 | | - | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
121 | 145 | | |
122 | 146 | | |
123 | 147 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
675 | 675 | | |
676 | 676 | | |
677 | 677 | | |
678 | | - | |
| 678 | + | |
679 | 679 | | |
680 | 680 | | |
681 | 681 | | |
| |||
0 commit comments