Skip to content

tests(smoke): remove external domains from perf-preload #14289

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 8 commits into from
Aug 19, 2022

Conversation

connorjclark
Copy link
Collaborator

@connorjclark connorjclark commented Aug 13, 2022

This PR removes dependencies on external domains (google font domains) for the perf-preload smoke test. By request of @exterkamp :)

I needed to introduce a third static server to pull off a 1:1 transition, so in the process I also cleaned up that code a bit.

@connorjclark connorjclark requested a review from a team as a code owner August 13, 2022 01:35
@connorjclark connorjclark requested review from adamraine and removed request for a team August 13, 2022 01:35
@@ -12,12 +12,12 @@ document.write('<script src="/perf/level-2.js?warning&delay=500"></script>');
// delay our preconnect-candidates so that they're not assumed to be working already
setTimeout(() => {
// load another origin
fetch('http://localhost:10503/preload.html');
// fetch('http://localhost:10503/preload.html');
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I forgot about this. I think I can just drop this line?

Copy link
Collaborator Author

@connorjclark connorjclark Aug 18, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I can drop this without losing coverage of anything, but @paulirish or @adamraine please lmk if you agree

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I think it should be fine without

@adamraine
Copy link
Member

Shot in the dark, but does this work on devtools? We're skipping it right now in devtools CI.

@connorjclark
Copy link
Collaborator Author

Shot in the dark, but does this work on devtools? We're skipping it right now in devtools CI.

nope
image

serverForOnline._server.on('error', e => console.error(e.code, e));
serverForOffline._server.on('error', e => console.error(e.code, e));
async function createServers() {
const servers = [10200, 10503, 10420].map(port => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you also wanna do the thing where yarn smoke doesn't break if we're already manually running static-server?

maybe catch on the listen and if it rejects we issue a warning but keep going anyway?

Copy link
Collaborator Author

@connorjclark connorjclark Aug 18, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd want something more accurate than that - it should verify that the port is actually our static server not just that something happens to be on the port already.

So I'm punting for this PR, but I'll file an issue. #14302

this.server = new Server();
this.secondaryServer = new Server();
this.server = new Server(0);
this.secondaryServer = new Server(0);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might be nice to use createServers here and expose a this.servers for pptr tests.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

createServers hardcodes the ports, so can't use that here.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's def. room for a better Server refactor here, but I don't wanna get bogged down on it.

<!-- PASS(preconnect): This uses crossorigin correctly -->
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link rel="preconnect" href="http://localhost:10420" crossorigin />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🍃 🔥 💨

@@ -12,12 +12,12 @@ document.write('<script src="/perf/level-2.js?warning&delay=500"></script>');
// delay our preconnect-candidates so that they're not assumed to be working already
setTimeout(() => {
// load another origin
fetch('http://localhost:10503/preload.html');
// fetch('http://localhost:10503/preload.html');
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I think it should be fine without

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants