Skip to content

Commit a2b9f7b

Browse files
committed
more flakes
1 parent 4c6aa9c commit a2b9f7b

File tree

4 files changed

+60
-56
lines changed
  • dev-packages/browser-integration-tests/suites/replay/extendNetworkBreadcrumbs/fetch

4 files changed

+60
-56
lines changed

dev-packages/browser-integration-tests/suites/replay/extendNetworkBreadcrumbs/fetch/captureRequestHeaders/test.ts

Lines changed: 47 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ sentryTest('handles empty/missing request headers', async ({ getLocalTestPath, p
3535
const url = await getLocalTestPath({ testDir: __dirname });
3636
await page.goto(url);
3737

38-
const [, request] = await Promise.all([
38+
const [, request, { replayRecordingSnapshots }] = await Promise.all([
3939
page.evaluate(() => {
4040
/* eslint-disable */
4141
fetch('http://localhost:7654/foo', {
@@ -47,6 +47,7 @@ sentryTest('handles empty/missing request headers', async ({ getLocalTestPath, p
4747
/* eslint-enable */
4848
}),
4949
requestPromise,
50+
replayRequestPromise,
5051
]);
5152

5253
const eventData = envelopeRequestParser(request);
@@ -65,7 +66,6 @@ sentryTest('handles empty/missing request headers', async ({ getLocalTestPath, p
6566
},
6667
});
6768

68-
const { replayRecordingSnapshots } = await replayRequestPromise;
6969
expect(getReplayPerformanceSpans(replayRecordingSnapshots).filter(span => span.op === 'resource.fetch')).toEqual([
7070
{
7171
data: {
@@ -110,7 +110,7 @@ sentryTest('captures request headers as POJO', async ({ getLocalTestPath, page,
110110
const url = await getLocalTestPath({ testDir: __dirname });
111111
await page.goto(url);
112112

113-
const [, request] = await Promise.all([
113+
const [, request, { replayRecordingSnapshots }] = await Promise.all([
114114
page.evaluate(() => {
115115
/* eslint-disable */
116116
fetch('http://localhost:7654/foo', {
@@ -129,6 +129,7 @@ sentryTest('captures request headers as POJO', async ({ getLocalTestPath, page,
129129
/* eslint-enable */
130130
}),
131131
requestPromise,
132+
replayRequestPromise,
132133
]);
133134

134135
const eventData = envelopeRequestParser(request);
@@ -147,7 +148,6 @@ sentryTest('captures request headers as POJO', async ({ getLocalTestPath, page,
147148
},
148149
});
149150

150-
const { replayRecordingSnapshots } = await replayRequestPromise;
151151
expect(getReplayPerformanceSpans(replayRecordingSnapshots).filter(span => span.op === 'resource.fetch')).toEqual([
152152
{
153153
data: {
@@ -197,25 +197,28 @@ sentryTest('captures request headers on Request', async ({ getLocalTestPath, pag
197197
const url = await getLocalTestPath({ testDir: __dirname });
198198
await page.goto(url);
199199

200-
await page.evaluate(() => {
201-
const request = new Request('http://localhost:7654/foo', {
202-
method: 'POST',
203-
headers: {
204-
Accept: 'application/json',
205-
'Content-Type': 'application/json',
206-
Cache: 'no-cache',
207-
'X-Custom-Header': 'foo',
208-
},
209-
});
210-
/* eslint-disable */
211-
fetch(request).then(() => {
212-
// @ts-expect-error Sentry is a global
213-
Sentry.captureException('test error');
214-
});
215-
/* eslint-enable */
216-
});
200+
const [, request, { replayRecordingSnapshots }] = await Promise.all([
201+
page.evaluate(() => {
202+
const request = new Request('http://localhost:7654/foo', {
203+
method: 'POST',
204+
headers: {
205+
Accept: 'application/json',
206+
'Content-Type': 'application/json',
207+
Cache: 'no-cache',
208+
'X-Custom-Header': 'foo',
209+
},
210+
});
211+
/* eslint-disable */
212+
fetch(request).then(() => {
213+
// @ts-expect-error Sentry is a global
214+
Sentry.captureException('test error');
215+
});
216+
/* eslint-enable */
217+
}),
218+
requestPromise,
219+
replayRequestPromise,
220+
]);
217221

218-
const request = await requestPromise;
219222
const eventData = envelopeRequestParser(request);
220223

221224
expect(eventData.exception?.values).toHaveLength(1);
@@ -232,7 +235,6 @@ sentryTest('captures request headers on Request', async ({ getLocalTestPath, pag
232235
},
233236
});
234237

235-
const { replayRecordingSnapshots } = await replayRequestPromise;
236238
expect(getReplayPerformanceSpans(replayRecordingSnapshots).filter(span => span.op === 'resource.fetch')).toEqual([
237239
{
238240
data: {
@@ -282,25 +284,28 @@ sentryTest('captures request headers as Headers instance', async ({ getLocalTest
282284

283285
await page.goto(url);
284286

285-
await page.evaluate(() => {
286-
const headers = new Headers();
287-
headers.append('Accept', 'application/json');
288-
headers.append('Content-Type', 'application/json');
289-
headers.append('Cache', 'no-cache');
290-
headers.append('X-Custom-Header', 'foo');
287+
const [, request, { replayRecordingSnapshots }] = await Promise.all([
288+
page.evaluate(() => {
289+
const headers = new Headers();
290+
headers.append('Accept', 'application/json');
291+
headers.append('Content-Type', 'application/json');
292+
headers.append('Cache', 'no-cache');
293+
headers.append('X-Custom-Header', 'foo');
291294

292-
/* eslint-disable */
293-
fetch('http://localhost:7654/foo', {
294-
method: 'POST',
295-
headers,
296-
}).then(() => {
297-
// @ts-expect-error Sentry is a global
298-
Sentry.captureException('test error');
299-
});
300-
/* eslint-enable */
301-
});
295+
/* eslint-disable */
296+
fetch('http://localhost:7654/foo', {
297+
method: 'POST',
298+
headers,
299+
}).then(() => {
300+
// @ts-expect-error Sentry is a global
301+
Sentry.captureException('test error');
302+
});
303+
/* eslint-enable */
304+
}),
305+
requestPromise,
306+
replayRequestPromise,
307+
]);
302308

303-
const request = await requestPromise;
304309
const eventData = envelopeRequestParser(request);
305310

306311
expect(eventData.exception?.values).toHaveLength(1);
@@ -317,7 +322,6 @@ sentryTest('captures request headers as Headers instance', async ({ getLocalTest
317322
},
318323
});
319324

320-
const { replayRecordingSnapshots } = await replayRequestPromise;
321325
expect(getReplayPerformanceSpans(replayRecordingSnapshots).filter(span => span.op === 'resource.fetch')).toEqual([
322326
{
323327
data: {
@@ -366,7 +370,7 @@ sentryTest('does not captures request headers if URL does not match', async ({ g
366370
const url = await getLocalTestPath({ testDir: __dirname });
367371
await page.goto(url);
368372

369-
const [, request] = await Promise.all([
373+
const [, request, { replayRecordingSnapshots }] = await Promise.all([
370374
page.evaluate(() => {
371375
/* eslint-disable */
372376
fetch('http://localhost:7654/bar', {
@@ -385,6 +389,7 @@ sentryTest('does not captures request headers if URL does not match', async ({ g
385389
/* eslint-enable */
386390
}),
387391
requestPromise,
392+
replayRequestPromise,
388393
]);
389394

390395
const eventData = envelopeRequestParser(request);
@@ -403,7 +408,6 @@ sentryTest('does not captures request headers if URL does not match', async ({ g
403408
},
404409
});
405410

406-
const { replayRecordingSnapshots } = await replayRequestPromise;
407411
expect(getReplayPerformanceSpans(replayRecordingSnapshots).filter(span => span.op === 'resource.fetch')).toEqual([
408412
{
409413
data: {

dev-packages/browser-integration-tests/suites/replay/extendNetworkBreadcrumbs/fetch/captureRequestSize/test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ sentryTest('captures request body size when body is sent', async ({ getLocalTest
3535
const url = await getLocalTestPath({ testDir: __dirname });
3636
await page.goto(url);
3737

38-
const [, request] = await Promise.all([
38+
const [, request, { replayRecordingSnapshots }] = await Promise.all([
3939
page.evaluate(() => {
4040
/* eslint-disable */
4141
fetch('http://localhost:7654/foo', {
@@ -48,6 +48,7 @@ sentryTest('captures request body size when body is sent', async ({ getLocalTest
4848
/* eslint-enable */
4949
}),
5050
requestPromise,
51+
replayRequestPromise,
5152
]);
5253

5354
const eventData = envelopeRequestParser(request);
@@ -67,7 +68,6 @@ sentryTest('captures request body size when body is sent', async ({ getLocalTest
6768
},
6869
});
6970

70-
const { replayRecordingSnapshots } = await replayRequestPromise;
7171
expect(getReplayPerformanceSpans(replayRecordingSnapshots).filter(span => span.op === 'resource.fetch')).toEqual([
7272
{
7373
data: {
@@ -122,7 +122,7 @@ sentryTest('captures request size from non-text request body', async ({ getLocal
122122
const url = await getLocalTestPath({ testDir: __dirname });
123123
await page.goto(url);
124124

125-
const [, request] = await Promise.all([
125+
const [, request, { replayRecordingSnapshots }] = await Promise.all([
126126
page.evaluate(() => {
127127
/* eslint-disable */
128128
const blob = new Blob(['<html>Hello world!!</html>'], { type: 'text/html' });
@@ -137,6 +137,7 @@ sentryTest('captures request size from non-text request body', async ({ getLocal
137137
/* eslint-enable */
138138
}),
139139
requestPromise,
140+
replayRequestPromise,
140141
]);
141142

142143
const eventData = envelopeRequestParser(request);
@@ -156,7 +157,6 @@ sentryTest('captures request size from non-text request body', async ({ getLocal
156157
},
157158
});
158159

159-
const { replayRecordingSnapshots } = await replayRequestPromise;
160160
expect(getReplayPerformanceSpans(replayRecordingSnapshots).filter(span => span.op === 'resource.fetch')).toEqual([
161161
{
162162
data: {

dev-packages/browser-integration-tests/suites/replay/extendNetworkBreadcrumbs/fetch/captureResponseHeaders/test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ sentryTest('handles empty headers', async ({ getLocalTestPath, page, browserName
3737
const url = await getLocalTestPath({ testDir: __dirname });
3838
await page.goto(url);
3939

40-
const [, request, {replayRecordingSnapshots}] = await Promise.all([
40+
const [, request, { replayRecordingSnapshots }] = await Promise.all([
4141
page.evaluate(() => {
4242
fetch('http://localhost:7654/foo').then(() => {
4343
// @ts-expect-error Sentry is a global
@@ -113,7 +113,7 @@ sentryTest('captures response headers', async ({ getLocalTestPath, page }) => {
113113
const url = await getLocalTestPath({ testDir: __dirname });
114114
await page.goto(url);
115115

116-
const [, request, {replayRecordingSnapshots}] = await Promise.all([
116+
const [, request, { replayRecordingSnapshots }] = await Promise.all([
117117
page.evaluate(() => {
118118
fetch('http://localhost:7654/foo').then(() => {
119119
// @ts-expect-error Sentry is a global
@@ -195,7 +195,7 @@ sentryTest('does not capture response headers if URL does not match', async ({ g
195195
const url = await getLocalTestPath({ testDir: __dirname });
196196
await page.goto(url);
197197

198-
const [, request, {replayRecordingSnapshots}] = await Promise.all([
198+
const [, request, { replayRecordingSnapshots }] = await Promise.all([
199199
page.evaluate(() => {
200200
fetch('http://localhost:7654/bar').then(() => {
201201
// @ts-expect-error Sentry is a global

dev-packages/browser-integration-tests/suites/replay/extendNetworkBreadcrumbs/fetch/captureResponseSize/test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ sentryTest('captures response size from Content-Length header if available', asy
4343
const url = await getLocalTestPath({ testDir: __dirname });
4444
await page.goto(url);
4545

46-
const [, request] = await Promise.all([
46+
const [, request, { replayRecordingSnapshots }] = await Promise.all([
4747
page.evaluate(() => {
4848
/* eslint-disable */
4949
fetch('http://localhost:7654/foo').then(() => {
@@ -53,6 +53,7 @@ sentryTest('captures response size from Content-Length header if available', asy
5353
/* eslint-enable */
5454
}),
5555
requestPromise,
56+
replayRequestPromise,
5657
]);
5758

5859
const eventData = envelopeRequestParser(request);
@@ -72,7 +73,6 @@ sentryTest('captures response size from Content-Length header if available', asy
7273
},
7374
});
7475

75-
const { replayRecordingSnapshots } = await replayRequestPromise;
7676
expect(getReplayPerformanceSpans(replayRecordingSnapshots).filter(span => span.op === 'resource.fetch')).toEqual([
7777
{
7878
data: {
@@ -135,7 +135,7 @@ sentryTest('captures response size without Content-Length header', async ({ getL
135135
const url = await getLocalTestPath({ testDir: __dirname });
136136
await page.goto(url);
137137

138-
const [, request] = await Promise.all([
138+
const [, request, { replayRecordingSnapshots }] = await Promise.all([
139139
page.evaluate(() => {
140140
/* eslint-disable */
141141
fetch('http://localhost:7654/foo').then(() => {
@@ -145,6 +145,7 @@ sentryTest('captures response size without Content-Length header', async ({ getL
145145
/* eslint-enable */
146146
}),
147147
requestPromise,
148+
replayRequestPromise,
148149
]);
149150

150151
const eventData = envelopeRequestParser(request);
@@ -164,7 +165,6 @@ sentryTest('captures response size without Content-Length header', async ({ getL
164165
},
165166
});
166167

167-
const { replayRecordingSnapshots } = await replayRequestPromise;
168168
expect(getReplayPerformanceSpans(replayRecordingSnapshots).filter(span => span.op === 'resource.fetch')).toEqual([
169169
{
170170
data: {
@@ -224,7 +224,7 @@ sentryTest('captures response size from non-text response body', async ({ getLoc
224224
const url = await getLocalTestPath({ testDir: __dirname });
225225
await page.goto(url);
226226

227-
const [, request] = await Promise.all([
227+
const [, request, { replayRecordingSnapshots }] = await Promise.all([
228228
page.evaluate(() => {
229229
/* eslint-disable */
230230
fetch('http://localhost:7654/foo', {
@@ -236,6 +236,7 @@ sentryTest('captures response size from non-text response body', async ({ getLoc
236236
/* eslint-enable */
237237
}),
238238
requestPromise,
239+
replayRequestPromise,
239240
]);
240241

241242
const eventData = envelopeRequestParser(request);
@@ -254,7 +255,6 @@ sentryTest('captures response size from non-text response body', async ({ getLoc
254255
},
255256
});
256257

257-
const { replayRecordingSnapshots } = await replayRequestPromise;
258258
expect(getReplayPerformanceSpans(replayRecordingSnapshots).filter(span => span.op === 'resource.fetch')).toEqual([
259259
{
260260
data: {

0 commit comments

Comments
 (0)