Skip to content

Commit 3cc7057

Browse files
authored
ref(browser-integration-tests): Fix flake in interaction transaction tests (#10365)
This PR decreases the lower bound of the interaction span duration. In the script file, we hard block for 70ms but I've seen test fails where we're just ever so slightly below 70ms (69.x). Figured this is because of some timing inaccuracies. closes #10363
1 parent 427fa20 commit 3cc7057

File tree

1 file changed

+7
-7
lines changed
  • dev-packages/browser-integration-tests/suites/tracing/browsertracing/interactions

1 file changed

+7
-7
lines changed

dev-packages/browser-integration-tests/suites/tracing/browsertracing/interactions/test.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { Route } from '@playwright/test';
22
import { expect } from '@playwright/test';
3-
import type { Event, Span, SpanContext, Transaction } from '@sentry/types';
3+
import type { SerializedEvent, Span, SpanContext, Transaction } from '@sentry/types';
44

55
import { sentryTest } from '../../../../utils/fixtures';
66
import {
@@ -30,7 +30,7 @@ sentryTest('should capture interaction transaction. @firefox', async ({ browserN
3030
const url = await getLocalTestPath({ testDir: __dirname });
3131

3232
await page.goto(url);
33-
await getFirstSentryEnvelopeRequest<Event>(page);
33+
await getFirstSentryEnvelopeRequest<SerializedEvent>(page);
3434

3535
await page.locator('[data-test-id=interaction-button]').click();
3636
await page.locator('.clicked[data-test-id=interaction-button]').isVisible();
@@ -51,7 +51,7 @@ sentryTest('should capture interaction transaction. @firefox', async ({ browserN
5151
expect(interactionSpan.timestamp).toBeDefined();
5252

5353
const interactionSpanDuration = (interactionSpan.timestamp! - interactionSpan.start_timestamp) * 1000;
54-
expect(interactionSpanDuration).toBeGreaterThan(70);
54+
expect(interactionSpanDuration).toBeGreaterThan(65);
5555
expect(interactionSpanDuration).toBeLessThan(200);
5656
});
5757

@@ -70,12 +70,12 @@ sentryTest(
7070

7171
const url = await getLocalTestPath({ testDir: __dirname });
7272
await page.goto(url);
73-
await getFirstSentryEnvelopeRequest<Event>(page);
73+
await getFirstSentryEnvelopeRequest<SerializedEvent>(page);
7474

7575
for (let i = 0; i < 4; i++) {
7676
await wait(100);
7777
await page.locator('[data-test-id=interaction-button]').click();
78-
const envelope = await getMultipleSentryEnvelopeRequests<Event>(page, 1);
78+
const envelope = await getMultipleSentryEnvelopeRequests<SerializedEvent>(page, 1);
7979
expect(envelope[0].spans).toHaveLength(1);
8080
}
8181
},
@@ -97,11 +97,11 @@ sentryTest(
9797
const url = await getLocalTestPath({ testDir: __dirname });
9898

9999
await page.goto(url);
100-
await getFirstSentryEnvelopeRequest<Event>(page);
100+
await getFirstSentryEnvelopeRequest<SerializedEvent>(page);
101101

102102
await page.locator('[data-test-id=annotated-button]').click();
103103

104-
const envelopes = await getMultipleSentryEnvelopeRequests<TransactionJSON>(page, 1);
104+
const envelopes = await getMultipleSentryEnvelopeRequests<SerializedEvent>(page, 1);
105105
expect(envelopes).toHaveLength(1);
106106
const eventData = envelopes[0];
107107

0 commit comments

Comments
 (0)