Skip to content

Commit 0c0c844

Browse files
jackfranklinDevtools-frontend LUCI CQ
authored andcommitted
[Gardener]: skip additionals CORS flakey tests
Bug: 381055647 Change-Id: Ia0c003c6dab96e49b2d40654015bc47e728f96bf No-Tree-Checks: True Reviewed-on: https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/6048887 Auto-Submit: Jack Franklin <[email protected]> Reviewed-by: Wolfgang Beyer <[email protected]> Commit-Queue: Wolfgang Beyer <[email protected]>
1 parent 374d104 commit 0c0c844

File tree

2 files changed

+156
-146
lines changed

2 files changed

+156
-146
lines changed

test/e2e/issues/cors-issues_test.ts

Lines changed: 81 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -70,41 +70,45 @@ describe('CORS issues', () => {
7070
await waitForTableFromResourceSectionContents(section.content, expectedTableRows);
7171
});
7272

73-
it('should display credentialed+wildcard CORS issues with the correct affected resources', async () => {
74-
await goToResource('empty.html');
75-
const {target} = getBrowserAndPages();
76-
await target.evaluate(async () => {
77-
try {
78-
const url = new URL('./issues/origin-wildcard.rawresponse', document.location.toString())
79-
.toString()
80-
.replace('localhost', 'devtools.oopif.test');
81-
await fetch(url, {credentials: 'include'});
82-
} catch (e) {
83-
}
84-
});
85-
await navigateToIssuesTab();
86-
await expandIssue();
87-
const issueElement =
88-
await getIssueByTitle('Ensure credentialed requests are not sent to CORS resources with origin wildcards');
89-
assertNotNullOrUndefined(issueElement);
90-
const section = await getResourcesElement('request', issueElement, '.cors-issue-affected-resource-label');
91-
const text = await section.label.evaluate(el => el.textContent);
92-
assert.strictEqual(text, '1 request');
93-
await ensureResourceSectionIsExpanded(section);
94-
const expectedTableRows = [
95-
[
96-
'Request',
97-
'Status',
98-
'Preflight Request (if problematic)',
99-
],
100-
[
101-
'origin-wildcard.rawresponse',
102-
'blocked',
103-
'',
104-
],
105-
];
106-
await waitForTableFromResourceSectionContents(section.content, expectedTableRows);
107-
});
73+
// Flakey on Windows only after a recent Chromium roll
74+
it.skipOnPlatforms(
75+
['win32'],
76+
'[crbug.com/381055647] should display credentialed+wildcard CORS issues with the correct affected resources',
77+
async () => {
78+
await goToResource('empty.html');
79+
const {target} = getBrowserAndPages();
80+
await target.evaluate(async () => {
81+
try {
82+
const url = new URL('./issues/origin-wildcard.rawresponse', document.location.toString())
83+
.toString()
84+
.replace('localhost', 'devtools.oopif.test');
85+
await fetch(url, {credentials: 'include'});
86+
} catch (e) {
87+
}
88+
});
89+
await navigateToIssuesTab();
90+
await expandIssue();
91+
const issueElement =
92+
await getIssueByTitle('Ensure credentialed requests are not sent to CORS resources with origin wildcards');
93+
assertNotNullOrUndefined(issueElement);
94+
const section = await getResourcesElement('request', issueElement, '.cors-issue-affected-resource-label');
95+
const text = await section.label.evaluate(el => el.textContent);
96+
assert.strictEqual(text, '1 request');
97+
await ensureResourceSectionIsExpanded(section);
98+
const expectedTableRows = [
99+
[
100+
'Request',
101+
'Status',
102+
'Preflight Request (if problematic)',
103+
],
104+
[
105+
'origin-wildcard.rawresponse',
106+
'blocked',
107+
'',
108+
],
109+
];
110+
await waitForTableFromResourceSectionContents(section.content, expectedTableRows);
111+
});
108112

