Repository navigation
fix(e2e): ignore Chromium background CONNECTs in the certificate probe - #1933
Conversation
The probe's proxy asserts that every tunnel it sees targets the fixture, but Chromium's own component updater reaches the configured session proxy while the probe is installed. On a cold CI runner that CONNECT arrives at an unrelated moment — a gvt1.com CDN host in the failing run — and the assertion fired through the probe's uncaughtException path even though every probe step had already been logged green. A CONNECT for any host but the fixture is now refused with 502 and never counted, so `tunnels` keeps measuring fixture traffic only, and a self-check asserts that refusal instead of relying on the runner staying quiet.
muzimu217
left a comment
There was a problem hiding this comment.
Independent confirmation of the diagnosis: I reached the same root cause from the run logs before seeing this PR, so the analysis holds from two directions.
The evidence lines up exactly. 49430abbd (00:58Z) failed with actual: 'rr2---sn-2ovgq5-cc.gvt1.com' against expected: 'localhost', and the earlier hang runs (90226c5b4, f34d36a27, c9e6f055a) are plausibly the same defect wearing a different mask: the assertion throws inside the proxy's connect handler, the foreign client is never answered, and Electron's main process does not exit on that uncaught exception, so the probe's pending promise never settles and the harness kills it at 65 s. That also explains why 067a13a30 (01:09Z) went fully green — the job is flaky, not permanently broken, and it only turns red when the component updater happens to fire during the probe.
Two implementation notes, both in this PR's favour:
- Replying
502 Bad Gatewayis better than destroying the socket. Chromium can tell a refused tunnel from a reset, and the probe's own request path never sees an ambiguous EOF. - The regression test is the right shape: it drives a real
CONNECT rr2.example.invalid:443through the proxy and asserts both the 502 andtunnels === 0, which pins the two things that were wrong — answering foreign tunnels and counting them. That is stronger than only fixing the handler.
One thing worth adding to the PR body: the hang shape. If the job still fails with provider client certificate E2E hung and was killed by SIGKILL after 65s after this lands, that would mean the hang has a second cause and the assertion fix was necessary but not sufficient. Given the analysis above I expect it to cover both, but naming it makes the next red run easy to classify.
Problem
Trusted extensions Electron E2E→Run provider optional client certificate E2Eis red onmain, so every open PR inherits the failure:main467bc51main49430abmainc9e6f05mainf34d36aThe fixture proxy asserted that every tunnel it sees targets the fixture:
Chromium's own component updater also reaches the configured session proxy. On a cold CI profile one of those CONNECTs targets a gvt1.com CDN host (
rr1---sn-2ovgq5-5m.gvt1.comin the failing run) at an unrelated moment, so the assertion fired through the probe's uncaught-exception path even though every probe step had already logged green. The runner's own traffic is not the request under test.Change
502 Bad Gatewayand never counted, sotunnelskeeps measuring fixture traffic only. The proxy-authorization assertion moves after that check, so background traffic cannot trip it either.CONNECT rr2.example.invalid:443must return 502 and leavetunnelsat 0, instead of relying on the runner staying quiet.The probe's own scenarios are untouched.
Verification
node scripts/e2e-provider-client-certificate.mjs→provider client certificate E2E passed(Windows, Electron 43, local run).067a13a3in run 40613349659 (Trusted extensions Electron E2E→ success, certificate step success), wheremainat 467bc51/49430abbd fails the same step.This is extracted from #1930 (its head commit
067a13a3, same tree, same message) somaincan go green on its own: #1932 only inherits the failure and needs this onmainto rebase onto.