Skip to content

fix(har timing): record connect timing for proxied connections#32855

Merged
Skn0tt merged 4 commits into
microsoft:mainfrom
Skn0tt:http-proxy-har-timing-connect
Oct 7, 2024
Merged

fix(har timing): record connect timing for proxied connections#32855
Skn0tt merged 4 commits into
microsoft:mainfrom
Skn0tt:http-proxy-har-timing-connect

Conversation

@Skn0tt

@Skn0tt Skn0tt commented Sep 27, 2024

Copy link
Copy Markdown
Member

Fixes a bug discovered in #32647. When using http proxy, the connect event isn't emitted so we don't populate tcpConnectionAt. The updated version of https-proxy-agent emits a proxyConnect as a replacement, so this PR updates and listens to that event.
For socks proxies, the on("socket") event is emitted once the SOCKS connection is established, which is the equivalent of having a TCP connection available.

@Skn0tt Skn0tt self-assigned this Sep 27, 2024
@Skn0tt Skn0tt requested a review from dgozman September 27, 2024 12:27
@Skn0tt Skn0tt changed the title fix(har timing): record 'connect' timing for http proxy fix(har timing): record 'connect' timing for proxied connections Sep 27, 2024
@Skn0tt Skn0tt changed the title fix(har timing): record 'connect' timing for proxied connections fix(har timing): record connect timing for proxied connections Sep 27, 2024
@github-actions

This comment has been minimized.

Comment thread packages/playwright-core/src/server/fetch.ts Outdated
Skn0tt and others added 2 commits September 27, 2024 14:47
Co-authored-by: Max Schmitt <max@schmitt.mx>
Signed-off-by: Simon Knott <info@simonknott.de>
@github-actions

This comment has been minimized.

@github-actions

Copy link
Copy Markdown
Contributor

Test results for "tests 1"

1 flaky ⚠️ [chromium] › components/splitView.spec.tsx:35:5 › should render sidebar first

36416 passed, 757 skipped
✔️✔️✔️

Merge workflow run.

@dgozman

dgozman commented Sep 27, 2024

Copy link
Copy Markdown
Collaborator

Do we have to upgrade the deps? I am always wary of introducing regressions.

@Skn0tt

Skn0tt commented Sep 27, 2024

Copy link
Copy Markdown
Member Author

For SOCKS proxy we don't, but for HTTP proxy yes. The proxyConnect event was only added in 6.1.0 and without it we have no way of knowing when the proxy started the connection.

If we don't want to update, another alternative would be leave things as is for the HTTP proxy and set connect: -1.

@Skn0tt

Skn0tt commented Oct 7, 2024

Copy link
Copy Markdown
Member Author

Could you give this another look @dgozman?

@Skn0tt Skn0tt merged commit de4a4d1 into microsoft:main Oct 7, 2024
Skn0tt added a commit that referenced this pull request Oct 8, 2024
…ons" (#32989)

Reverts #32855. This broke two tests on main, and we
don't yet know how to fix it other than downgrading.
Skn0tt added a commit that referenced this pull request Oct 8, 2024
…ns" (#32855) (#33003)

This reapplies what we reverted in
#32989.

Max and me debugged this, and found that the test failures come from
SOCKS proxy now preferring IPv6 over IPv4. We've updated the tests and
made sure that this doesn't mask any breaking change.

I'm enabling CQ1 to make sure we don't oversee any other CI failures.
dgozman added a commit to dgozman/playwright that referenced this pull request Jan 29, 2025
dgozman added a commit that referenced this pull request Jan 29, 2025
dgozman added a commit to dgozman/playwright that referenced this pull request Jan 29, 2025
dgozman added a commit that referenced this pull request Jan 29, 2025
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.

3 participants