Skip to content

test: Fix flaky droppedError test #7337

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Mar 6, 2023
Merged
Show file tree
Hide file tree
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
6 changes: 3 additions & 3 deletions packages/integration-tests/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ const config: PlaywrightTestConfig = {
retries: 0,
// Run tests inside of a single file in parallel
fullyParallel: true,
// Use 5 workers on CI, else use defaults (based on available CPU cores)
// Note that 5 is a random number selected to work well with our CI setup
workers: process.env.CI ? 5 : undefined,
// Use 3 workers on CI, else use defaults (based on available CPU cores)
// Note that 3 is a random number selected to work well with our CI setup
workers: process.env.CI ? 3 : undefined,
};
export default config;
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,15 @@ sentryTest(
sentryTest.skip();
}

let callsToSentry = 0;
const reqPromise0 = waitForReplayRequest(page, 0);
const reqPromise1 = waitForReplayRequest(page, 1);
const reqPromise2 = waitForReplayRequest(page, 2);

let callsToSentry = 0;

await page.route('https://dsn.ingest.sentry.io/**/*', route => {
callsToSentry++;

return route.fulfill({
status: 200,
contentType: 'application/json',
Expand All @@ -46,10 +50,13 @@ sentryTest(
const req0 = await reqPromise0;

await page.click('#go-background');
expect(callsToSentry).toEqual(2); // 2 replay events
await reqPromise1;

await page.click('#log');
await page.click('#go-background');
await reqPromise2;

// Note: The fact that reqPromise1/reqPromise2 are fulfilled prooves that the recording continues

const event0 = getReplayEvent(req0);

Expand Down
6 changes: 3 additions & 3 deletions packages/nextjs/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ const config: PlaywrightTestConfig = {
},
// Run tests inside of a single file in parallel
fullyParallel: true,
// Use 5 workers on CI, else use defaults (based on available CPU cores)
// Note that 5 is a random number selected to work well with our CI setup
workers: process.env.CI ? 5 : undefined,
// Use 3 workers on CI, else use defaults (based on available CPU cores)
// Note that 3 is a random number selected to work well with our CI setup
workers: process.env.CI ? 3 : undefined,
webServer: {
cwd: path.join(__dirname, 'test', 'integration'),
command: 'yarn start',
Expand Down
6 changes: 3 additions & 3 deletions packages/remix/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ const config: PlaywrightTestConfig = {
},
// Run tests inside of a single file in parallel
fullyParallel: true,
// Use 5 workers on CI, else use defaults (based on available CPU cores)
// Note that 5 is a random number selected to work well with our CI setup
workers: process.env.CI ? 5 : undefined,
// Use 3 workers on CI, else use defaults (based on available CPU cores)
// Note that 3 is a random number selected to work well with our CI setup
workers: process.env.CI ? 3 : undefined,
webServer: {
command: '(cd test/integration/ && yarn build && yarn start)',
port: 3000,
Expand Down