Skip to content

Commit ca01711

Browse files
committed
fix loader replay test flakiness
1 parent 2673a02 commit ca01711

File tree

4 files changed

+2
-14
lines changed

4 files changed

+2
-14
lines changed
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
import * as Sentry from '@sentry/browser';
22

33
window.Sentry = Sentry;
4-
window._testBaseTimestamp = performance.timeOrigin / 1000;

packages/browser-integration-tests/loader-suites/loader/noOnLoad/replay/test.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { expect } from '@playwright/test';
22

33
import { sentryTest } from '../../../../utils/fixtures';
4-
import { getReplayEvent,shouldSkipReplayTest, waitForReplayRequest } from '../../../../utils/replayHelpers';
4+
import { getReplayEvent, shouldSkipReplayTest, waitForReplayRequest } from '../../../../utils/replayHelpers';
55

66
sentryTest('should capture a replay', async ({ getLocalTestUrl, page }) => {
77
if (shouldSkipReplayTest()) {
@@ -21,13 +21,8 @@ sentryTest('should capture a replay', async ({ getLocalTestUrl, page }) => {
2121
const url = await getLocalTestUrl({ testDir: __dirname });
2222
await page.goto(url);
2323

24-
const timeOrigin = await page.evaluate<number>('window._testBaseTimestamp');
2524
const eventData = getReplayEvent(await req);
2625

2726
expect(eventData).toBeDefined();
2827
expect(eventData.segment_id).toBe(0);
29-
30-
const { replay_start_timestamp: startTimestamp } = eventData;
31-
32-
expect(startTimestamp).toBeCloseTo(timeOrigin, 1);
3328
});

packages/browser-integration-tests/loader-suites/loader/onLoad/replay/init.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import * as Sentry from '@sentry/browser';
22

33
window.Sentry = Sentry;
4-
window._testBaseTimestamp = performance.timeOrigin / 1000;
54

65
Sentry.onLoad(function () {
76
Sentry.init({});

packages/browser-integration-tests/loader-suites/loader/onLoad/replay/test.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { expect } from '@playwright/test';
22

33
import { sentryTest } from '../../../../utils/fixtures';
4-
import { getReplayEvent,shouldSkipReplayTest, waitForReplayRequest } from '../../../../utils/replayHelpers';
4+
import { getReplayEvent, shouldSkipReplayTest, waitForReplayRequest } from '../../../../utils/replayHelpers';
55

66
sentryTest('should capture a replay', async ({ getLocalTestUrl, page }) => {
77
if (shouldSkipReplayTest()) {
@@ -21,13 +21,8 @@ sentryTest('should capture a replay', async ({ getLocalTestUrl, page }) => {
2121
const url = await getLocalTestUrl({ testDir: __dirname });
2222
await page.goto(url);
2323

24-
const timeOrigin = await page.evaluate<number>('window._testBaseTimestamp');
2524
const eventData = getReplayEvent(await req);
2625

2726
expect(eventData).toBeDefined();
2827
expect(eventData.segment_id).toBe(0);
29-
30-
const { replay_start_timestamp: startTimestamp } = eventData;
31-
32-
expect(startTimestamp).toBeCloseTo(timeOrigin, 1);
3328
});

0 commit comments

Comments
 (0)