* docs: the agent links and the command name the repo as it is now Two things were broken for a reader on main, not one. Thirteen links pointed at github.com/feder-cr/AIHawk. GitHub redirects a NAME to the OBJECT that carried it, not to the content: after the September swaps that name belongs to invisible_dots, which has seven wiki pages, so AIHawk/wiki/<page> lands on its wiki Home. It answers 200 with different content, which means a reader who clicks does not find the page and a search engine sees a soft-404 across about 150 indexed URLs. Seven occurrences said `uvx aihawk`, a command that does not exist. One sat in a front-matter description, which is the snippet search engines show, and one in a block meant to be copied: `claude mcp add stealth -- uvx aihawk`. The command is invisible-playwright-mcp, on PyPI at 0.70.16. All eight link targets were checked one by one and resolve to themselves with the page title, no redirect. Three things stay as they are, which only reading them showed. The `pip install invisible-playwright` line matches what this engine's own README teaches for the library, so the page is consistent rather than broken. CHANGELOG.md keeps the old name because a changelog entry says what was true then. And the fixture in scripts/sync_article_pixels.py keeps it because it is the deliberate wrong case, a pixel for ANOTHER repo. One sentence went away instead of being renamed: "shipped inside AIHawk" made sense when AIHawk was the larger product containing the server. The server and the repository are now the same thing, so "shipped inside itself" was circular. (cherry picked from commitd9c8e46dce) * test: the docs name the MCP server's repository and command as they are now feder-cr/AIHawk now leads to an unrelated repository and answers 200, which no link checker reports; `uvx aihawk` does not exist. The README and docs/ are read for both. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * tests: the Fission bench counts the processes that host a site, not every new content process test_same_site_other_port_stays_in_process was red on the e2e of the 0.50.0 commit ("a same-site frame started a process: [13443]"): the bench counted every `-contentproc ... tab` pid, and the engine starts a preallocated content process to refill its pool whenever it gets to it. On Linux the engine names a content process by its remote type (ContentChild::SetProcessName, prctl PR_SET_NAME): "Isolated Web Co" once it hosts a site of strategy 1, "Web Content" while preallocated. Measured on firefox-62: a cross-site frame renames a preallocated process and a new "Web Content" refills the pool; a same-site frame changes neither. The two tests that count processes skip off Linux, where no process carries a name. Unit test with the measured processes: 3 red on the old bench, 3 green here. e2e on firefox-62 (candidate #6, Linux): the bench file 17 passed; the two counting tests 15 of 15 runs green. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * tests: a closed context is checked for the processes of its sites, not for every content process test_closed_contexts_with_a_never_stopping_service_worker_leave_no_process was red on the e2e of the 0.50.0 tag ([2, 2, 2, 5, 5], 5 <= 2). Measured on firefox-62 (Linux), the test's own scenario 10 times with every process named: no "Isolated Web Co" left after any close; the 3 more are "Web Content", the engine's pool of preallocated processes filling up behind the closed contexts (5 runs of 10, new pids each time). Not a leak: the count read the refill. The helper of the bench moves to tests/_processes.py and both tests use it. The context test counts the processes that host a site: at least one while the page is open (or the count proves nothing), none a few seconds after `close` answers (the engine waits for them inside close and kills the ones that stay). Off Linux it skips, as the bench's two counting tests do: no other system names the process. Unit tests (tests/unit/test_processes_counts_sites.py) from the measured processes, the closed-context case included. e2e on firefox-62 (candidate #6, Linux): the context test 10 of 10; run_e2e.py on the two files and the unit test 18 passed. The old counter, same scenario: 5 of 10 runs would fail. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Release 0.50.1: 0.50.0 with the process-counting e2e corrected (0.50.0 never reached the index) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * tests: the same-site control puts its frame in the shown page; CHANGELOG: 0.50.0's entry is 0.50.1's The e2e of #451 saw a new "Isolated Web Co" once after a.test/plain -> a.test/same-site ([10878] -> [10878, 11208]). Not a process of an earlier test: it was created after the first read and only this worker's descendants are counted. It is the top-level navigation: when the old document may enter the back-forward cache, the browsing context is replaced (mReplaceBrowsingContext, dom/ipc/ProcessIsolation.cpp) and the new one may be placed in another process of the same site (dom.ipc.processCount.webIsolated = 4). Measured on firefox-62 (candidate #6, Linux): 0 of 30 runs alone (bfcache on and off), 0 of 57 under 4 workers. The test was written for the frame, so the frame is now added to the page already shown and the top never navigates: 20 of 20 runs green. 0.50.0 never reached the index, so the changelog gate refused its heading; its entry now opens 0.50.1. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * UDP line: the e2e of the proxy for a context, the chain by name, the declared host network, and the wrapper that declares it Squash of the local integration branch (one branch for the candidate): - e2e behind a gateway with coherent UDP (the cost of a gather, two contexts, a proxy without UDP, TURN over TCP of a context, HTTP/3 through the proxy) and one hermetic SOCKS5 gateway helper under them; - the whole UDP chain by name behind a gateway at 130 ms (hermetic); - the declared host network e2e (interfaces, ports, two connections); - the wrapper declares the host network from the session seed (no srflx, no UDP verdict, no host_ip any more); - the integration test follows the declared network and the DoH of the session proxy. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * dev extra: aioquic, so the two HTTP/3 e2e run in the gate instead of being skipped by importorskip Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * tests: networkidle through a served browser whose context routes every request, on a reused page launch_server() plus a stock Playwright client, a context route that aborts image/font/media and continues the rest, a page with sendBeacon, the same font twice, a frame of another site, a worker, redirects, requests the page cancels while a slow route decides, 100 requests at once, and a slow client that answers concurrently (async). Every shape reaches networkidle on firefox-62; one page reused for twelve addresses too. The leak that tf-fetch meets on real sites needs end events the engine loses, which no local page produces: its deterministic red/green is in the core (tests/test_networkidle_on_a_reused_page.py of invisible-core); this file guards the remote path end to end. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * server: the answer to a request the browser has already closed is not an error (Cannot find request), as stock sendMayFail A page cancels requests while a route is deciding (a fetch aborted, an image replaced, an iframe removed, a beacon with its document). The engine takes the request out of its held set at once and the late continue/abort/fulfill meets "Cannot find request". Stock Playwright sends the interception commands as may-fail and tells the client nothing; ours passed the error up, the client kept it as the error of the whole connection and raised it on the NEXT route command, which was then never sent: its request stayed held in the engine, its handler failed too, and so on down the page. Seen on a real news page: six held requests in a row, one a beacon, and networkidle never came. RouteDispatcher._send now treats "Cannot find request" and a closed target as done (still disposed); any other protocol error still reaches the client. Tests: the e2e with a plain handler (no try) on a page that removes an iframe whose requests are held (red before: networkidle never, 25 s; green after; the fetch and image shapes were green before too), and a static guard that every op of RouteDispatcher (abort, continue, fulfill, redirect) goes through _send and that _send swallows exactly those two. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * tests: the stock Playwright client is required by the networkidle e2e (explicit failure, never a skip); the dev extra pins it Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * tests: a page reached over IPv6 gathers host candidates on a machine declared without IPv6 (hermetic, [::1], no proxy) Red on an engine before ddaf867f03: the gathering is empty. Needs the firefox-63 build to run: not run here. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * tests: the names of a proxied session go to DoH through the proxy (written ahead of the engine) E2E for the contract of core-19/motore-18, plus the hermetic helpers they stand on, which are unit-tested now: a hand-written DoH server (h2 and HTTP/1.1), a SOCKS5 gateway and an HTTP proxy that hand the DoH CONNECT to it and tag each query with their name, a connection watcher and a resolver trap. The e2e skip without a binary and cannot be green before the engine that keeps the contract. test_integration follows the core: no host_ip pref, no DNS gate switch, TRR mode 3. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * tests: the TURN name of the udp chain is resolved by the DoH through the proxy, not by the gateway Chain is now a DohGateway (one SOCKS5 gateway in tests/): a CONNECT to the DoH goes to a FakeDoh whose zone is the TURN and the page names, the datagram to TURN_IP goes to the TURN server by address (type 1), a name on the relay or a query to port 53 is dropped and recorded. DnsServer and the type-3 branch are gone. DohGateway takes the Gateway options (UDP relay, rtt) and delays its tunnels by half the round trip like the base gateway. explain() lists what the DoH, the gateway, the TURN server and the page saw, and says why. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * tests: the UDP line e2e need the engine that carries it (firefox-63); a missing websockets, aioquic or h2 is a failure, not a skip The dev extra installs all three; a gate that skips for want of one proves nothing. main's e2e fetches the published engine 62, where the declared network, the DoH through the proxy and the SOCKS5 UDP layer do not exist: those tests skip there and run on the candidate. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * tests: networkidle through a served browser whose context routes every request, on a reused page launch_server() plus a stock Playwright client, a context route that aborts image/font/media and continues the rest, a page with sendBeacon, the same font twice, a frame of another site, a worker, redirects, requests the page cancels while a slow route decides, 100 requests at once, and a slow client that answers concurrently (async). Every shape reaches networkidle on firefox-62; one page reused for twelve addresses too. The leak that tf-fetch meets on real sites needs end events the engine loses, which no local page produces: its deterministic red/green is in the core (tests/test_networkidle_on_a_reused_page.py of invisible-core); this file guards the remote path end to end. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> (cherry picked from commit 47182f0cd85fea08fc45e36f1c91d2d570722f14) (cherry picked from commit e46f2dcf3eb361e6af0fedcdf6e1189f0ac330b6) * server: the answer to a request the browser has already closed is not an error (Cannot find request), as stock sendMayFail A page cancels requests while a route is deciding (a fetch aborted, an image replaced, an iframe removed, a beacon with its document, the favicon of the page a goto just left). The engine takes the request out of its held set at once and the late continue/abort/fulfill meets "Cannot find request" or NS_BINDING_ABORTED. Stock Playwright sends the interception commands as may-fail and tells the client nothing; ours passed the error up, the client kept it as the error of the whole connection and raised it on the NEXT route command, which was then never sent: its request stayed held in the engine, its handler failed too, and so on down the page. Seen on a real news page: six held requests in a row, one a beacon, and networkidle never came. RouteDispatcher._send now treats "Cannot find request" and a closed target as done (still disposed); any other protocol error still reaches the client. Tests: the e2e with a plain handler (no try) on a page that removes an iframe whose requests are held (red before: networkidle never; green after), and a static guard that every op of RouteDispatcher goes through _send and that _send swallows exactly those two. The same defect was found a month earlier by richardpowellus (#351), with the favicon of the previous page: his test is added in the next commit. Co-authored-by: Richard Powell <1369873+richardpowellus@users.noreply.github.com> Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * tests: the stock Playwright client is required by the networkidle e2e (explicit failure, never a skip); the dev extra pins it Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> (cherry picked from commit 91223226f5bba25edff9af0e8b1fd6b5bfea2227) (cherry picked from commit 612b18c02b95e9b5833d62b6595d4a0ff324aac2) * tests: answering a route the next navigation already aborted does not raise (the case of #351: the favicon of the page just left) Sixty sequential routed gotos on a loopback page: 4-12 of them failed on the old server, every failing continue_ being the previous document's favicon, aborted by the next navigation while the route sat with the handler. Red on main (in-process path), green with the fix of RouteDispatcher._send. Co-authored-by: Richard Powell <1369873+richardpowellus@users.noreply.github.com> Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * Release 0.50.1: pin invisible-core 62.64.0; CHANGELOG for the networkidle fixes Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> (cherry picked from commit e63ef8e61ea42e7f8df7c1bde206f3bf86fc18f7) * ci: the list of mandatory suites and its one judge (ci/required-suites.json, scripts/ci_verdict.py) The list names three suites with the least number of tests each must collect (wrapper.e2e.udp 51, wrapper.e2e.doh 8, wrapper.unit.udp 86). ci_verdict.py prints the pytest arguments of a suite and judges its junit: a failure, an error, a skip, too few tests, a required file or node id that did not pass, and a list that lost a suite, a minimum or a test against main are all red, each said with its reason. The leak watcher's file defined a test that skipped on every host; the two resolver-trap tests now exist one per host (collected, never skipped), so the unit suite allows no skip. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * tests: the DoH negative control does not skip where the resolver trap cannot run (Windows reaches the page by a name the system resolves by itself) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * ci: the verdict judge closes the holes a review found (main comparison, complete, exact counts, xunit2, commit, list validation, DoH trap) - main: --main-required compares when the file is there; --main-has-no-list (the gate's declaration that main was checked out and has none) passes declared; a missing path without it is red. A failed download is no longer "main has no list". - complete: every (suite, os) of the list reported a green result, no stranger, one commit, one binary per OS. - exact: every row says whether collected must equal min_tests; the result json carries verdict green|red. - the junit must be xunit2 (classname present, no file/line); the commit is --commit or git HEAD, never GITHUB_SHA; --binary is mandatory and must exist; --seal is read (it carries no sha256 of the binary: said, not compared). - the list is validated by args, judge and complete (exit 2 with the reason); against main also exact, os, tests, marker. - DoH e2e: with INVPW_REQUIRE_TRAP=1 a resolver trap that cannot run or bind is a failure, not a silent skip. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * tests: the DoH prefs follow the new split (the core declares the provider, the engine the state and the excluded names) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * tests: the git identity of the verdict test is a plain word Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * A route answer the engine refuses is the engine's business, whatever its wording The server took one wording ("Cannot find request") of an answer to a closed request as done and passed every other protocol error up to the client. The engine also says "NS_BINDING_ABORTED [nsIInterceptedChannel.resetInterceptionWithURI]" when the channel was cancelled while the answer was on its way: the same event, and the client kept it as the error of the connection and raised it on its next route command. Stock Playwright sends the three interception commands as may-fail and tells the client nothing, whatever the engine says. So does RouteDispatcher._send now: every ProtocolError is swallowed, the route is disposed after it. Tests: the static guard no longer allows a re-raise inside the handlers; a unit test feeds three wordings (red on the old code for two of them). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * wrapper: every context carries the position the core declares for the session The geo step is asked with the session seed (launcher, async_api, the served browser, the default session) and the core's SessionGeo.geolocation_override() (latitude, longitude, accuracy) becomes the standard `geolocation` context option in _default_context_kwargs: the default context, each new_context / new_page and each context of a remote client get Browser.setGeolocationOverride through the existing path (server.py _apply_context_options). A geolocation given by the caller wins; no coordinates, nothing is sent; the permission is never granted here. Tests written ahead: tests/test_the_session_position_reaches_every_context.py. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * wrapper: a proxy given to a context declares its measured UDP exit (udp) in Browser.setContextProxy The core measures where a SOCKS5 proxy's UDP leaves from and the answer is the optional field `udp` of the proxy declaration. The wrapper hands it on: - the launcher, the async launcher and launch_server pass the udp their geo step measured to configure_proxy(udp=), so it reaches Browser.setBrowserProxy; - the server's launch (a client that composed no session) declares the proxy with what the geo step remembered, never coherent without a measurement; - BrowserDispatcher._apply_context_options, the one place new_context(proxy=...) of the sync, async and remote clients ends in, measures the context proxy BEFORE Browser.setContextProxy is sent (the core discovers the TCP exit through it and measures the UDP beside it, once per proxy, cached by endpoint and a hash of the credentials) and the result goes in `udp`. Tests: a recorder in place of the engine, the fake SOCKS5 gateway with a UDP relay and a STUN server only the relay reaches, declared through STEALTHFOX_UDP_STUN_SERVERS. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * wrapper: the STUN servers are a launch parameter kept on the session (udp_stun_servers); the caller never declares udp - InvisiblePlaywright(..., udp_stun_servers=None) (sync and async) and launch_server(..., udp_stun_servers=None) take "ip:port" IPv4 literals (None = the core's two public defaults; a name or a bad port raises ValueError naming the parameter) and keep them on the session. The launch's geo step uses them, and so does every later new_context(proxy=...): the server keeps the list on the browser it launches (the list rides to the server in the launcher's composed prefs like the session seed and is taken out before the profile is written), so the per-context call needs no new parameter. Nothing of it reaches the browser's environment, argv, prefs or pipe (tested). - The proxy command is built by the core's context_proxy_command / launch_proxy_command: the `udp` field is the measurement, never what the caller wrote; configure_proxy(udp=) is gone and the launch's measure reaches Browser.setBrowserProxy through the core's per-proxy memory. - The constructor-signature pin records the new keyword. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * tests: the e2e of the UDP relay hand the core the STUN server its gateway answers (udp_stun_servers), and the dropped-UDP cases expect the new behaviour The core now MEASURES the UDP exit of a SOCKS5 proxy before declaring it; only `coherent` makes the engine send UDP to the relay. A gateway of the tests that is not asked the right way is declared `no` and its e2e would fail for a reason that is not the product's. - _socks_servers: MEASURE_NUMBER (the fake STUN by a number of its own, so the measurement is told apart from the page's STUN_NUMBER), Gateway.measure_servers, silent_udp() (relay granted, STUN never answered -> unmeasured), relay_host on every factory. - _udp_line (new): measure_servers, egress_by_proxy (the TCP exit of each gateway: a context proxy is measured against its own), declared_udp (what the launch measured; absent is not `unmeasured`), one place for every e2e. - test_webrtc_realness: one launch helper behind a gateway; the relay tests, the two-contexts and the TURN-over-TCP tests use the exits of their own gateways; the dropped-UDP case is one helper with three roads (refused: no, another exit: no, never answered: unmeasured) that asserts the declared udp, no srflx, 701, and that the page's UDP never reached the relay. - test_the_whole_udp_chain_by_name_e2e: the chain is told its own TCP exit (it was a documentation address the chain's UDP does not leave from, i.e. `no`) and asserts coherent. - test_the_udp_line_helpers (unit): the real measurement of the core against each gateway and the chain; the helper's list is `ip:port` IPv4 literals the core takes. - ci/required-suites.json: wrapper.e2e.udp 51 -> 53 (two new tests, listed by name). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * tests: HTTP/3 is judged on three visits of one page (h2, h3, h3 with UDP free; h2 three times without), as a retail Firefox reads them Reference: retail 159 Linux, 15 of 15 each way (invisible_WebRTC captures/h3-fallback): with UDP free the first visit is h2 and the second and third h3; with UDP dropped every visit is h2 and the later loads are as fast as the first. - _h3_server: the TCP side speaks HTTP/2 by ALPN (h2 library; HTTP/1.1 only for a client that offers nothing else), carrying Alt-Svc: h3; it answered HTTP/1.1 only, so the first visit could never read h2. One HTML document over TCP and QUIC; tcp_alpn recorded. - test_http3_through_the_proxy_e2e: the retail method (one context, three gotos, a pause of 2 s after each load, nextHopProtocol of the navigation entry) on six roads: no proxy and a SOCKS5 with coherent UDP -> h2,h3,h3 (QUIC through the relay, the server never sees this host); SOCKS5 that refuses UDP / leaves from another address / never answers (the declared udp is asserted) and an HTTP proxy -> h2,h2,h2, no QUIC at the server, no page datagram at the relay, visits 2 and 3 no more than 1.5 s slower than visit 1. An h3 on visit 1 is named as an error. - _udp_line: expected_protocols / judge_visits (the sequence and the judgement, unit-tested). - test_the_h3_line_helpers (unit): the server really negotiates h2, says Alt-Svc, answers the same document over h3; the judge names each mistake. - ci/required-suites.json: wrapper.e2e.udp 53 -> 57 (the http3 file has 6 tests, was 2). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * A keepalive fetch is a request of the page for the client, in a real browser e2e: the page sends a plain fetch, a keepalive fetch (cors and no-cors) and a beacon; the client must hear a `request` for each and an end for each. Measured on the firefox-62 engine: the server received the keepalive fetches and the client heard no `request` for them (stock Playwright's Firefox reports them). Red until the engine attributes the request to its page. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * ci: the no-proxy gather is a required test of wrapper.e2e.udp (58 tests) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * tests: the descriptors of the spawn are asserted by running it, not by reading the core's source test_the_spawn_keeps_the_two_hardwired_descriptors asserted that the source of the core's _spawn_posix contains `pass_fds=(its_read, its_write, 3, 4)`. Core 62.64.0 starts the engine with posix_spawn and file actions, so the words are gone and the test failed on every Linux unit suite although the behaviour is the same (and better). The test now runs the spawn: a parent with nothing open on 3 and 4 and its pipes far from them launches a program that reads fd 3 and answers on fd 4 (the contract of nsRemoteDebuggingPipe.cpp), and the answer must come back and the child must hold no descriptor above 4 of the parent's. Same shape as the core's own test (test_the_pipe_of_the_engine_reaches_its_fixed_descriptors). No skip: the file is already POSIX-only. The other tests of the file do not read source text (checked: no getsource/inspect/read_text left). Ran the parent program on Linux with core 62.64.0 (image tetra-invisible:run1b-final): pong:ping:0. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * tests: the fake DoH of the e2e uses a name that is not HSTS-preloaded (doh.gateway.test at 192.0.2.53), declared through extra_prefs Firefox refuses certificate overrides for HSTS-preloaded/pinned hosts, so a self-signed fake for mozilla.cloudflare-dns.com could never be accepted. The test now declares its own provider (network.trr.uri, network.trr.bootstrapAddr) and counts every connection of the browser, including the background traffic of the default context whose TLS fails by design, at the gateways. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * tests: the chain by name declares the FakeDoh's own provider (doh.gateway.test): the DoH of Mozilla is HSTS-preloaded and takes no override Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * tests: the h3 e2e turn off Firefox's check of third-party roots (a self-signed test server stops HTTP/3 otherwise: measured) The Alt-Svc is learned and the QUIC handshake of validation passes with the override, then Firefox closes the connection itself because the chain ends in a root it does not know, and every visit stays h2. With network.http.http3.disable_when_third_party_roots_found off the three visits read h2, h3, h3 (3 runs of 3, no proxy, on the engine of the first round). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * tests: the ICE server name of a PeerConnection is resolved in the context of its page, by the proxy of that context (red until the resolver carries the OriginAttributes) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * ci: the ICE-name e2e is part of wrapper.e2e.doh (11 tests) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * tests: the first datagram of a PeerConnection does not wait for a UDP association (red on the giro 2 binary: 396 ms) The pool of UDP associations was warmed only in the process of the HTTP connections (the parent); the sockets of the PeerConnections are made in the socket process, which found it empty and made its association from scratch: three answered steps before the first STUN datagram. A gateway that answers every step after 130 ms makes it visible: on the giro 2 binary the first datagram leaves 396 ms after the birth of the PeerConnection. The test asserts it leaves within 250 ms, and that an association was granted before. The gateway of the tests now also keeps the wall-clock origin of its times and the instant of every accepted connection. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * A TURN server over TCP is connected to and waited for, direct and behind SOCKS5 (e2e) A TCP stand-in for a TURN server on this machine's address accepts, reads and closes N ms after the accept; the page asks for a TURN allocation over TCP. A retail Firefox connects, sends the Allocate request and hears 701 when the server closes (accept at 48 ms, 701 and the gathering complete at 850 ms with N=800). The candidate engine never connected: no accept, no bytes, 701 within 9-28 ms with the gathering complete, direct and through the gateway alike. Red on the firefox-63 candidate build; green expected with the engine commit that binds the wildcard of the declared family. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * ci: the warm-pool and the TURN-over-TCP e2e are required in wrapper.e2e.udp (61 tests) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * tests: the gather without a proxy and the ICE-name e2e wait for the engine that carries the UDP line test_the_gather_is_real_without_a_proxy (in wrapper.e2e.udp) had no the_udp_line, unlike the other tests of its file, and the ICE-name e2e (wrapper.e2e.doh) resolves a name through the proxy of a context, which the engine firefox-63 does. On an older engine they skip with the reason; on the candidate (firefox-63-candidate) they run, so the exact lists of ci/required-suites.json are unchanged. The networkidle e2e stays ungated: it needs no proxy and no UDP, and is fixed by the Python of the core and the wrapper on any engine. Review finding 14. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * tests: the declared-network e2e no longer sets variables the engine does not read STEALTHFOX_WEBRTC_PUBLIC_IP and STEALTHFOX_WEBRTC_DISABLE_IPV6 are not read by the engine or the core (the unit test of the declaration bans them in the environment); the e2e set and deleted them and imported _FAKE_EGRESS only for that. Dead setup that said the egress still feeds WebRTC. Review finding 27. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * tests: one helper for the address of this host, computed before any server starts, a host without a default route skips this_host_address() and its two copies connected a UDP socket to 192.0.2.1 and raised OSError on a host with no default route; in the chain it was evaluated as an argument after the TURN server, the resolver and the page were already listening, so the test errored and leaked three listeners instead of skipping. The helper is now tests/_host_address.py (OSError => pytest.skip), the chain asks it first, and the three copies are gone. Review finding 29. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * ProxyEgressNonVerificabile: the docstring says what goes unconfirmed (timezone and locale), not an address The engine no longer declares an egress address (the host network is drawn from the seed); only the timezone and the locale are decided from the egress. Reworded like ProxyEgressDrifted, with a test on the text that fails on the old wording. Review finding 30. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * tests: a context that is the only proxy resolves its names by DoH through it (red while TRR stays mode 0 for context-only proxies, green with engine 9bff9cf8de) A session launched with no proxy, a context made with its own SOCKS5 gateway, a page at a name only the FakeDoh can resolve: the name must be asked to the DoH by that gateway, the page reached by address through it, nothing to the DoH directly and no question about the zone to the resolver of the machine. Review finding 4 (the e2e that was missing). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * ci: the context-only-proxy DoH e2e (wrapper.e2e.doh, 12) and the host-address helper unit tests (wrapper.unit.udp, 97) are required Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * The page dispatcher waits for Page.ready before the page is handed over (needs invisible-core with Lifecycle.wait_for_page_ready) Same defect and fix as in the core's page (see the core commit): a goto sent right after new_page could meet the page's initial about:blank. The pin of invisible-core moves with the core release that carries wait_for_page_ready. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * Pin invisible-core==62.65.0 (a page handed over when the engine says it is ready); changelog The core that carries Lifecycle.wait_for_page_ready is invisible-core 62.65.0 (draft PR invisible_core#238), not on the index yet: the pin check of this push is skipped on purpose (INVISIBLE_PIN_CHECK=skip). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * tests: the stand-in engine of the registry test says Page.ready, as the real one does (the page is handed over on it) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * tests: a context with a proxy resolves by DoH through it and a context without one never uses the DoH; the first navigation of a fresh context never asks the system resolver (written ahead of the engine) The context-only test also asserts that the DoH log holds no name but the proxied context's, that no handshake failed and that the default context's background lookups reach the system resolver (the trap, where it runs). New race test: eight contexts created and navigated back-to-back, a launch-proxy variant, and a proxied context beside one without a proxy. The DoH e2e docstrings follow the per-context rule. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * tests: the DoH of a proxied context when it is slow (2 s per answer) and when it refuses a name once; FakeDoh gains delay_s, delay_names and fail_first (written ahead of the engine) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * tests: the refused-once e2e shortens the DNS negative cache, so it measures a temporary block and not Firefox's 60 s failure cache Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * tests: new_page and a popup are handed over only when the engine says Page.ready (red without the wait in PageDispatcher, green with it) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * ci: the resolver-race and DoH-under-stress e2e (wrapper.e2e.doh, 17) and the FakeDoh levers unit tests (wrapper.unit.udp, 110) are required Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * tests: the refused-once e2e says what it measures and what it does not Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * tests: the engine never reads the host's hosts file, with a proxy or without (MOZ_LOG per process, with a control) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * ci: the hosts-file e2e is required in wrapper.e2e.doh Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * tests: h3 behind a proxy follows the definitive retail (never h3 at visit 1, h3 within 5 visits, h2 every visit without usable UDP) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * A page is built at once and announced when the engine says Page.ready (the wait inside the constructor held a popup's first request behind a page that did not exist yet, and lost its commit and load) - PageDispatcher no longer waits in __init__; wait_until_ready() is called by the adoption between the construction and the announcement (context 'page' event, newPage answer). A detach while waiting ends the wait; a page that is not ready in time is disposed. - The main frame's initializer carries what the lifecycle already knows (url, name, load states), as every other frame's does. - Tests: unit (a popup exists and listens while it waits; what it does before its ready reaches its frame; red on6a60dce) and e2e (a popup of a link, noopener or window.open reaches an in-process and a stock client of a served browser within 2 s, with and without a context route; 15 of 16 red on6a60dce, 16 green). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * tests: the stand-in pages say wait_until_ready; the popup e2e reaches the stock client as the other served tests do Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * tests: the popup reaches the client from another site too (a link, noopener, window.open: 16 more cases, in-process and through a served browser) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * A popup is reported on Page.ready as Playwright's is: no limit and no warning, with the address of the commit that came with the ready - Stock Playwright 1.62 (measured): a 204 or a silent destination gives no page event, one that answers after 4 s gives it at 4 s with the destination already. The adoption of a popup waited 20 s and dropped it with a warning; now only a page a caller asked for (newPage) has the 20 s; a popup waits until the engine says Page.ready, the target goes away, or its context closes (BrowserDispatcher.end_waits_of), and says nothing. - The ready and the commit of the document that made the page ready come in the same turn: the page is announced after a round trip to the engine (settle_events), so the frame reads the destination at the page event (3 of 4 slow popups said about:blank). - In-process the slow popup arrived 0.9 s later than stock: it is the humanised click (1.1 s of pointer movement before the click returns), the popup arrives 4.02 s after the click in both modes. - Tests: unit (limit None for a popup and 20 s for a requested page; a popup with no ready ends with its context and says nothing; the address at the page event is the commit's) red on b09d620; e2e (204 and silent: no event; 1.5 s: url is the destination; 25 s: reported then) in-process and through a served browser: the 25 s ones red onb09d620. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * A download started by a popup that is not announced yet is reported on its opener, as Playwright reports it - Browser.downloadCreated names the tab the download came from. A tab opened for an attachment (a target=_blank link, a window.open) never gets a Page.ready and the engine closes it at once, so it is not among the announced pages and the download was lost: no download event anywhere (a21e1dehad it, on the popup). Playwright's ffBrowser._onDownloadCreated reports it on the opener of a page that is not reported yet; so does this, from the opener recorded when the target was attached (BrowserDispatcher._openers). The abort of the navigation that became the download still goes to the page that owns the frame. - Tests: unit (red onfbceeaf); the e2e of the destinations and of the popup matrix of the fake-web branch (73f1e8d): 16 + 34 cases against the reference measured on stock Playwright 1.62 - onfbceeaf4 of the 16 were red (the download), now 50 of 50 green. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * ci: the page and popup suites of 0.50.1 are required (wrapper.e2e.page 96, wrapper.unit.page 17), wrapper.unit.udp counts 113 after the merge * ci: the drive gate launches through the core (the engine waits for the session's road; bare Playwright never sends it); the declaration test does not resolve an engine * A popup tells its listeners the load it reached before it was announced; an unannounced frame has no address of its own - The popup is announced when the engine says Page.ready, which is when its document commits, so its domcontentloaded and load may be said before the client has the page: page.on('load') registered in the handler of the page event never fired (Playwright's does, measured by the independent run: destinations of 4 s and 25 s). FrameDispatcher.emit records those two states while the page is not announced and PageDispatcher.announce says them again right after the page event, in their order and under one lock; the first time they already set the state wait_for_load_state reads, so it returns at once. Only popups: a requested page is announced as before. - The main frame is created with the address the lifecycle knows, '' if it has committed nothing (an attachment's empty tab), not about:blank: Playwright says '' there. - Tests: unit (the two states after the page event, in order; red on2f153c7); e2e: a listener registered in the handler of the page event hears the load of a slow popup, wait_for_load_state in the handler returns in under 2 s (in-process and a stock client over a served browser, window.open and link). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * tests: the first visit of the h3 e2e is h2 because the fixture has no HTTPS record (the retail read h3 first in 3 sessions of 15); the FakeDoh never serves type 65 and the tests assert it * A popup whose target goes away while its page is being built is announced and closed, not waited for for ever A download's empty tab is closed by the engine within milliseconds; on a loaded machine its page is still being built when the detach arrives. _handle_detach recorded it as early (nobody in _building to tell) and the adoption then waited for a Page.ready that never comes: the popup was never announced (test_popup_destinations_e2e, the download on the opener, failed once in a full suite run). The adoption now looks at the early detaches when it registers the page as waiting. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * A command of the adoption that finds the target's session gone announces and closes the popup, as a detach before the ready does The independent run on a quiet machine lost one link-into-attachment popup in a hundred: the engine closed the tab WHILE the adoption was initializing it, answered 'cannot find session' to Page.setInitScripts, and the popup was discarded with a warning - no page event - where Playwright's is announced and closed. PageDispatcher._build now treats an initialization command that fails because the target or its session is gone (one test: _target_is_gone) as the same case: the page is built, flagged gone_while_building, and the adoption announces it and closes it right after. Test: a fake engine answers 'cannot find session' to each command of the adoption in turn (parametrised): the page event and the close arrive, no warning; red onb05741ffor Page.setInitScripts. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * ci: the page and popup suites count the tests of release/0.50.16200bc2(e2e.page 100, unit.page 24) * ci: test_a_page_that_moves_on_e2e.py is required in wrapper.e2e.page (114): the e2e of the engine fix for a navigation the page overtook * tests: the resolver trap says why it could not bind (the error of the socket) * tests: the helper of the popup destinations does not shadow the browser fixture (ruff F811) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * tests: the resolver trap takes the first loopback address it can bind for port 53 (a hosted runner can hold 127.0.0.1:53) and writes that address in resolv.conf * tests: two connections on one page are judged on the road they take, not on the clock of the machine The test asserted a median of 30-55 ms, the time of a fast machine. On a GitHub runner the same healthy engine takes 67 ms (Windows) and 122 ms (Linux) and the gate was red on both: an absolute time is a verdict on the machine. Every one of the five cold launches is now judged on what the machine cannot change: * the data channel opens and echoes; * each connection gathered a UDP host candidate named by mDNS (a run without UDP is the reserved-port failure: the socket could not bind and the connection fell back to TCP); * the nominated pair, read from the browser's own statistics, is host to host over UDP at both ends (no road through TCP; a succeeded pair means the other connection's mDNS name was resolved); * it opens in less than the responder's first retry (3 s): a name that does not come back opens only at the retry. The time is printed beside the retail window, as a measure. Run on the firefox-63 candidate engine: passes, [38, 39, 39, 73, 77] ms. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * tests: a caller that asks for the ICE in the content process, or for no socket process, gets the srflx through the relay all the same (the engine locks both prefs) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * ci: wrapper.e2e.udp counts 68 (the three ICE rows of test_webrtc_realness: default, content process asked, no socket process asked; the engine locks both prefs) * tests: the popup tests do not fail on the machine's speed (no 2 s limit) A runner with four workers delivered a popup in 2.013 s (the limit of the test was 2 s). The verdict of these tests is that the popup arrives with its address and its load; the wait is generous (30 s) and the check of the time is gone. The wait_for_load_state of the handler is bounded by 8 s. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * tests: the popup tests do not fail on the machine's speed (no 2 s limit) A runner with four workers delivered a popup in 2.013 s (the limit of the test was 2 s). The verdict of these tests is that the popup arrives with its address and its load; the wait is generous (30 s) and the check of the time is gone. The wait_for_load_state of the handler is bounded by 8 s. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * tests: the fixtures that several e2e files share are in conftest.py, not imported from a sibling file (ruff F811, the lint of the tests job) A fixture imported from a twin file and then named as a test argument is a redefinition: 60 F811 in the new tests of the UDP line, the same error that turned the 0.50.1 CI red. The collection does not change: the same 2187 tests (1422 by default), the same setup plan (fixture order and scope per test, compared with --setup-plan before and after). - conftest.py: doh, gateway, trap, watcher, pages (DoH e2e), socks5_tcp_only, local_https_page (WebRTC e2e) and browser (the two-transport fixture of the popup tests). The heavy imports are inside the bodies, so a run without the e2e extras still collects. - _doh_support.py (ZONE, Pages) and _socks_servers.py (Socks5TcpOnly, was _Socks5TcpOnly in test_webrtc_realness.py): the plain code the fixtures need, in support modules, not in a test file. - The twin files keep what is not a test argument (the autouse _hermetic_session and the helpers, imported by name); the sibling files stop importing the fixtures. The four `# noqa: F811` of test_popup_destinations_e2e.py are gone: ruff passes with --ignore-noqa. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * tests: the trap-policy test reads the trap fixture in conftest.py (6b moved it there with the lint of the fixtures) * The adoption of a target is one explicit state machine, proved over every order of the engine's events Four patches of the same race (a detach before the ready, during the build, between the build and the wait, a command answered 'cannot find session') and a fifth the exhaustive test found (a detach while the adoption waits for the main frame of a tab the engine never announced: the wait went on for 20 s and the popup was discarded; this is the order the runner produced for the download popups: 3 of 4 lost). - _Adoption: the single record of a target between its attach and its announcement: state (attached, building, waiting, announced), gone (set by the engine's detach AT ANY MOMENT), page, opener, context. It replaces _adopting, _building, _openers and _detached_early. - Every wait of the adoption looks at gone (the main-frame wait polls it), every state change is one method (_enter_building, _enter_waiting, _enter_announced), a command that finds the session gone ends in the same place as a detach, a closing context takes away every adoption of it in any state (end_waits_of). - Invariant: an attached target that is not a page a caller asked for gives the client exactly one page event, at its ready or at its disappearance (and its close right after), unless its context closed first. - Test: test_every_order_of_the_events_of_a_popup_gives_one_page_event stops the adoption thread at six points of its own and delivers the engine's events (frame, commit, ready, detach, in every prefix) at every one of the eight moments: 635 orders, none sampled. Mutation check: without the gone-aware main-frame wait 24 orders break, without the tolerance of the command error 42, without the close after the page 374; without the early-gone check of _enter_waiting the adoption hangs. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * The adoption keeps a short trace per target and writes it where a popup is dropped or fails The log of a CI run says that a popup was not announced and not in which order the engine's events came. Each target in flight keeps (in memory, at most 60 short strings, nothing afterwards) what the engine said (frame, commit, ready, detach) and what the adoption did (building, waiting, announced), with the milliseconds since the attach. It is written in the warning of a failed adoption, in the error the newPage waiter gets, in the timeout of a requested page, and in browser._dropped (the last 16 targets dropped with their context). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * The WebGL determinism test says why the browser could not make a context One run in 31 of the e2e on a loaded Linux runner failed this test with "reason='gl null'" and nothing else: getContext('webgl') gave the page null. The browser says why in the `webglcontextcreationerror` event (statusMessage: the failure list, e.g. "tryNativeGL (FEATURE_FAILURE_EGL_LOAD_3)", "Initializing WebGL backbuffer failed.", "GL error 0x505 occurred during OpenGL context initialization"), and each of the paths that can produce null on Linux in our engine writes a different one (library not loaded, display not initialised, context not created, GL out of memory, backbuffer not allocated). The test reads the event and puts it in the assertion, and tries webgl2 on a fresh canvas (the old canvas already had the failed type). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * tests: the same-site control of the Fission bench measures the frame, not the process pool The control counted the processes that host a site between two reads, with the default pool of three preallocated content processes: a pool process handed to a site after the first read moved the count without the frame having asked for anything ([63248] -> [63248, 63386] on a four-worker runner; the same family as5402da4,ff2123eandfef0bc5). The control now runs in a browser with dom.ipc.processPrelaunch.fission.number at 0, where a process of a site appears only because a site needed one, and says so if the page of the site has no process to compare with. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * tests: the DoH e2e declare the exit the UDP measurement asks for; the gateway's page is reached by an address; e2e.udp is split in e2e.udp and e2e.web; the trap says who holds port 53 * tests: two connections on one page may nominate a peer-reflexive end; the road is what is judged On the round 3 gate (Linux, run 43164943499) the nominated pair was host to prflx: the other connection's mDNS name was not resolved yet when its connectivity check arrived, and the address the check came from is learned as peer-reflexive. That is the same direct local road, so the test accepts host or prflx at each end, over UDP at both ends, and refuses what is a different road: a relay, a server-reflexive candidate (through the proxy or the network), or TCP. The open time stays judged against the responder's first retry, and printed beside the retail window. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * tests: a port 53 that cannot be bound is redirected from 127.0.0.2 to a free port (iptables nat OUTPUT), the rules go with the trap * tests: the resolver trap ends its threads before it closes its sockets, so its port is free for the next test (no more "Address already in use" on 127.0.0.1-8:53) The answering threads sit in accept()/recvfrom(); on Linux a close() from another thread does not wake them and the kernel keeps the socket bound until the call returns, which it never did: every trap left its address taken, and the eighth trap of a run found all eight taken (reproduced here in a container: 19 DoH e2e, the 6 tests after the 8th trap are errors; alone, the same file passes). The loops now wake every 0.2 s to look at a flag; the teardown sets it, joins the threads, and then closes the sockets. - test_a_closed_trap_gives_its_port_back_at_once (wrapper.unit.udp 139 -> 140): a trap on a free port is closed and a second one on the same port must bind 127.0.0.1 again; red on the old code on Linux. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * The download of a tab that is not announced yet is said after the page event of the tab The tab opened for an attachment is announced when the engine takes it away, a few milliseconds after it says the download; the download (reported on the opener) went to the client first, the popup after: the order the other way round from Playwright's, and a client that read the popup the moment the download arrived found none on a one-CPU machine (the 4 download cases of GitHub, 3 of 4 red; the same on a one-CPU container: 1, 0, 2 of 50 ona90dadc). The adoption holds the download on its record and says it right after the page event (never lost: also when the tab is dropped or fails). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * tests: the discovery of the exit of a context stays covered now that the DoH e2e declare it away The DoH e2e declare the exit the core asks for (their subject is the roads of the browser). The discovery itself keeps its own test: it goes through the gateway of the context, by name, only to the services of the core, never through another context's gateway, and a gateway that refuses them never makes the measurement say coherent. wrapper.unit.udp 140 -> 142. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * tests: the iptables fallback of the resolver trap is gone (the cause was the trap's own threads holding the port, fixed in4933f8c); wrapper.unit.udp 141 * tests: the realness check without a real proxy - six declared exits, the values a page reads, and the judges The manual check drove the browser through a paid proxy and compared what a page reads with the proxy's exit. This is the same check against a local SOCKS5 gateway that declares its exit: a local site that tells a connection the gateway opened from a direct one, FakeDoh for the names, and the core's own geo database as the truth for the zone and the country. * test_realness_behind_a_declared_exit_e2e.py: one launch per exit (six, in six countries), read by five tests (the address a site sees and no connection past the gateway; nothing of the host in the WebRTC candidates and SDP; the names reach the gateway and not the system resolver; the zone, the offsets read two ways and a worker; the language of the page, a worker and the Accept-Language header against the exit's country), plus the vendored detection page loaded behind the gateway. * _realness_support.py: the exits, ExitGateway (remembers the ports of the connections it opened), the site, the reads, the judges. * test_the_realness_helpers.py: the judges and the gateway/site correlation held to golden reads, no browser. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * ci: the realness e2e (32) is a required suite, its helpers (24) join wrapper.unit.udp (165) * A download is taken with the record's removal in one step, and the opener of a target not announced is remembered: no step of the adoption can lose it The failure branch said the pending downloads BEFORE it removed the record: a download created between the two found the record, queued on it, and nobody said it. Taking the pending downloads and removing the record are now one step under the browser's lock, in the three branches (announced, dropped with its context, failed); the opener of a target that ended without being announced is kept for the last 16 targets, so a download that comes after the record is gone is still said, on the opener. Test: the download is forced into the gap of the failing adoption (red on65f7580: said 0 times, now once). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * ci: wrapper.unit.page counts the popup-order test and the changed page tests of release/0.50.18049df3(32) * wrapper: the opener kept for the downloads of a target whose adoption failed lives until the engine detaches the target, and none is made for a target already detached; unit tests (unit.page 34) * tests: the first datagram of a PeerConnection is judged with the session's UDP declared coherent, and the core's own probe is not counted as the engine's association The giro 3 gate was red on this test: with a fixed time zone the core does not discover the TCP exit, so it cannot compare it with the UDP probe's mapped address and declares the UDP of the proxy unmeasured; the engine then treats the proxy as a router that drops UDP, asks it for no association and sends nothing (measured on the giro 3 Linux binary: the gateway saw ONE ASSOCIATE for the whole test, the core's probe; the layer was pushed on the PC's socket and what was sent was dropped). The test gives the core the gateway's TCP exit as every e2e of the line does (egress_by_proxy), and it no longer counts the probe's association (the first of the gateway, made before the browser exists) as one that was ready before the PeerConnection - it passed an engine that asked for none. Green on the giro 3 Linux binary (run 43164943499). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * tests: the CONNECT helper of the HTTP proxy tests reads the answer one byte at a time, so the first bytes of the tunnel are not lost with the head; unit test (unit.udp 166) When the far side wrote and closed at once, the 200 and the first bytes of the tunnel could reach the socket in one segment, and _connect_raw dropped everything after the blank line: the caller read the end of the stream instead of the data (run 43176569993, test_a_connect_to_loopback_is_relayed_and_one_that_would_leave_it_is_refused). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * tests: the chain by name allows loopback in ICE, because the lab's exit is 127.0.0.2 and a retail Firefox throws away an answer whose mapped address is loopback The giro 3 gate was red on test_a_turn_srflx_by_name_arrives_through_the_relay_before_the_tick. Measured on the giro 3 Linux binary (strace of the socket that talks to the relay + the gateway's own log): the gateway delivers the TURN server's 401 and then its success (type 0x0103) within 5 ms, the browser reads both, answers the 401 with credentials, and never accepts the success: it retransmits the same Allocate 5 times in the 2 s of the page. The success carries XOR-MAPPED-ADDRESS 127.0.0.2 (where the gateway's datagrams leave from, by design of the test) and nICEr rejects a loopback mapped address as bogus (stun_client_ctx.cpp nr_stun_transport_addr_check) unless the ICE context allows loopback (turn_client_ctx.cpp; the flag is set from media.peerconnection.ice.loopback in nricectx.cpp). The same TURN server answers a direct browser at a non-loopback address and the allocation completes in 60 ms, so the chain is sound. With the pref the chain test passes at 130 ms of round trip on the giro 3 binary; without it it fails at 0, 65 and 130 ms. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * tests: the comment of the first-datagram test says why the core's discovery of the exit fails in the lab (no echo service is reachable), not that a fixed time zone skips it Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * tests: the DoH, stress and ICE-names e2e ask for a virtual display on a Linux machine that has none; unit tests (unit.udp 173) Run 43176569993: 19 of 19 of wrapper.e2e.doh on Linux died at the launch with "no DISPLAY environment variable specified". Those files launched a headed browser without a screen (the runner has none, and the suite runs under sudo). The other e2e launch with headless=True, which is a headed browser on an Xvfb the wrapper starts itself. A machine with a display, and Windows, are left as they are. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * tests: the chain by name reads its srflx and its relay from the page with a gateway exit that is not loopback, and the loopback pref is gone The exit of the lab is 198.51.100.9 (documentation, RFC 5737), held on lo with ip addr add for the length of the test; nICEr accepts it as a mapped address (nr_stun_transport_addr_check rejects only wildcard, loopback and link-local), so the product's own setting is what is under test, not a pref that is off in production. The page must read a srflx equal to the gateway's exit and the relay candidate of the TURN server it asked. The file moves to a suite of its own, wrapper.e2e.udp.exit (Linux only, root): adding an address to an interface needs administrator and changes the network of the host, so the Windows suite does not collect it (a skipped test would turn the verdict red). Chain takes exit_host; the TURN helper test runs for two exits. Red on the old code: with the 127.0.0.2 exit and no pref the test fails at 0, 65 and 130 ms; green on the giro 3 Linux binary at 130 and 0 ms (container). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * tests: the DoH, stress and ICE-names e2e always launch on a virtual display (headless=True, as the UDP and realness e2e); the helper that looked at the display of the host is gone; unit tests (unit.udp 177) A test does not behave differently by the display of the machine it runs on. Replaces the helper of302af97. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * tests: the QUIC of the gateway test works on Windows: the relay leaves from the host's address, is told by its port, and a send that fails is said; unit tests (unit.udp 176) On Windows the e2e read h2 on five visits and 'the server saw QUIC from []': the relay of the gateway sent from 127.0.0.1 to an address of its own host (WinError 10051, nothing sends from loopback to the host's address there) in a timer that ignored every OSError, after logging the datagram as carried. - the coherent gateway of the h3 test leaves from the host's address on every system (exit_host), and its fake STUN is bound there too (Windows sends neither from the host's address to loopback, 10049, nor the reverse); the relay is told from a client that came direct by the PORT it sends from (Gateway.exit_ports, H3Server.quic_peer_addrs); it forwards only to this host (forward_only_to): the browser's own QUIC to the Internet stays in the lab. - Gateway._later records a send that raised (send_errors) and the report of the test shows it; the test asserts there is none. - the relay's sockets turn SIO_UDP_CONNRESET off on Windows and a ConnectionResetError no longer ends the thread that reads. - unit tests: a failing send is recorded and reported; a relay that leaves from the host's address reaches a server there, by a port in exit_ports and not one of a direct client; the fake STUN answers through it. Red on the old helpers (they have no exit_host/exit_ports/send_errors). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * tests: three e2e modules of the UDP line are bound to the engine that carries it, as the others are test_networkidle_through_a_served_browser_with_routes_e2e.py (red on firefox-61 and 62: its engine fix, 0972db59da, is in the 63), test_the_association_is_ready_when_the_peerconnection_is_born_e2e.py and test_turn_over_tcp_is_tried_for_real_e2e.py (red before the UDP line) had only pytest.mark.e2e, so the e2e job of main, which fetches the PUBLISHED engine, would run them against it. They now carry usefixtures(the_udp_line): they skip on an older engine and run on the candidate (REVIEW-63 #14). The collected counts do not change (21, 1, 2); the ids stay in ci/required-suites.json, and a skip on the candidate is still red there. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * tests: the chain by name keeps its walk on Windows (exit of the lab on loopback, with the pref) beside the one without the pref (wrapper.e2e.udp.exit, Linux) d41ea7e moved the whole file to the Linux-only suite. Now the file holds two tests: the walk with an exit that is not loopback and no pref (wrapper.e2e.udp.exit, Linux, root), and the walk with the exit on 127.0.0.2 and media.peerconnection.ice.loopback (wrapper.e2e.udp, Linux and Windows). Selected by node id; wrapper.e2e.udp 41 again; the notes of the two suites say why. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * request.resource_type agrees with the pinned driver: a beacon is `beacon`, a CSP report `cspreport` The table that turns a Juggler cause into a Playwright resource type was a copy of the driver's and had gone stale: the pinned driver (1.61, coreBundle.js ffNetworkManager) says `beacon` for TYPE_BEACON and `cspreport` for TYPE_CSP_REPORT; ours said `other` for both. Measured on cnbc.com and scmp.com, our engine and Playwright's own Firefox side by side: the same POSTs (2 and about 8 per page) are `other` here and `beacon` on stock, so a client or a route filter that looks for beacons saw none. Test (red on the old table): the driver's own table is read from the installed package and every cause it names must map to the same type here; the next driver version that changes it fails the test, nothing is updated by hand. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * The old table test expects beacon for TYPE_BEACON, as the pinned driver says Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * tests: the DoH session built by hand launches on a virtual display too, and a test reads every direct InvisiblePlaywright(...) of the DoH and realness files (unit.udp 181) Run 43188313516: test_a_session_without_a_proxy_resolves_with_the_system_resolver died with "no DISPLAY environment variable specified": it builds its session by hand (not through _launch) and was not covered. The new test parses the files of the two suites and fails on a construction without headless=. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * tests: the resolver trap counts the questions of the user that runs the test, by the owner of the socket (/proc/net), not by name; unit.udp 189 Run 43188313516: on a runner the agent of the runner asks for github.com, api.github.com and its orchestrator through the /etc/resolv.conf the trap rewrites, and the trap blamed the browser (6 realness tests and 1 DoH test). A question whose socket belongs to another user is answered and listed in trap.foreign, not counted. The owner is read on receipt, before the answer: measured on Linux, 3000 questions that wait for their answer, 0 unreadable; one that cannot be read counts as the browser's. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * tests: a loss is not a drop - behind a proxy that cannot carry the UDP of a PeerConnection, nothing of the browser reaches a witness direct (suite wrapper.e2e.udp.exit) The e2e that check 'no srflx' cannot tell the fail-closed rule from a leak: at an address nothing routes a datagram sent direct arrives nowhere, exactly as a dropped one. A witness (_witness.py: a STUN server and a TCP listener at 198.51.100.10, held on lo, reachable by the browser directly) hears who contacts it, and the gateways leave from ANOTHER documentation address (the exit, 198.51.100.9; the test gateway's TCP now leaves from it too, opt-in: tcp_from_exit). In each fail-closed scenario - a SOCKS5 proxy that refuses UDP, one whose UDP leaves from another address, one whose relay never answers, an HTTP proxy - the witness hears no datagram and no connection from a source that is not the exit; a send direct is red. The controls that make the green mean something: the same page with no proxy IS heard by the witness (datagram and connection), and behind a coherent gateway the witness hears the exit only. Proved in the container on the giro 3 Linux binary (green, 7 tests of the suite). The witness and the gateway's source binding have unit tests (192). Counts: wrapper.e2e.udp.exit 7, wrapper.unit.udp 192. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * launcher: preload_newtab, the option of the core that turns off the preloaded New Tab page InvisiblePlaywright(preload_newtab=...) (sync, async and launch_server) hands the core's option of the same name over, only when it is not None: a wrapper paired with a core that does not know it cannot meet a TypeError for a caller who never used it. None keeps the retail's behaviour; False writes browser.newtab.preload false (no privileged-about process); True says the retail's value aloud; a pref in extra_prefs wins. Tests: the kwarg reaches the core only when asked and is a parameter of every entry point; the e2e reads the process types from the engine's log (MOZ_LOG=Process:5): privilegedabout exists by default and is absent with the option, on every platform. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * ci: wrapper.unit.udp counts the three tests of preload_newtab (195); its e2e is in no suite until it has been seen green Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * tests: the constructor signature knows preload_newtab; the witness takes TCP first (Windows excluded ranges); the preload_newtab e2e (seen green as root on Linux) joins wrapper.e2e.udp.exit (9) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * ci: wrapper.e2e.udp.sandbox (Linux, a normal user, the browser's sandbox on): the socket process and a tab process must have a seccomp filter, plus the three situations of the UDP line (a proxy with UDP, no proxy, a proxy without UDP with the ICE name by DoH) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * ci: the preload_newtab e2e moves to wrapper.e2e.udp (seen green on Windows, 10 runs of 10): udp 43, exit 7 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * tests: the UDP witness binds TCP and UDP on one number even where the system's picks fall in a refused UDP range Witness("127.0.0.1") failed with WinError 10013 in three unit tests of wrapper.unit.udp on a Windows work machine, while the push before had passed them. Windows hands out ephemeral TCP ports in sequence and keeps excluded ranges of a hundred ports for UDP in the same zone: the witness asked the system for a TCP port twenty times, got twenty consecutive numbers inside one UDP range, and gave up. Now each try binds TCP and then UDP on the same number, and if either is refused both are released and another number is tried: the first is the system's own pick, the others are drawn at random below both Windows' dynamic range and Linux's ephemeral range, so they are not the next of a sequence. 200 tries at most, then an error that names the address and the last refusals. A port asked for is tried once and its refusal raised. Test, red on the old code (2 of 3): a fake socket layer whose TCP picks are sequential and whose UDP refuses 50000-50199. Real sockets on that machine, 20 runs of the witness tests each: old 19 of 20 green, new 20 of 20. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * ci: wrapper.unit.udp counts the three tests of the witness port pick (198) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * tests: the sandbox leg finds the tab processes (forked by the fork server, their argv has no 'tab' at the end): the kind comes from the last word, else from the Name in /proc/<pid>/status Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * tests: the resolver trap counts the questions of the processes of the test (the socket's inode, the process that holds it, its parents), not of a user; a question of any other process is listed with its pid and command Runs 43188313516 and 43211837926: on the runner the agent of the runner, as root like the browser under sudo, asks for github.com, api.github.com and its orchestrator through the trap's /etc/resolv.conf, and a user filter cannot tell it from the browser (6 realness tests red). Measured on Linux, 40 questions of a descendant and 40 of an orphan process of the same user: 40 counted, 40 foreign, each with its pid and command. One whose process cannot be traced is judged by its user, one whose socket is gone counts as the browser's. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * tests: the resolver trap counts the BROWSER (a browser process and what it starts), not the test process nor the core it runs: the core asks github.com for the latest GeoIP tag as root, the test says the browser asked Measured on Linux: a process named firefox and its child counted 20 of 20 each; the test's own python and an orphan of the same user foreign 20 of 20 each. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * juggler: a download that finished before it was announced is finished BrowserDispatcher._on_download_finished keeps the error of a download whose artifact does not exist yet; a successful download has no error (None), and _on_download_created popped it with a None default and tested `is not None`, so the artifact was never marked finished and save_as, path and failure waited forever. A module-level sentinel tells "nothing recorded" from "finished with no error". The entry is also popped before the unknown-context early return, so it no longer stays in the dict. Tests: unit file (red on the old code for the success and the gone-context cases) and a served-browser e2e with ten 300-byte and ten 1-byte downloads. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * juggler: an early download finish lives only as long as it can be read The review of6a50ad1found three cases where an entry of _finished_early stayed for the life of the browser: (a) a download announced while its context was already closed, whose finish came after; (b) a finish after the client released the artifact; (c) a finish of a uuid never announced. The browser now keeps, per announced download, the context it belongs to, until its finish or the end of that context. A finish whose download was announced and whose artifact is gone writes nothing; only a finish of a download not announced yet leaves an early entry, and those are bounded (64, the oldest dropped first). The end of a context forgets its downloads that never finished. Tests, red on6a50ad1(4 of 10): (e) gone context, (f) released artifact, (g) never-announced finishes are bounded, (h) the end of a context forgets. NOT proven: that the engine ever sends a finish after the end of a context, or a finish before the announcement. On one connection Juggler says a download's creation before its end (TargetRegistry.js interceptDownloadRequest then onDownloadComplete), so the early path is defensive. The e2e of tiny downloads is a proof of use, not of the order; its docstring says so. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Release 0.51.0: engine firefox-63, pin invisible-core 63.66.0; CHANGELOG for the UDP line * Release 0.51.0: the README says what the launch counter is and how to turn it off; the CHANGELOG says what is known to be wrong (popups opened without a route, as measured) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * Release 0.51.0: the served launch cannot turn the launch counter off (a client's firefoxUserPrefs, bare or marked, are refused with the core's message); the history says it is no longer possible Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * tests: the two tests that ask the resolver trap from the test process say that the test stands for the browser Sincefc10e257cathe trap counts only the questions of a browser process, found by the process that holds the socket in /proc/net. That is only possible on Linux; on Windows every question counts, so the pre-push (Windows) stayed green while test_the_trap_counts_a_query_it_is_sent_and_refuses_what_it_cannot_answer failed on Linux (republish run 43230437094, wrapper.unit.udp/linux: 1 failed, 218 passed): the test asks from its own python, which is not a browser, and the question went to `foreign`. The same holds for the resolv.conf test of the root legs. Both tests now pass is_browser=lambda pid: True. The trap itself is unchanged, so the realness leg judges the same code. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * tests: the HTTP/3 test server finds a port that TCP and UDP both bind where the system's picks fall in a refused UDP range wrapper.e2e.web on the Windows runner (republish run 43230437094) failed three tests with "no port free for both TCP and UDP", and the pre-push failed the same way on a work machine: Windows hands out ephemeral TCP ports in sequence and keeps excluded ranges of a hundred ports for UDP in the same zone, so the old loop (fifty times the system's pick) got fifty consecutive numbers inside one refused range. The first try is still the system's pick; the others are drawn at random below the dynamic range, as the witness already does (same constants), and the refusals are named in the error. Two tests with a fake socket layer (TCP picks 50000, 50001, ...; UDP refuses 50000-50199): the old loop is red on it, this one finds a number outside the range; and a server that can bind nothing says so after a bounded number of tries. wrapper.unit.udp goes from 219 to 221 tests (ci/required-suites.json). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * Release 0.51.0: the CHANGELOG and the README say only what is proven (counter: what the package refuses and whose repository counts; the real name of the async class; the popup numbers of the register; Windows memory only; addBinding out) Markdown only. Following the fact check of the release texts: the launch counter is refused by the package's launcher and server (not "not optional" for the engine alone) and counted in the engine's repository; preload_newtab names the async class by its real path and keeps only the Windows numbers that have a saved run, with the engine they were taken on; the protocol mirror line about Page.addBinding is out (not shown for the pinned engine); the differences section no longer claims a comparison run nobody saved; the popup known issue states where, with which client, on which engines and with how much load it was seen, with the numbers of the register, and that the correction is in 0.51.1. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * user-install: the wait asks pip, not the JSON page of the index, and fails saying what is missing; the upgrade test installs the version its listing named Ledger #476 of 0.50.1: the Linux job failed in test_upgrade_e2e ("the upgrade did not move the wrapper", '0.49.1' != '0.49.1') three minutes after the upload. The step that waits for the index had asked the per-version JSON endpoint, which answered; the listing of `pip index versions` had 0.50.1; the `pip install --upgrade` that followed was still served the 0.49.1 page. The wait now runs `pip download --no-deps --no-cache-dir invisible-playwright==X` (the client and the index the install uses), for at most ten minutes, and ends in "::error::the index does not have X yet, after N minutes" instead of a warning and a run that fails later. The upgrade test takes previous and latest from one listing and installs `WRAPPER==latest`. Four unit tests run the script of the step with a pip that fails until its Nth call; the core's install_job gate still passes. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * tests: the fake pip of the wait test is a regular package, so the pip of the environment cannot shadow it CI (runs 43196645121, 43196645144): 2 tests of the wait for the index failed on every Python of both systems. The shim was a directory with a __main__.py and no __init__.py: a namespace package, which loses to the regular package `pip` of an environment that has one (a local uv venv has none, so it passed there). The real pip ran, said "No matching distribution" for 9.9.9 and the shim was called 0 times. Reproduced in a venv with pip; red without the __init__.py, green with it. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * tests: ask for the processes of a site by its name, never count between two reads The e2e tests that looked at content processes compared the set of "Isolated Web Co" processes before and after an action. The browser starts processes of its own: the pool refill, and a process for a Mozilla site (webIsolated=https://mozgcp.net) that the New Tab page starts about a second after its own, with any page. Under load it was born between the two reads: the same-site control was red in 14 of 30 runs of the whole e2e suite ([P] -> [P, P2]), the cross-site test could pass on that process alone, and the service-worker test could read it as a process left behind. With the test-only pref fission.processSiteNames a content process that hosts a site is named by that site (http://a.test^u on Linux, cut at 15 characters). tests/_processes.py now returns the processes of one site by that name; the bench and the service-worker test use it. Linux only, as before. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * tests: the popup process case has a browser that starts no process by itself, and asks by name on Linux test_the_other_site_popup_runs_in_another_process counted every content process between two reads, so a process the browser starts by itself (the pool refill, the preloaded New Tab page and, in some countries, a process for a Mozilla site) was taken for the popup's doing. It now has a browser of its own, on each transport, with no preallocated processes and no preloaded New Tab page (test-only prefs), so the count between two reads is the popup's. On Linux it also asks by name that one of the new processes is the process of localhost. It still runs on Windows, with no skip: the required suite wrapper.e2e.page collects this file on both systems with an exact count, which is unchanged (34). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * tests: the popup process case runs its own browser in a thread of its own The e2e of the previous commit failed at setup: the module's browser of the matrix keeps a sync client open in the test's thread, and a second sync client refuses to start inside its loop ("Sync API inside the asyncio loop"). The case now opens its quiet browser in a thread with no loop and hands back its result or its error. Same count of tests (34), still no skip on any system. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Release 0.51.0: the CHANGELOG line of the process tests says only what is proven Markdown only. The line that came with the end-to-end process tests carried a count of red runs and a cause of the extra process that nothing saved; it now says that these are tests only and what they ask for. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * Release 0.51.0: pin invisible_core==63.67.0 (the protocol mirror agrees with the published engine); the popup known issue says what the correction measured invisible-core 63.66.0 carried a protocol mirror that differed from the Protocol.js of the published firefox-63 (the e2e job's `--check` said DRIFT: a header count and the `ref` of two optional points of Page.getFrameOrigin); 63.67.0 is 63.66.0 with the mirror regenerated from that engine. The pin moves to it. The popup known issue: both causes found are in the wrapper (the hand-over of a new page to the client, and the replay of a new page's events while live ones are being delivered). The correction of the first alone lowers the red cases over 20 runs from 15 to 2 with the firefox-62 engine but only from 17 to 13 with the firefox-63 engine; the correction of the second is under test. No version is promised. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * tests: the SOCKS5 proxy test uses the suite's gateway that carries the DNS-over-HTTPS (the old fake answered the DoH with nothing); the CHANGELOG says what a SOCKS5 proxy now receives test_socks_still_goes_out_through_the_proxy_after_the_roads_were_merged was written for the road where the browser handed the SOCKS5 proxy the NAME (socks_remote_dns). Since the DoH road (decision core-19) a browser behind a proxy asks the name to a DNS-over-HTTPS server THROUGH the proxy (network.trr.mode 3, no fallback) and connects to the address it gets. Its fake accepted every CONNECT and answered nothing to the DoH, so the name never resolved: `Page.goto: domcontentloaded not reached in 30s` (on Windows the launch itself failed first: "could not discover the egress IP through the proxy: the proxy accepted the connection and then never answered"), and its second assertion (the name reached the proxy) could not be true by design. The test now runs on the fixtures `doh`, `pages` and `gateway` (the suite's SOCKS5 gateway that serves the DoH and relays the loopback): the page loads, the DoH asked the name through the gateway, the page was reached by address, and the NAME never reached the gateway. The fake and its fixture are gone (nothing else used them). Red on the old test and green three times on the new one, on Windows, with the published firefox-63. CHANGELOG [0.51.0], Changed: one sentence for what a SOCKS5 proxy now receives (addresses, not names) and what a proxy that cannot carry HTTPS to the DoH server resolves (no name). Said for SOCKS5 only: for an HTTP proxy the e2e of the DoH keeps it as an assumption that an http page's name still goes to the proxy. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * e2e.yml: the seven root e2e (wrapper.e2e.udp.exit) run in a root step as the gate runs them, and the run of the runner user leaves them out by name Run 43262636367 of PR 483: the seven tests whose lab exit is 198.51.100.9 added to `lo` errored when collected as the runner user ("cannot hold ... needs root and iproute2"). The new step copies the engine to /opt/ff and runs exactly those under `sudo -H -E env -u PYTEST_ADDOPTS -u XDG_RUNTIME_DIR INVPW_REQUIRE_TRAP=1`, no rerun plugin, and reads its own junit: exactly 7 tests, no failure, error or skip. The full run gets --ignore/--deselect of the same tests (ROOT_FILES / ROOT_NODES), so nothing is skipped silently and nothing runs twice. Test: tests/test_the_root_e2e_run_in_the_root_step_and_nowhere_else.py reads the list from ci/required-suites.json and the workflow as text (no PyYAML); red on e2e.yml as it was. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> * e2e.yml: the root e2e run AFTER the run of the runner user, and a diagnostic step says what root left behind Run 43271443150 (PR 483): with the root step first, every launch of the run that followed waited for the browser's readiness line until its timeout (46 stacks in connection.launch -> wait_for_ready) and the job was cancelled at 40 minutes; the same head without the step had 748 green. Now the root step comes after the full run (if: success() || failure()), and the next step prints the files root left under the runner's home and /tmp, /etc/resolv.conf and the addresses on lo (it decides nothing). tests/test_the_root_e2e_run_in_the_root_step_and_nowhere_else.py now holds the order too: red on a5606dd's workflow (the root step comes BEFORE the run of the runner user), green here. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> Co-authored-by: Richard Powell <1369873+richardpowellus@users.noreply.github.com>
194 lines
9.1 KiB
Python
194 lines
9.1 KiB
Python
"""The judges and the gateway of the realness suite (``test_realness_behind_a_declared_exit_e2e.py``), held to what they say.
|
|
|
|
No browser: golden reads for the judges (each red case is one the e2e must catch), and the gateway and the site with a plain
|
|
socket client, so that "a connection the gateway did not open is a leak" is shown to work before a browser is trusted with it.
|
|
"""
|
|
from __future__ import annotations
|
|
|
|
import ipaddress
|
|
import socket
|
|
import struct
|
|
|
|
import pytest
|
|
|
|
import _realness_support as rs
|
|
|
|
pytestmark = pytest.mark.unit
|
|
|
|
EXIT = rs.EXITS["germany"]
|
|
HOST_LAN = "192.168.1.20"
|
|
GOOD_SDP = "v=0\r\no=- 1 0 IN IP4 0.0.0.0\r\nc=IN IP4 0.0.0.0\r\n"
|
|
MDNS_HOST = "candidate:0 1 UDP 2122252543 1460e928-16b3-4c66-80ad-04abcdef0000.local 54551 typ host"
|
|
SRFLX = "candidate:1 1 UDP 1686052863 %s 58555 typ srflx raddr 0.0.0.0 rport 0"
|
|
|
|
|
|
def _probe(*lines, sdp=GOOD_SDP):
|
|
return {"candidates": list(lines), "sdp": sdp + "".join("a=%s\r\n" % line for line in lines), "errors": []}
|
|
|
|
|
|
# ---------------------------------------------------------------------------------------------------------- the table
|
|
def test_every_declared_exit_is_a_public_ipv4_address_of_its_own():
|
|
addresses = list(rs.EXITS.values())
|
|
assert len(set(addresses)) == len(addresses) >= 6
|
|
for address in addresses:
|
|
parsed = ipaddress.ip_address(address)
|
|
assert parsed.version == 4 and parsed.is_global, address
|
|
|
|
|
|
# ---------------------------------------------------------------------------------------------------------- webrtc
|
|
def test_a_coherent_gather_with_mdns_hosts_and_the_exit_as_srflx_is_clean():
|
|
assert rs.webrtc_problems(_probe(MDNS_HOST, SRFLX % EXIT), EXIT, {HOST_LAN, "127.0.0.1"}) == []
|
|
|
|
|
|
@pytest.mark.parametrize("probe, fragment", [
|
|
(_probe("candidate:0 1 UDP 2122252543 %s 54551 typ host" % HOST_LAN), "not mDNS"),
|
|
(_probe(MDNS_HOST, SRFLX % rs.EXITS["japan"]), "server-reflexive"),
|
|
(_probe(MDNS_HOST, "candidate:2 1 UDP 2122252542 2001:db8::7 54552 typ host"), "IPv6"),
|
|
(_probe(MDNS_HOST, sdp="v=0\r\nc=IN IP4 0.0.0.0\r\na=ice-ufrag:x\r\na=candidate:9 1 UDP 1 10.0.0.8 5 typ host raddr "
|
|
"10.0.0.8 rport 5\r\n"), "private"),
|
|
({"candidates": [], "sdp": GOOD_SDP, "errors": [{"code": 701}]}, "no candidate"),
|
|
], ids=["raw_lan_host", "srflx_is_not_the_exit", "ipv6_behind_ipv4", "private_address_in_the_sdp", "no_candidate"])
|
|
def test_a_gather_that_shows_the_host_or_disagrees_with_the_exit_is_named(probe, fragment):
|
|
problems = rs.webrtc_problems(probe, EXIT, {HOST_LAN})
|
|
assert problems and any(fragment in p for p in problems), problems
|
|
|
|
|
|
def test_an_address_of_this_machines_interfaces_in_the_sdp_is_named_even_when_it_is_not_private():
|
|
public_own = rs.EXITS["japan"] # an interface can carry a public address: the exit of this test is another one
|
|
problems = rs.webrtc_problems(_probe(MDNS_HOST, sdp=GOOD_SDP + "a=x-note:%s\r\n" % public_own), EXIT, {public_own})
|
|
assert any("interfaces" in p for p in problems), problems
|
|
|
|
|
|
# --------------------------------------------------------------------------------------------------------------- zone
|
|
def test_the_offsets_of_a_zone_at_the_two_instants_follow_its_daylight_saving():
|
|
assert rs.expected_offsets("Asia/Kolkata") == [330, 330]
|
|
assert rs.expected_offsets("America/Los_Angeles") == [-480, -420]
|
|
assert rs.expected_offsets("Australia/Melbourne") == [660, 600] # the southern hemisphere runs the other way
|
|
assert rs.expected_offsets("Asia/Tokyo") == [540, 540]
|
|
|
|
|
|
def _read(zone, **override):
|
|
read = {"zone": zone, "offsets_by_date": rs.expected_offsets(zone), "offsets_by_intl": rs.expected_offsets(zone),
|
|
"language": "de", "languages": ["de", "en-US", "en"], "intl": "de"}
|
|
read.update(override)
|
|
return read
|
|
|
|
|
|
def test_a_page_and_a_worker_that_say_the_zone_of_the_exit_are_clean():
|
|
assert rs.timezone_problems({"page": _read("Europe/Berlin"), "worker": _read("Europe/Berlin")}, "Europe/Berlin") == []
|
|
|
|
|
|
@pytest.mark.parametrize("worker, fragment", [
|
|
(_read("Europe/London"), "worker: Intl says"),
|
|
(_read("Europe/Berlin", offsets_by_date=[0, 0]), "worker: offsets_by_date"),
|
|
(_read("Europe/Berlin", offsets_by_intl=[120, 60]), "worker: offsets_by_intl"),
|
|
], ids=["worker_zone", "clock_offset", "intl_offset"])
|
|
def test_a_worker_that_keeps_another_zone_or_offset_is_named(worker, fragment):
|
|
problems = rs.timezone_problems({"page": _read("Europe/Berlin"), "worker": worker}, "Europe/Berlin")
|
|
assert any(fragment in p for p in problems), problems
|
|
|
|
|
|
def test_the_older_canonical_name_of_a_zone_is_the_zone():
|
|
both = {"page": _read("Asia/Calcutta"), "worker": _read("Asia/Kolkata")}
|
|
assert rs.timezone_problems(both, "Asia/Kolkata") == []
|
|
|
|
|
|
# ---------------------------------------------------------------------------------------------------------- language
|
|
HEADER = "de,en-US;q=0.7,en;q=0.3"
|
|
HEADERS = {"/": HEADER, "/fetch": HEADER, "/worker-fetch": HEADER}
|
|
|
|
|
|
def test_a_language_everything_agrees_on_and_the_country_speaks_is_clean():
|
|
reads = {"page": _read("Europe/Berlin"), "worker": _read("Europe/Berlin")}
|
|
assert rs.language_problems(reads, HEADERS, "DE") == []
|
|
|
|
|
|
def test_a_country_that_is_not_in_the_table_is_checked_for_agreement_only():
|
|
reads = {"page": _read("Europe/Berlin"), "worker": _read("Europe/Berlin")}
|
|
assert rs.language_problems(reads, HEADERS, "ZZ") == []
|
|
assert rs.language_problems(reads, HEADERS, None) == []
|
|
|
|
|
|
@pytest.mark.parametrize("change, fragment", [
|
|
(lambda reads, headers: reads["worker"].update(languages=["en-US", "en"]), "worker: languages"),
|
|
(lambda reads, headers: reads["worker"].update(intl="en-US"), "worker: the Intl locale"),
|
|
(lambda reads, headers: reads["page"].update(language="en-US"), "navigator.language"),
|
|
(lambda reads, headers: headers.update({"/worker-fetch": "en-US,en;q=0.5"}), "/worker-fetch: Accept-Language"),
|
|
(lambda reads, headers: headers.update({"/fetch": None}), "carried no Accept-Language"),
|
|
], ids=["worker_languages", "worker_intl", "navigator_language", "worker_header", "no_header"])
|
|
def test_a_read_that_disagrees_with_the_others_is_named(change, fragment):
|
|
reads = {"page": _read("Europe/Berlin"), "worker": _read("Europe/Berlin")}
|
|
headers = dict(HEADERS)
|
|
change(reads, headers)
|
|
problems = rs.language_problems(reads, headers, "DE")
|
|
assert any(fragment in p for p in problems), problems
|
|
|
|
|
|
def test_a_language_the_country_does_not_speak_is_named():
|
|
reads = {"page": _read("Asia/Tokyo", language="ru", languages=["ru", "en"], intl="ru"),
|
|
"worker": _read("Asia/Tokyo", language="ru", languages=["ru", "en"], intl="ru")}
|
|
headers = {path: "ru,en;q=0.5" for path in HEADERS}
|
|
problems = rs.language_problems(reads, headers, "JP")
|
|
assert any("not plausible for JP" in p for p in problems), problems
|
|
|
|
|
|
# ------------------------------------------------------------------------------------------ the gateway and the site
|
|
def _ask(s):
|
|
s.sendall(b"GET /ip HTTP/1.0\r\nHost: x\r\nAccept-Language: de\r\n\r\n")
|
|
data = b""
|
|
while True:
|
|
chunk = s.recv(4096)
|
|
if not chunk:
|
|
break
|
|
data += chunk
|
|
return data.split(b"\r\n\r\n", 1)[1].decode()
|
|
|
|
|
|
def _get_ip_through(gateway_port, site_port):
|
|
s = socket.create_connection(("127.0.0.1", gateway_port), timeout=10)
|
|
try:
|
|
s.sendall(b"\x05\x01\x00")
|
|
assert s.recv(2) == b"\x05\x00"
|
|
s.sendall(b"\x05\x01\x00\x01" + socket.inet_aton("127.0.0.1") + struct.pack("!H", site_port))
|
|
reply = b""
|
|
while len(reply) < 10:
|
|
reply += s.recv(10 - len(reply))
|
|
assert reply[1] == 0, reply
|
|
return _ask(s)
|
|
finally:
|
|
s.close()
|
|
|
|
|
|
def test_the_site_tells_a_connection_of_the_gateway_from_a_direct_one(doh):
|
|
gateway = rs.ExitGateway("exit", doh, tcp_exit=EXIT, udp_exit=EXIT)
|
|
site = rs.Site(gateway)
|
|
try:
|
|
assert _get_ip_through(gateway.port, site.port) == EXIT
|
|
direct = socket.create_connection(("127.0.0.1", site.port), timeout=10)
|
|
try:
|
|
assert _ask(direct).startswith("DIRECT 127.0.0.1")
|
|
finally:
|
|
direct.close()
|
|
verdicts = [a.via_gateway for a in site.arrivals]
|
|
assert verdicts == [True, False], site.arrivals
|
|
problems = rs.ip_problems(EXIT, site.arrivals, [], EXIT, gateway.connects, site.port)
|
|
assert any("did not open" in p for p in problems), problems
|
|
assert site.headers_of("/ip") == {"/ip": "de"}
|
|
finally:
|
|
site.close()
|
|
gateway.close()
|
|
|
|
|
|
def test_a_run_through_the_gateway_only_is_clean_and_a_wrong_address_is_named(doh):
|
|
gateway = rs.ExitGateway("exit", doh, tcp_exit=EXIT, udp_exit=EXIT)
|
|
site = rs.Site(gateway)
|
|
try:
|
|
seen = _get_ip_through(gateway.port, site.port)
|
|
assert rs.ip_problems(seen, site.arrivals, [], EXIT, gateway.connects, site.port) == []
|
|
assert any("declared exit" in p for p in rs.ip_problems("192.0.2.1", site.arrivals, [], EXIT, gateway.connects, site.port))
|
|
assert any("past the gateway" in p for p in rs.ip_problems(seen, site.arrivals, ["192.0.2.9:443"], EXIT,
|
|
gateway.connects, site.port))
|
|
finally:
|
|
site.close()
|
|
gateway.close()
|