109113
it('should display invalid CORS preflight response codes with the correct affected resources', async () => {
110114
await goToResource('empty.html');
@@ -313,46 +317,50 @@ describe('CORS issues', () => {
313317
await waitForTableFromResourceSectionContents(section.content, expectedTableRows);
314318
});
315319

316-
it('should display CORS requests using disallowed headers with the correct affected resources', async () => {
317-
await goToResource('empty.html');
318-
const {target} = getBrowserAndPages();
319-
await target.evaluate(async () => {
320-
try {
321-
// We can re-use `method-disallowed.rawresponse` for this test.
322-
const url = new URL('./issues/method-disallowed.rawresponse', document.location.toString())
323-
.toString()
324-
.replace('localhost', 'devtools.oopif.test');
325-
await fetch(url, {
326-
headers: {'X-Foo': 'bar'},
320+
// Flakey on Windows only after a recent Chromium roll
321+
it.skipOnPlatforms(
322+
['win32'],
323+
'[crbug.com/381055647] should display CORS requests using disallowed headers with the correct affected resources',
324+
async () => {
325+
await goToResource('empty.html');
326+
const {target} = getBrowserAndPages();
327+
await target.evaluate(async () => {
328+
try {
329+
// We can re-use `method-disallowed.rawresponse` for this test.
330+
const url = new URL('./issues/method-disallowed.rawresponse', document.location.toString())
331+
.toString()
332+
.replace('localhost', 'devtools.oopif.test');
333+
await fetch(url, {
334+
headers: {'X-Foo': 'bar'},
335+
});
336+
} catch (e) {
337+
}
327338
});
328-
} catch (e) {
329-
}
330-
});
331-
await navigateToIssuesTab();
332-
await expandIssue();
333-
const issueElement = await getIssueByTitle('Ensure CORS request includes only allowed headers');
334-
assertNotNullOrUndefined(issueElement);
335-
const section = await getResourcesElement('request', issueElement, '.cors-issue-affected-resource-label');
336-
const text = await section.label.evaluate(el => el.textContent);
337-
assert.strictEqual(text, '1 request');
338-
await ensureResourceSectionIsExpanded(section);
339+
await navigateToIssuesTab();
340+
await expandIssue();
341+
const issueElement = await getIssueByTitle('Ensure CORS request includes only allowed headers');
342+
assertNotNullOrUndefined(issueElement);
343+
const section = await getResourcesElement('request', issueElement, '.cors-issue-affected-resource-label');
344+
const text = await section.label.evaluate(el => el.textContent);
345+
assert.strictEqual(text, '1 request');
346+
await ensureResourceSectionIsExpanded(section);
339347

340-
const expectedTableRows = [
341-
[
342-
'Request',
343-
'Status',
344-
'Preflight Request',
345-
'Disallowed Request Header',
346-
],
347-
[
348-
'method-disallowed.rawresponse',
349-
'blocked',
350-
'method-disallowed.rawresponse',
351-
'x-foo',
352-
],
353-
];
354-
await waitForTableFromResourceSectionContents(section.content, expectedTableRows);
355-
});
348+
const expectedTableRows = [
349+
[
350+
'Request',
351+
'Status',
352+
'Preflight Request',
353+
'Disallowed Request Header',
354+
],
355+
[
356+
'method-disallowed.rawresponse',
357+
'blocked',
358+
'method-disallowed.rawresponse',
359+
'x-foo',
360+
],
361+
];
362+
await waitForTableFromResourceSectionContents(section.content, expectedTableRows);
363+
});
356364

357365
it('should display CORS requests redirecting to credentialed URLs', async () => {
358366
await goToResource('empty.html');

test/e2e/issues/cors-private-network-issues_test.ts

Lines changed: 75 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -166,82 +166,84 @@ describe('Cors Private Network issue', () => {
166166
await waitForTableFromResourceSectionContents(section.content, expectedTableRows);
167167
});
168168

169-
it('should display correct information for preflight request errors', async () => {
170-
await navigateToIssuesTab();
171-
const {frontend} = getBrowserAndPages();
172-
frontend.evaluate(() => {
173-
const issue = {
174-
code: 'CorsIssue',
175-
details: {
176-
corsIssueDetails: {
177-
clientSecurityState: {
178-
initiatorIsSecureContext: true,
179-
initiatorIPAddressSpace: 'Public',
180-
privateNetworkRequestPolicy: 'PreflightBlock',
169+
// Flakey on Windows only after a recent Chromium roll
170+
it.skipOnPlatforms(
171+
['win32'], '[crbug.com/381055647] should display correct information for preflight request errors', async () => {
172+
await navigateToIssuesTab();
173+
const {frontend} = getBrowserAndPages();
174+
frontend.evaluate(() => {
175+
const issue = {
176+
code: 'CorsIssue',
177+
details: {
178+
corsIssueDetails: {
179+
clientSecurityState: {
180+
initiatorIsSecureContext: true,
181+
initiatorIPAddressSpace: 'Public',
182+
privateNetworkRequestPolicy: 'PreflightBlock',
183+
},
184+
corsErrorStatus: {corsError: 'PreflightMissingAllowPrivateNetwork', failedParameter: ''},
185+
isWarning: false,
186+
request: {requestId: 'request-1', url: 'http://localhost/'},
187+
resourceIPAddressSpace: 'Local',
188+
},
181189
},
182-
corsErrorStatus: {corsError: 'PreflightMissingAllowPrivateNetwork', failedParameter: ''},
183-
isWarning: false,
184-
request: {requestId: 'request-1', url: 'http://localhost/'},
185-
resourceIPAddressSpace: 'Local',
186-
},
187-
},
188-
};
189-
// @ts-ignore
190-
window.addIssueForTest(issue);
191-
const issue2 = {
192-
code: 'CorsIssue',
193-
details: {
194-
corsIssueDetails: {
195-
clientSecurityState: {
196-
initiatorIsSecureContext: true,
197-
initiatorIPAddressSpace: 'Public',
198-
privateNetworkRequestPolicy: 'PreflightBlock',
190+
};
191+
// @ts-ignore
192+
window.addIssueForTest(issue);
193+
const issue2 = {
194+
code: 'CorsIssue',
195+
details: {
196+
corsIssueDetails: {
197+
clientSecurityState: {
198+
initiatorIsSecureContext: true,
199+
initiatorIPAddressSpace: 'Public',
200+
privateNetworkRequestPolicy: 'PreflightBlock',
201+
},
202+
corsErrorStatus: {corsError: 'PreflightInvalidAllowPrivateNetwork', failedParameter: 'shouldBeTrue'},
203+
isWarning: false,
204+
request: {requestId: 'request-1', url: 'http://example.com/'},
205+
resourceIPAddressSpace: 'Local',
206+
},
199207
},
200-
corsErrorStatus: {corsError: 'PreflightInvalidAllowPrivateNetwork', failedParameter: 'shouldBeTrue'},
201-
isWarning: false,
202-
request: {requestId: 'request-1', url: 'http://example.com/'},
203-
resourceIPAddressSpace: 'Local',
204-
},
205-
},
206-
};
207-
// @ts-ignore
208-
window.addIssueForTest(issue2);
209-
});
208+
};
209+
// @ts-ignore
210+
window.addIssueForTest(issue2);
211+
});
210212

211-
await expandIssue();
212-
const issueElement =
213-
await getIssueByTitle('Ensure private network requests are only made to resources that allow them');
214-
assertNotNullOrUndefined(issueElement);
215-
const section = await getResourcesElement('2 requests', issueElement, '.cors-issue-affected-resource-label');
216-
await ensureResourceSectionIsExpanded(section);
217-
const expectedTableRows = [
218-
[
219-
'Request',
220-
'Status',
221-
'Preflight Request',
222-
'Invalid Value (if available)',
223-
'Initiator Address',
224-
'Initiator Context',
225-
],
226-
[
227-
'localhost/',
228-
'blocked',
229-
'localhost/',
230-
'',
231-
'Public',
232-
'secure',
233-
],
234-
[
235-
'example.com/',
236-
'blocked',
237-
'example.com/',
238-
'shouldBeTrue',
239-
'Public',
240-
'secure',
241-
],
242-
];
243-
await waitForTableFromResourceSectionContents(section.content, expectedTableRows);
244-
});
213+
await expandIssue();
214+
const issueElement =
215+
await getIssueByTitle('Ensure private network requests are only made to resources that allow them');
216+
assertNotNullOrUndefined(issueElement);
217+
const section = await getResourcesElement('2 requests', issueElement, '.cors-issue-affected-resource-label');
218+
await ensureResourceSectionIsExpanded(section);
219+
const expectedTableRows = [
220+
[
221+
'Request',
222+
'Status',
223+
'Preflight Request',
224+
'Invalid Value (if available)',
225+
'Initiator Address',
226+
'Initiator Context',
227+
],
228+
[
229+
'localhost/',
230+
'blocked',
231+
'localhost/',
232+
'',
233+
'Public',
234+
'secure',
235+
],
236+
[
237+
'example.com/',
238+
'blocked',
239+
'example.com/',
240+
'shouldBeTrue',
241+
'Public',
242+
'secure',
243+
],
244+
];
245+
await waitForTableFromResourceSectionContents(section.content, expectedTableRows);
246+
});
245247

246248
it('should display correct information for failed preflight requests', async () => {
247249
await navigateToIssuesTab();

0 commit comments

Comments
 (0)