Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion packages/opentelemetry/test/trace.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2185,7 +2185,10 @@ describe('span.end() timestamp conversion', () => {
});

it('converts seconds to milliseconds for startSpan child span', () => {
const nowSec = Math.floor(Date.now() / 1000) + 1;
// +10s buffer (not +1 like sibling tests): the outer startSpan + inner startInactiveSpan
// adds enough wallclock overhead that nowSec*1000 can slip behind innerSpan's startTime,
// tripping OTel's `endTime < startTime` clamp and copying startTime's nanos onto endTime.
const nowSec = Math.floor(Date.now() / 1000) + 10;
let capturedEndTime: [number, number] | undefined;
startSpan({ name: 'outer' }, () => {
const innerSpan = startInactiveSpan({ name: 'inner' });
Expand Down
Loading