Skip to content
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

Use the new head{-less,-full} mode for Chrome #1281

Merged
merged 8 commits into from
Jun 12, 2023
Merged

Conversation

macbre
Copy link
Owner

@macbre macbre commented Jun 9, 2023

@macbre macbre enabled auto-merge (squash) June 9, 2023 18:20
@macbre macbre marked this pull request as draft June 9, 2023 18:24
auto-merge was automatically disabled June 9, 2023 18:24

Pull request was converted to draft

@macbre
Copy link
Owner Author

macbre commented Jun 9, 2023

In the new headless mode phantomas now fetches the favicon.ico resource.

+   Object {
+     "size": 319,
+     "type": "html",
+     "url": "http://127.0.0.1:8888/favicon.ico",
+   },

That behaviour makes it behave more like a browser, but causes tests to fail massively:

Test Suites: 1 failed, 13 passed, 14 total
Tests:       44 failed, 4 skipped, 446 passed, 494 total

The default 404 response is served as an HTML which skews our asserted metrics.

$ curl 0.0.0.0:8888/favicon.ico -I
HTTP/1.1 204 No Content
Date: Fri, 09 Jun 2023 18:41:05 GMT
Connection: keep-alive
Server: nginx
Comment on lines +22 to +25
# no content for the favicon (the default 404 response is treated as HTML)
location /favicon.ico {
return 204;
}
Copy link
Owner Author

Choose a reason for hiding this comment

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

This will skip including the /favicon.ico response in the gzipRequests and htmlCount metrics.

offenders:
requests:
- { url: "http://127.0.0.1:8888/browser-caching.html", type: "html", size: 517 }
- { url: "http://127.0.0.1:8888/static/jquery-2.1.1.min.js", type: "js", size: 29734 }
- { url: "http://127.0.0.1:8888/favicon.ico", type: "other", size: 103 }
Copy link
Owner Author

Choose a reason for hiding this comment

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

Here's the cause of all these increased requests expected values.

@macbre macbre marked this pull request as ready for review June 12, 2023 12:44
@macbre macbre merged commit f4fe953 into devel Jun 12, 2023
12 checks passed
@macbre macbre deleted the use/headless-new branch June 12, 2023 12:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Pass headless: "new" to puppeteer.launch()
1 participant