Skip to content
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,9 @@ test.describe('Lambda layer', () => {
const transactionEvent = await transactionEventPromise;

expect(transactionEvent.contexts?.trace?.status).toBe('ok');
expect(transactionEvent.timestamp! - transactionEvent.start_timestamp!).toBeGreaterThanOrEqual(0.2);
// The span clock and the 200ms callback timer can disagree by a few ms. A span that ended when the
// handler returned would be near 0, so this margin still catches it.
expect(transactionEvent.timestamp! - transactionEvent.start_timestamp!).toBeGreaterThanOrEqual(0.15);
});

test('sets error status when a callback-style handler calls back with an error after it returned', async ({
Expand All @@ -360,7 +362,7 @@ test.describe('Lambda layer', () => {
const [errorEvent, transactionEvent] = await Promise.all([errorEventPromise, transactionEventPromise]);

expect(transactionEvent.contexts?.trace?.status).toBe('internal_error');
expect(transactionEvent.timestamp! - transactionEvent.start_timestamp!).toBeGreaterThanOrEqual(0.2);
expect(transactionEvent.timestamp! - transactionEvent.start_timestamp!).toBeGreaterThanOrEqual(0.15);
expect(errorEvent.contexts?.trace?.trace_id).toBe(transactionEvent.contexts?.trace?.trace_id);
});

Expand Down
Loading