Skip to content

Commit 5e7efe3

Browse files
committed
fix test flakiness
1 parent b845030 commit 5e7efe3

File tree

3 files changed

+27
-21
lines changed
  • dev-packages/browser-integration-tests/suites/profiling

3 files changed

+27
-21
lines changed

dev-packages/browser-integration-tests/suites/profiling/legacyMode/test.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,16 @@ sentryTest('sends profile envelope in legacy mode', async ({ page, getLocalTestU
7373
expect(profile.frames.length).toBeGreaterThan(0);
7474
for (const frame of profile.frames) {
7575
expect(frame).toHaveProperty('function');
76-
expect(frame).toHaveProperty('abs_path');
77-
expect(frame).toHaveProperty('lineno');
78-
expect(frame).toHaveProperty('colno');
79-
8076
expect(typeof frame.function).toBe('string');
81-
expect(typeof frame.abs_path).toBe('string');
82-
expect(typeof frame.lineno).toBe('number');
83-
expect(typeof frame.colno).toBe('number');
77+
78+
if (frame.function !== 'fetch' && frame.function !== 'setTimeout') {
79+
expect(frame).toHaveProperty('abs_path');
80+
expect(frame).toHaveProperty('lineno');
81+
expect(frame).toHaveProperty('colno');
82+
expect(typeof frame.abs_path).toBe('string');
83+
expect(typeof frame.lineno).toBe('number');
84+
expect(typeof frame.colno).toBe('number');
85+
}
8486
}
8587

8688
const functionNames = profile.frames.map(frame => frame.function).filter(name => name !== '');

dev-packages/browser-integration-tests/suites/profiling/traceLifecycleMode_multiple-chunks/test.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -110,14 +110,16 @@ sentryTest(
110110
expect(profile1.frames.length).toBeGreaterThan(0);
111111
for (const frame of profile1.frames) {
112112
expect(frame).toHaveProperty('function');
113-
expect(frame).toHaveProperty('abs_path');
114-
expect(frame).toHaveProperty('lineno');
115-
expect(frame).toHaveProperty('colno');
116-
117113
expect(typeof frame.function).toBe('string');
118-
expect(typeof frame.abs_path).toBe('string');
119-
expect(typeof frame.lineno).toBe('number');
120-
expect(typeof frame.colno).toBe('number');
114+
115+
if (frame.function !== 'fetch' && frame.function !== 'setTimeout') {
116+
expect(frame).toHaveProperty('abs_path');
117+
expect(frame).toHaveProperty('lineno');
118+
expect(frame).toHaveProperty('colno');
119+
expect(typeof frame.abs_path).toBe('string');
120+
expect(typeof frame.lineno).toBe('number');
121+
expect(typeof frame.colno).toBe('number');
122+
}
121123
}
122124

123125
const functionNames = profile1.frames.map(frame => frame.function).filter(name => name !== '');

dev-packages/browser-integration-tests/suites/profiling/traceLifecycleMode_overlapping-spans/test.ts

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -112,14 +112,16 @@ sentryTest(
112112
expect(profile.frames.length).toBeGreaterThan(0);
113113
for (const frame of profile.frames) {
114114
expect(frame).toHaveProperty('function');
115-
expect(frame).toHaveProperty('abs_path');
116-
expect(frame).toHaveProperty('lineno');
117-
expect(frame).toHaveProperty('colno');
118-
119115
expect(typeof frame.function).toBe('string');
120-
expect(typeof frame.abs_path).toBe('string');
121-
expect(typeof frame.lineno).toBe('number');
122-
expect(typeof frame.colno).toBe('number');
116+
117+
if (frame.function !== 'fetch' && frame.function !== 'setTimeout') {
118+
expect(frame).toHaveProperty('abs_path');
119+
expect(frame).toHaveProperty('lineno');
120+
expect(frame).toHaveProperty('colno');
121+
expect(typeof frame.abs_path).toBe('string');
122+
expect(typeof frame.lineno).toBe('number');
123+
expect(typeof frame.colno).toBe('number');
124+
}
123125
}
124126

125127
const functionNames = profile.frames.map(frame => frame.function).filter(name => name !== '');

0 commit comments

Comments
 (0)