Skip to content

Commit 33aef95

Browse files
authored
test(tracing): Fix flaky integration tests of multiple requests. (#4384)
1 parent 841c0d3 commit 33aef95

File tree

2 files changed

+12
-4
lines changed
  • packages/integration-tests/suites/tracing/request

2 files changed

+12
-4
lines changed

packages/integration-tests/suites/tracing/request/fetch/test.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,12 @@ sentryTest('should create spans for multiple fetch requests', async ({ getLocalT
2626
sentryTest('should attach `sentry-trace` header to multiple fetch requests', async ({ getLocalTestPath, page }) => {
2727
const url = await getLocalTestPath({ testDir: __dirname });
2828

29-
page.goto(url);
30-
const requests = await Promise.all([0, 1, 2].map(idx => page.waitForRequest(`http://example.com/${idx}`)));
29+
const requests = (
30+
await Promise.all([
31+
page.goto(url),
32+
Promise.all([0, 1, 2].map(idx => page.waitForRequest(`http://example.com/${idx}`))),
33+
])
34+
)[1];
3135

3236
expect(requests).toHaveLength(3);
3337

packages/integration-tests/suites/tracing/request/xhr/test.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,12 @@ sentryTest('should create spans for multiple XHR requests', async ({ getLocalTes
2626
sentryTest('should attach `sentry-trace` header to multiple XHR requests', async ({ getLocalTestPath, page }) => {
2727
const url = await getLocalTestPath({ testDir: __dirname });
2828

29-
page.goto(url);
30-
const requests = await Promise.all([0, 1, 2].map(idx => page.waitForRequest(`http://example.com/${idx}`)));
29+
const requests = (
30+
await Promise.all([
31+
page.goto(url),
32+
Promise.all([0, 1, 2].map(idx => page.waitForRequest(`http://example.com/${idx}`))),
33+
])
34+
)[1];
3135

3236
expect(requests).toHaveLength(3);
3337

0 commit comments

Comments
 (0)