Skip to content

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
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
Contributor

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
Contributor

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
Contributor

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.

<link rel="preconnect" href="http://localhost:10503" crossorigin="anonymous" />
<!-- 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
Contributor

Choose a reason for hiding this comment

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

🍃 🔥 💨

setTimeout(() => {
// load another origin
fetch('http://localhost:10503/preload.html');
// fetch('http://localhost:10503/preload.html');
Copy link
Contributor

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