Skip to content

test(tracing): Fix flaky integration tests of multiple requests. #4384

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 1 commit into from
Jan 11, 2022
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
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,12 @@ sentryTest('should create spans for multiple fetch requests', async ({ getLocalT
sentryTest('should attach `sentry-trace` header to multiple fetch requests', async ({ getLocalTestPath, page }) => {
const url = await getLocalTestPath({ testDir: __dirname });

page.goto(url);
const requests = await Promise.all([0, 1, 2].map(idx => page.waitForRequest(`http://example.com/${idx}`)));
const requests = (
await Promise.all([
page.goto(url),
Promise.all([0, 1, 2].map(idx => page.waitForRequest(`http://example.com/${idx}`))),
])
)[1];

expect(requests).toHaveLength(3);

Expand Down
8 changes: 6 additions & 2 deletions packages/integration-tests/suites/tracing/request/xhr/test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,12 @@ sentryTest('should create spans for multiple XHR requests', async ({ getLocalTes
sentryTest('should attach `sentry-trace` header to multiple XHR requests', async ({ getLocalTestPath, page }) => {
const url = await getLocalTestPath({ testDir: __dirname });

page.goto(url);
const requests = await Promise.all([0, 1, 2].map(idx => page.waitForRequest(`http://example.com/${idx}`)));
const requests = (
await Promise.all([
page.goto(url),
Promise.all([0, 1, 2].map(idx => page.waitForRequest(`http://example.com/${idx}`))),
])
)[1];

expect(requests).toHaveLength(3);

Expand Down