Skip to content

Commit

Permalink
Fix flaky test
Browse files Browse the repository at this point in the history
  • Loading branch information
dyladan committed Jan 10, 2023
1 parent fd2398d commit 830c799
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ describe('Span', () => {

describe('when 2nd param is "TimeInput" type', () => {
it('should have an entered time for event - ', () => {
const startTime = Date.now();
const span = new Span(
tracer,
ROOT_CONTEXT,
Expand All @@ -190,11 +191,11 @@ describe('Span', () => {
SpanKind.SERVER,
undefined,
[],
0
startTime
);
const timeMS = 123;
const eventTimeMS = 123;
const spanStartTime = hrTimeToMilliseconds(span.startTime);
const eventTime = spanStartTime + timeMS;
const eventTime = spanStartTime + eventTimeMS;

span.addEvent('my-event', eventTime);

Expand Down

0 comments on commit 830c799

Please sign in to comment.