Compare commits

..
479 Commits
Author SHA1 Message Date
Federico Elia 2b10a93ae5 Merge pull request #636 from oss-invisible/docs/pr-template-patch-questions
docs: add a patch questions table to the PR template
2026-12-01 22:50:14 +01:00
feder-cr 4f603e29a3 docs: add a patch questions table to the PR template 2026-12-01 22:06:02 +01:00
Federico Elia a0d7c627a6 Merge pull request #633 from oss-invisible/ledger/0.61.0
record 0.61.0 as published
2026-11-30 16:52:48 +01:00
feder-cr 704fd5f98c record 0.61.0 as published 2026-11-30 12:28:40 +00:00
Federico Elia 262937350f Merge pull request #632 from oss-invisible/release/0.61.0-firefox-71
release 0.61.0: engine firefox-71, core 71.85.0
2026-11-30 10:01:32 +01:00
feder-cr 50cda456cb release 0.61.0: pins invisible-core 71.85.0 (engine firefox-71), the core release whose proof reads main's retired tests; persona seeds and the gate lock for that core 2026-11-30 02:39:56 +01:00
feder-cr ce913bbf4b release 0.61.0: pins invisible-core 71.84.0 (engine firefox-71); persona seeds and the gate lock for that core 2026-11-30 00:40:08 +01:00
feder-cr a6fe4ea53b release 0.61.0: version and changelog (engine firefox-71, core 71.84.0) 2026-11-29 22:29:07 +01:00
feder-cr 34f02cdcdc ci: the unit suites count the five cases of the drag twin's frame rule (4375 on Linux, 4387 on Windows) 2026-11-29 22:02:46 +01:00
feder-cr a3ff6087f1 tests: the move with a button down starts outside the context menu that the right click left open
Juggler closes a menu on a press only, as the platform does, so the context menu of "frame right click" is still open at the next action. Its first move, to (300, 200), lay over the menu and the page never saw it, on retail or on ours. The points of "move with button down" are now left of and above the right click's point, inside the iframe and on its button; the press of the action closes the menu. The expected event list is unchanged.
2026-11-29 19:59:52 +01:00
feder-cr d7b0cb8638 tests: the dropdown test waits for the trusted mouseup and click that the page gets after a release the parent handled alone
A release that the parent handles in chrome (the select dropdown is open) is answered without the content ack. On retail the page then gets a trusted mouseup and click on the select, dispatched by SelectChild after the parent's Forms:MouseUp, asynchronously. The pages of the stays-open test record both on the select, and the test waits for them in the page's own log with the deadline of the file (never assuming they arrived when the call returned), in the top document and in the frame of another site. What the tests already assert is unchanged. The negative control (popup hidden between the press and the release) does not wait for them.
2026-11-29 19:59:52 +01:00
feder-cr 66a682cfe6 tests: the back-forward cache bench leaves the page when the frame's report request is over, not when the server has recorded it
The frame page /shown sent its pageshow report with a fetch, and the test left the top as soon as the server had recorded the report. The response was still on its way, the fetch was still in the frame's load group, and Firefox refuses the back-forward cache for a page left with a request in flight (BFCacheStatus::REQUEST, CanonicalBrowsingContext::AllowedInBFCache): both reports came with persisted=false. Stock Firefox does the same, and the product never promised the cache for a page left like that.

The page keeps the request in window.__sent; the test waits in the frame until it settles (the request is over, so the frame's load group is empty), then leaves. The sequence is a helper with the condition to leave on ("finished" or "recorded"). The server fixture gets a knob that holds the first pageshow response for 2 s after recording it, and a new e2e runs the sequence with the knob on: the old sequence (leave on "recorded") with the knob is the red case, which runs on the candidate; the new one is green.

e2e rows: wrapper.e2e.suite.linux.2 419 to 420 and wrapper.e2e.suite.windows.3 276 to 277 (+1 each).
2026-11-29 19:59:23 +01:00
feder-cr 1717c2063c tests: the drag twin declares the top's leave into an in-process frame and the dropEffect of the frame drop
In the drop in a frame of another site, two fields of the top document depend on stock's frame
being in its own process model: the top's dragleave whose element under the cursor is the frame
(stock's event manager fires a leave at the body when the cursor enters the subdocument; retail
with the frame out of process and ours have none), and the dropEffect of the top dragend (the
frame's drop result, which crosses processes). Before the comparison they leave top.once for
top.into_frame and top.dragend_effect, both declared IN_PROCESS_FRAME, so the event lists line up
and the rest of the top is still compared. In the drop in the top document the record is compared
whole, dragend's effect included. split, compare, recorded and verdict take the kind of the drop.

The frame page of the twin was served raw with height:100%%, an invalid length, so body had height
0 and the twin read html where retail reads body; it is height:100% now.

The unit test of the twin gets the leave under the frame in its frame fixture, a case with stock
leave and copy against ours without it and move (green, recorded as declared), and the same
dragend effect difference in the top drop (red).
2026-11-29 19:56:25 +01:00
feder-cr 5ea88e57d5 tests: a select dropdown stays open after the release, and a context menu closes on the next press with no input call hanging
Menus are closed by the platform on a press outside them and on the wheel (nsWindow::DealWithPopups), not on a release or a move. Per place (select of the top document, select of a frame of another site): press, wait for the popup to be open, release, and the state read over the next second must be open at every look; a chrome hidePopup between the press and the release is the negative control and must read closed. The pages and reads are those of the select twin, imported.

One more e2e for the case an unguarded call in the input path was there for: a chrome context menu that captures the mouse. A right click opens the chrome context menu, then moves across the page, a left click elsewhere and a move again must each return (each duration is in the message of a failure), and the menu is closed after the press of that click.

Red on an engine whose input closes menus on a release or a move: the dropdown reads closed after the button went up. e2e rows: wrapper.e2e.suite.linux.2 414 to 419 and wrapper.e2e.suite.windows.2 286 to 291 (+5 each).
2026-11-29 16:47:15 +01:00
feder-cr b7ef739d56 tests: the intersection twin does not compare the box of a frame that is fully out of view with stock
In Mozilla's code a fission frame scrolled fully out of view reads an empty boundingClientRect: DOMIntersectionObserver.cpp 792-794 returns early when there is no in-process root frame, after the transform chain HitTestingTreeNode.cpp 298-328, BrowserChild.cpp 3751-3778 and UnitTransforms.h 343-351; Mozilla's own web-platform meta (cross-origin-iframe.sub.html.ini) marks that step FAIL under fission. Stock's frame is in-process, so it reads the rectangle. The declared list of the twin now has the box of the steps all above and all below (in-process frame in stock); the box of the steps where the frame is in view and every other field stay compared, and the retail capture decides the declared ones.

Red on the old list: the declared-list test and the two out-of-view tests fail with nothing declared. unit.all rows: +13 (Linux 4370, Windows 4382).
2026-11-29 16:39:04 +01:00
feder-cr 23548f5822 tests: the select twin records the window's activation and focus at the click
For each select the record now has, before the click and right after it: chrome Services.focus.activeWindow === win, win.document.hasFocus(), the browsing context's isActive (win.gBrowser.selectedBrowser.browsingContext.isActive), the top content document's hasFocus() and visibilityState, and the driver's ack of the click when it keeps one. A popup that does not open for a window that was not active is then told apart from a popup at the wrong place. A read that fails is recorded and never raised.

Red on the old code: the six new tests and the existing ones that use the fake chrome fail without the read. unit.all rows: +6 (Linux 4357, Windows 4369).
2026-11-29 16:27:40 +01:00
feder-cr 5f58bdf808 tests: a field that depends on stock's frame being in-process is recorded, not compared with stock
Stock Playwright's Firefox sets fission.webContentIsolationStrategy=0, so its cross-site frame shares the top's process, and its drag is Juggler's synthetic one (no OLE loop). A field that depends on either is not what stock reads, and the retail capture decides it.

_stock_twin.split_differences splits the differences of a twin by a declared list per twin (a pattern of canonical paths and one of two reasons: in-process frame in stock, synthetic drag in stock); a declared field that differs is recorded (recorded_differences in the report) and a field that is not declared and differs is red.

The drag twin declares the buttons, drag at the source (count and presence), the dragend point less the last drag, and in the frame effectAllowed, dropEffect and mozSourceNode; routing, targets, client points, rel, types, trusted, the input source and the effects of the top document stay compared. The intersection twin has the list and declares nothing yet (moving boundingClientRect is one line).

Red on the old code: the new tests fail at their import of the declared list and of split_differences. unit.all rows: +43 (Linux 4351, Windows 4363).
2026-11-29 16:26:35 +01:00
feder-cr e0273aac56 tests: the retail driver's synthesized input reaches a frame in another process
SEND_JS called Window.synthesizeMouseEvent without isAsyncEnabled. With the webidl default (false) the event goes through widget->DispatchEvent and never through APZ (nsContentUtils.cpp 10552-10560 at FIREFOX_159_0_RELEASE), has no layers id, and EventStateManager::DispatchCrossProcessEvent falls back to the top process (EventStateManager.cpp 2199): a frame in another process never got the move or the click. The options now carry isAsyncEnabled: true, Mozilla's own mechanism (EventUtils.js asyncEnabled).

A static check reads every synthesize call of code that runs on retail or stock Firefox and is red when its options literal lacks isAsyncEnabled: true. Red on the old SEND_JS (two tests of the file), green on the new.
2026-11-29 16:22:44 +01:00
feder-cr 622f0d3eaf tests: the drag twin records every drag event the page reads, for a drop in a frame and for a drop in the top document
The twin of the drag kept a few numbers (the count of dragstart, the drop target and the client
point of the drop, the end point less the last drag point) and only for a drop in a frame of another
site. A dragenter at the wrong element, an empty dataTransfer, a dropEffect of none or an untrusted
event read as the same as stock's, and a drop in the top document was not covered at all.

Now both pages keep every event they hear (dragstart and drag at the source; dragenter, dragover,
dragleave and drop where the drag goes; dragend at the source) with its type, target id, the id of
the element under the cursor, client and screen points, buttons, mozInputSource,
dataTransfer.types, effectAllowed, dropEffect, mozUserCancelled, whether mozSourceNode is null and
isTrusted, plus the count of drag events at the source and the dragend point. The same test does
the drag twice on a fresh page, once ending in the frame and once in the top document, on stock
and on ours, and the verdict prints both records whole.

Ours is compared with stock exactly in every field that is the same on every machine; in one CSS
pixel in a client point (the tolerance the drop point already had); and through the relation of the
screen point to the client point, because screenX/Y is where the window stands (real on stock,
declared on ours). The counts of dragover and of drag events are recorded and not compared: retail
fires both from a timer (OLE calls DragOver periodically, and nsNativeDragTarget fires drag at the
source each time). What is compared is that drag fired at the source at least once on both sides.

Regression test (54 tests, no browser, fake pages): red on the old files (the module of the record
does not exist and the old twin has no DROPS or recorder), and red on each mutation of the
comparison. In the two unit rows: 4250 -> 4304 on Linux, 4262 -> 4316 on Windows (collect-only on
the row's files). The e2e row keeps its 4 tests.
2026-11-29 14:16:39 +01:00
feder-cr e0e620e8d5 tests: a select twin that fails says where it clicked and what the geometry was, and every case leaves its numbers
The steps of the select twin said "the dropdown did not open after a click on the select of the
frame document" and nothing about the click, so a red case at one display scale could not be told
from a wrong point, a wrong scale or a window that moved. Now, for each select, every failure of the
steps carries: the click point (CSS, and the point the driver sent with its unit and its device
point), the scales record, the select's box in its own document and the frame element's box in the
top document, mozInnerScreenX/Y of the top and of the frame, and the popup's state after the click,
at the deadline and at a second look. The verdict of the twin prints both browsers' records whole.
The same record is written for every case, red or green, to
$RUNNER_TEMP/invpw-evidence/popup-diagnostics/<case>-<browser>.json, the folder the jobs upload, so
a green run leaves the numbers to compare with a red one. A read of the diagnosis that fails is
recorded in the record and never replaces the finding.

The drivers keep the point they sent (last_click), and the retail driver reads a frame through
Marionette and is back in the top document when the read ends or fails.

Regression test (13 tests, no browser, a fake driver): red on the old files (11 of the 13 fail on
the old steps and drivers, the module of the record does not exist). In the two unit rows: 4237 ->
4250 on Linux, 4249 -> 4262 on Windows (collect-only on the row's files, not OS-specific).
2026-11-29 11:09:11 +01:00
feder-cr a7f84eded4 tests: the intersection twin routes the page of its frame again, and a check reads every page a test asks the fake sites for
The frame of the intersection twin is sites.url("B", "/io") and nothing routed B /io: the route was
dropped in an earlier commit and _register did not get it back. The fake sites answer an unrouted
path with a 404 and an empty body, so the frame had no #t and IntersectionObserver.observe threw.
_register routes B /io (FRAME_IO, which was defined and unused) again.

Regression test (9 tests, no browser): in every test module that builds Sites(), each
X.url(site, path) and each wait_frame/frame_of that names a site and a path has an X.route for it
in the same module; a computed part of a path is a wildcard on both sides; one exemption (the
expected scope of a service worker, compared and never requested) is listed with its reason and is
itself red when no call uses it any more. Red on the old file: the module without the route reads
B /io asked and not routed (two lines: the page of A and the frame lookup), and a snippet of the same
shape; green with the route. In the two unit rows: 4228 -> 4237 on Linux, 4240 -> 4249 on Windows
(collect-only on the row's files: 4240 before, 4249 after).
2026-11-29 11:01:13 +01:00
feder-cr 06c2428572 tests: the retail twin sends its input with Window.synthesizeMouseEvent, and a check reads every chrome call against Mozilla's sources
The four cases of wrapper.e2e.stock_twin.tooltip died on the engine candidate with "win.windowUtils.sendMouseEvent is not a function": Firefox 159 has no
nsIDOMWindowUtils.sendMouseEvent, its chrome input is Window.synthesizeMouseEvent. SEND_JS of the retail reference now calls
win.synthesizeMouseEvent(type, x, y, {button, clickCount, modifiers, inputSource}, {ignoreRootScrollFrame, isDOMEventSynthesized}), with Mozilla's own field names
and the same offsets (CSS pixels of the browser window).

Static check, no browser: scripts/extract_mozilla_chrome_api.py reads nsIDOMWindowUtils.idl and Window.webidl at the release tag into ci/mozilla-chrome-api.json
(path, tag, commit and sha256 of each source; what only our engine tree has is listed apart under "ours"). tests/test_the_chrome_calls_of_the_tests_exist_in_firefox.py
scans the strings of every test and script for windowUtils.<name>, .synthesize<...>( and the keys of the dictionaries those calls pass: a name that no Firefox
has is red, a name only our engine has is red in code that runs on retail or stock Firefox. Red on the old SEND_JS (sendMouseEvent is not in 159), green on this
one. The extractor has its own unit test on a small IDL and WebIDL sample.

Both files join wrapper.unit.all.linux and wrapper.unit.all.windows, min_tests raised by 18 each (12 + 6).
2026-11-29 10:40:14 +01:00
feder-cr 3e082e07d7 tests: the stack watchdog's log lands in the evidence folder that every job uploads
INVPW_TEST_WATCHDOG_FILE is set only by the wrapper's own e2e workflow, so a run of the gate
wrote the stacks of a hung test to the temporary folder, which nothing uploads, and they were
gone with the runner. With RUNNER_TEMP set and no file named, the log is now
$RUNNER_TEMP/invpw-evidence/watchdog/e2e-watchdog.log, inside the folder the gate keeps as
"what the tests saved"; a named file still wins, and off a runner nothing changes.

Regression test (5 tests, red on the old files: the module does not exist and conftest.py
opens the temporary folder). In the two unit rows: 4205 -> 4210 on Linux, 4217 -> 4222 on
Windows (not OS-specific).
2026-11-29 08:59:28 +01:00
feder-cr 3366497f7d tests: the twins open their page before they ask Marionette for a session
The wrapper launches the engine with -silent, so there is no window at start-up, and
Marionette's WebDriver:NewSession is answered only when the browser's start-up ends, which
only a window ends. run_retail_twin and _on_ours created Chrome() before browser.new_page(),
so the session never got its answer and the socket timed out after 300 s (every retail twin
and every stock twin of the engine candidate).

Chrome now takes the page of the launch as a required argument, so the wrong order cannot be
written, and both twins open the page first. scales() reads that page.

Regression test (red on the old files, 4 of 9 fail): an ast scan of every test and script
refuses a function that asks for a session before its first new_page; the scan is itself
proved on the old order; a fake Marionette that answers NewSession only once a window exists
shows _on_ours and run_retail_twin get their answer. In the two unit rows: 4196 -> 4205 on
Linux, 4208 -> 4217 on Windows (9 tests, not OS-specific).
2026-11-29 08:59:28 +01:00
feder-cr aaf5863598 ci: the host oracle takes each side's own install folder as that side's own package, and the row of the graphics probe is out of the file
Engine final candidate (run 46227711139), ab_host on Linux, two defects of the harness:

1. DIFF on invisible_core/branding/official/branding.zip: <published set venv>/site-packages/... on the published side, <hostedtoolcache python>/site-packages/... on the candidate's.
   Each side's engine reads the branding of ITS OWN core, in the folder that core is installed in, and since the control side is the published set (0b23228e) the two folders
   differ. The classifier knew one own package, the folder of the engine. It now also knows the install folders of the python that runs the side (ci_ab_host.install_folders:
   sysconfig's purelib and platlib, the link and the real folder; the side's launch runs in that side's python), in the same class `package`, so the same read is the same
   file of the package on both sides and no path is named. Anything else stays the host's and red: the other side's folder, the python's own library under the same prefix,
   a sibling folder that only starts with the same text, any path declared nowhere.
2. FAIL the declared difference 'gfxtest-69' ... is stale, remove it: the published engine is the 70, which no longer spawns gfxtest either. ci/ab-host-expected.json declares nothing.
   The mechanism of a declared `proc` difference is tested with the row as a row of the tests' own (tests/_ab_host_declared.py), and a test takes the run's case as data: a row that
   does not show is red as stale, in the wording of the run, and the same run is green against the empty file.

tests/test_ab_host.py (+10, 9 of them red on the old classifier): the pair of the run is the same package on both sides and no difference; each of five reads outside a side's own
install folder is a difference; the install folders of a process; the stale row. tests/test_ab_oracle.py: the new helper is one of the host oracle's files for a pull request.
wrapper.unit.all.linux 4196 and wrapper.unit.all.windows 4208 (+11).
2026-11-29 08:59:28 +01:00
feder-cr dfd35bb47e ci: the page oracle's A/B allows the differences a release is known to make, declared per os, seed, dpr and leaf, and is red on a row that does not show
Engine final candidate (run 46227711139): ab_oracle was red on Linux and Windows on the same 24 differences, all of them the bar of a main window above the content.
Seed 6 at 1.25: the bar is 106 device px as retail Firefox 159 measures it, the published engine's core said 107; the candidate's core rounds the bar once on the sum in app units
(window_frame.chrome_height_device). Seed 63 at 1.5: the work area is under 720 CSS px, so retail chooses the compact density by itself (browser.js gUIDensity) and the bar is
73 CSS px, not the normal 85 (constants.ui_density, window_frame.chrome_height_device(1.5, 'compact')).

- ci/ab-oracle-expected.json (ab-oracle-expected/1): 48 rows, one per os x seed x leaf of those 24 (Linux and Windows read the same), each with exactly id, os, seed, dpr, leaf,
  published, candidate and reason (the retail source, the core function that produces the value, what the leaf is).
- scripts/ci_ab_oracle.py: the A/B (run, run_ab, compare) allows a difference only when a row matches it exactly (os of the leg, seed, dpr, leaf and both values); any other
  difference is red, and so is a row that does not show in the run (stale: "remove it", the wording of the host oracle). The rows apply to the A/B only: the A/A is judged without
  them. A row of a visit the run did not make (another shard or seed set) is not judged. The rows name no tag: when the published set moves to the release that holds the work, the two
  sides agree, every row is stale and the check forces them out. compare takes --leg (default: this machine's).
- tests/test_ab_oracle_declared_differences.py (16, red on the old judge) with the 24 DIFF lines of the run as data: the old judge is red on them and the new one green with the
  rows; an undeclared extra difference, another value than the row's, another seed, dpr or os, are red; a stale row is red; the A/A ignores the rows; the file's keys and rows.
  tests/test_ab_oracle.py: the fake pages of its tests have no rows (a fixture), the leg of one test is a real leg, and the file of the rows is one of the oracle's files for a pull request.
- wrapper.unit.all.linux 4185 and wrapper.unit.all.windows 4197 (+17: the 16 tests and the case of the new file in the oracle's pull-request file list).
2026-11-29 08:48:49 +01:00
feder-cr 76c33a9e0a tests: the stock browser and the retail reference of the twins get a display from the wrapper's mechanism
The engine gate runs the stock twin rows' pytest without xvfb-run (only wrapper.e2e.suite.* rows get it), and the docstrings said the browsers drew on "the display of the job".
Ours gets a display of its own from the wrapper (make_virtual_display, started per session), so ours drew and stock and retail died on Linux with
"no DISPLAY environment variable specified" (wrapper.e2e.stock_twin.intersection, all four cases).

_stock_twin.OwnDisplay starts the core's make_virtual_display() on Linux (1920x1080x24 Xvfb, access control on), one per launch, and gives the browser's environment its
DISPLAY and XAUTHORITY (the Wayland variables removed), stopped after the browser, also when the launch fails. Stock gets it through the env of p.firefox.launch, the retail
reference through its Popen env. On Windows nothing is made: a stock client cannot be spawned on another desktop. The docstrings of _stock_twin, _retail_reference and the
select and tooltip twins say what is true.

test_the_stock_and_retail_browsers_get_a_display_from_the_wrapper.py (4 tests, red on the old code) is in wrapper.unit.all.linux and wrapper.unit.all.windows, min_tests +4 each.
_fake_stock_playwright.py is the recorder both unit files of the stock twin share.

The exact counts of the two unit rows are corrected by 2: since the published-set commit the two rows were 2 below the real collect (the new published-set.yml workflow adds one case to
test_ci_linux_legs_read_no_mirror.py and one to test_ci_windows_temp_is_on_d.py, which are parametrized by workflow file, and that commit counted only the 36 tests of its own file).
wrapper.unit.all.linux is 4168 and wrapper.unit.all.windows is 4180, as the run of the engine's final candidate collected (4160 and 4172) plus the 8 of the two commits above.
2026-11-29 07:44:35 +01:00
feder-cr ce6db02d36 tests: the stock twins get layout.css.devPixelsPerPx as the string ours gets
The pref is a string pref of Firefox. The stock client sends user prefs through Browser.enable and Playwright's Juggler sets a number with setIntPref, so
the float of the case failed every stock twin launch on Windows with NS_ERROR_UNEXPECTED [nsIPrefBranch.setIntPref], a broken control on all four cases.
Stock now gets the scale from _window_origin.scale_pref, the form the core declares for ours (str(profile.screen.dpr)).

test_the_stock_twin_gets_the_display_scale_as_ours_does.py records the stock launch and compares it with ours composed by the core for each of the four cases
(4 tests, red on the number the old code passed); it is in wrapper.unit.all.linux and wrapper.unit.all.windows, min_tests +4 each.
2026-11-29 07:32:38 +01:00
feder-cr a1711b9802 ci: the published set is installed from published/ only, by hash, checked with pip check, and verify names the file installed
The wheelhouse's own folder holds the candidate's wheels of invisible-core and invisible-playwright,
built from core_ref and wrapper_ref; at an equal version they have the file names of the published
ones. With real pip, two --find-links and --require-hashes take the first local file of a name and
fail on a hash mismatch, they do not choose by hash.

- install: the gate lock's dependencies from the wheelhouse, then the two published wheels from
  <house>/published ONLY (one --find-links per pip call, --no-deps, by the hashes of
  ci/py-lock/published.txt), then pip check over the venv with the set's python: red, with what pip
  reports, when a requirement of the published wheels is not met. The wheel of each package is
  chosen by the sha256 the lock holds (a file with the name and another hash is refused, naming both)
  and recorded with the digest of its package files in <venv>/published-set.json.
- verify: reads that record and the disk. It names the file installed (wheel name, sha256), is red
  when that sha256 is not one the lock holds (naming both), and when a file of the package on disk is
  not, byte for byte, the wheel's. A version says nothing of which file is installed.
- tests (real pip, offline, wheels made with zipfile): the same name and version in the house root
  (the candidate's) and in published/ installs the published one and verify is green; a venv holding
  the candidate's wheels is red naming the file, its sha256 and the lock's; a record that says
  published over candidate bytes is red; a lock naming neither is red; a published wheel requiring
  what the house lacks is red at pip check, the normal house green. 42 tests in the file (+6), the
  rows of the whole unit suite raised by 6.

Red on the old install: the real-pip same-name test fails with pip's "THESE PACKAGES DO NOT MATCH
THE HASHES FROM THE REQUIREMENTS FILE" on the candidate's wheel of the same name (8 of the 42 fail
on the previous script).
2026-11-29 05:52:46 +01:00
feder-cr c4dbbe8faf ci: the stock twin row is four rows, one file and one leg each
The row wrapper.e2e.stock_twin (4 files, 20 tests) ran past the 25 minutes of a leg. It is now wrapper.e2e.stock_twin.dnd (4 tests),
.select (4), .tooltip (4) and .intersection (8), each with the file, the marker, the systems and stock_firefox of the old row, and the old note split by file.
The table of leg fields, the accounting of the e2e suite and the retail reference's messages name the new rows.
2026-11-29 03:54:02 +01:00
feder-cr b916990a33 e2e: a popup moved to the far right stops where retail's does, the capture's numbers per case
The phase ran moveBy(10, 10) and moveTo(99999, 0) in one popup and expected availLeft + availWidth - outerWidth, which is not retail's clamp:
Mozilla's CheckSecurityLeftAndTop uses the outer width rounded by its edges (CSSIntRect::Round), then the device rounding and the read-back.
The phase now runs the sequence of the retail capture (popup_move_resize, retail-window-geometry, Firefox 159.0) and expects the screenX and screenY
retail read after each call, per case, with the derivation for scale 1.25 written next to the table.
2026-11-29 03:50:11 +01:00
feder-cr 0b23228eb8 ci: the control side of every A/B oracle is the published set, as a user installs it
Engine candidate 5 (run 46208549074): ab_oracle, ab_network and ab_host were all red on a BROKEN
CONTROL. The published engine (labelled firefox-68, a tag written in the harness, when firefox-70
was the last published) was launched by the CANDIDATE's core, which no longer declares
zoom.stealth.screen.popup_position, and the engine refuses a launch whose declarations its core does
not emit (rule 7). A pairing no user has.

The control is now the set a user gets: the last invisible-playwright on the index, the
invisible-core it pins exactly, the engine that core's seal pins, in a venv of their own.

- ci/py-lock/published.txt: the set as a hash lock (every file of the two versions, the requirements
  each declares); scripts/ci_published_set.py makes it (resolve), compares it with the index (check),
  installs it offline over the gate's lock from the run's wheelhouse (install) and verifies what the
  venv imports (verify); fetch/tag run BY the set's python: its own core fetches its own engine.
- .github/workflows/published-set.yml: daily and on a pull request that touches the lock, red when
  the committed lock is not the index's last release.
- ci_ab_oracle, ci_ab_host, ci_ab_network: the published side runs in the set's python
  (INVPW_PUBLISHED_PYTHON) with an environment that carries nothing of the candidate's job
  (PYTHONPATH, VIRTUAL_ENV, its seal, its pin switches); the candidate side is unchanged. No tag is
  written in a harness file: the label and the file names (dump-<N>.json, ...) come from the seal of
  the set. A candidate without a set is refused, never run against its own core.
- ci_poison_host: the by-product files are named for the tag of the set as well.
- tests/test_ci_published_set.py (36, in wrapper.unit.all.linux and .windows): the defect on fake
  cores and a fake engine that refuses as rule 7 (red on the old harness with that refusal), the
  three seams, the lock on known-bad inputs, the resolver on synthetic index documents, the install
  commands, no tag written in a harness file.

Red on the old harness: the defect test fails with "stealth: zoom.stealth.screen.popup_position is
not declared by the core candidate-core (rule 7)" on the scripts of df491f2e. The regression
registry of the wrapper is not on this base: its row follows with the registry.
2026-11-29 03:40:21 +01:00
feder-cr df491f2e67 Merge commit '8e342a1378e9da0a8e6340411f42dbe66c39a5ed' into candidate/wrapper-71-final 2026-11-29 01:48:12 +01:00
feder-cr 8e342a1378 tests: the e2e stack watchdog holds the GIL (a Python thread), not faulthandler's dump_traceback_later, whose GIL-free copy of every thread's frames crashed the Windows part 3 worker
Five workers of the Windows part 3 of the e2e died, all on tests/test_fakeweb_p4_e2e.py::test_the_journey_leaves_every_page_only_once_its_noise_is_done, which runs 122-171 s with about 50 threads. tests/conftest.py armed faulthandler.dump_traceback_later(150 s, repeat=True) for every e2e test: a C thread that copies the frames of every thread WITHOUT the GIL (_Py_DumpTracebackThreads, documented "for debug purpose only ... after a segmentation fault, at fatal error") while the process keeps running and the other threads keep changing their frames. Two full dumps of a crashed worker show the process dead inside dump_frame, called from faulthandler_thread, reading a frame another thread was changing.

tests/_stack_watchdog.py is the same watchdog as a Python daemon thread: one per process, reused by every test; arm(nodeid, threshold_s, period_s, file) and cancel(); past the threshold, and then every period until cancelled, it writes "Timeout (h:mm:ss)!" and the frames of every thread (sys._current_frames(), holding the GIL, threads named from threading.enumerate()) to the same e2e-watchdog.log, in the format of faulthandler's dump; nothing to stdout or stderr; nothing after cancel() returns. Known limit, in the module: a thread that never releases the GIL keeps it from writing, which is pytest's faulthandler.enable() at the death of the process. tests/conftest.py calls it in place of dump_traceback_later and cancel_dump_traceback_later (setup, teardown, unconfigure).

Tests (all in the rows of wrapper.unit.all.linux and wrapper.unit.all.windows, min_tests 4061 -> 4116 and 4073 -> 4128, counted with the selector of the judge):
- tests/test_no_file_arms_a_gil_free_thread_dump.py: no .py of tests/, scripts/ or src/ calls faulthandler.dump_traceback_later, or dump_traceback with all_threads true or defaulted (ast, through any import form); pytest's faulthandler_timeout is set in no pyproject, pytest.ini, setup.cfg, tox.ini, conftest string, script string or workflow line (parsers, not text). Red on the conftest of 03425bb8, naming tests/conftest.py and the line, with how to fix and the rule; each form has its known-bad and its green twin. The only exclusion is norecursedirs of pyproject.toml.
- tests/test_the_stack_watchdog_writes_every_thread_after_its_threshold.py: in a child python, a blocked call gets the header and the stack of every thread, a test cancelled before its threshold leaves no dump, nothing is written after cancel (judged on the bytes of the file, waiting on the second test's first dump), the second test reuses the thread.
- tests/test_a_gil_free_thread_dump_kills_a_busy_process_and_the_stack_watchdog_does_not.py: 32 threads churning frames; dump_traceback_later at 1 ms ends the child with a crash status (red on the old mechanism), the new watchdog at a 1 ms period lets it run 6 s (60 times longer) and writes its dumps.
2026-11-29 01:20:27 +01:00
feder-cr 03425bb898 ci: every pytest process of a Windows e2e job clears SEM_NOGPFAULTERRORBOX, so a crashing worker reaches the LocalDumps
#629 sets WER LocalDumps for python.exe in each Windows e2e job, and a crashing pytest-xdist worker still left no dump. The pytest controllers of the runner are born with the
error mode 0x0003 (SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX), every child inherits the mode of its parent, and a process with SEM_NOGPFAULTERRORBOX (0x0002) never
invokes Windows Error Reporting, so no worker crash reached LocalDumps.
https://learn.microsoft.com/windows/win32/api/errhandlingapi/nf-errhandlingapi-seterrormode

The "Windows Error Reporting keeps a full dump..." step of each Windows job now also exports INVPW_WER_DUMPS=<the dumps folder> to $GITHUB_ENV. tests/conftest.py calls
tests/_wer_error_mode.py in pytest_configure (the controller and every xdist worker run it): when that variable names an existing folder on Windows, the process clears bit
0x0002 of its error mode and keeps the others, and appends "pid <n> error mode born 0x.., now 0x.." to invpw-evidence/dumps/error-mode.log. Nothing is written to stdout or
stderr, and nothing happens on Linux or in a job that did not set LocalDumps.

Tests: the rule test of the Windows jobs (tests/test_every_windows_job_keeps_a_dump_of_a_crashing_python.py) now requires the export in the LocalDumps step of every Windows
job, with the folder of DumpFolder and no other place that sets it (red on the previous e2e.yml, naming the job); a real child python born with 0x0003 (and 0x8003, 0x0002,
0x0001, 0x0000) ends with the born mode minus 0x0002 and leaves its evidence line, and without the variable or with a missing folder the mode is unchanged
(tests/test_every_pytest_process_clears_the_gp_fault_error_box_on_windows.py, a Windows file: only the row of Windows names it, min_tests 4061 on Linux, 4073 on Windows).
2026-11-29 00:34:35 +01:00
feder-cr 67b2ad3188 tests: the table of the leg fields carries the stock_firefox of the row wrapper.e2e.stock_twin, which the gate reads 2026-11-28 22:30:13 +01:00
feder-cr fe50cdc118 e2e: the retail reference gets the outer size of ours before anything is measured and both inner sizes are compared (a difference is a broken control); the launcher and the messages cover the Linux binary (firefox, no .exe, the job's display) 2026-11-28 21:52:21 +01:00
feder-cr e4aa743af3 e2e: the select dropdown and the tooltip are measured against RETAIL Firefox 159 driven by Marionette alone, headed (tests/_retail_reference.py, INVPW_RETAIL_FIREFOX set by the leg), not against Playwright's own Firefox; the tooltip joins the row wrapper.e2e.stock_twin (20 tests) and its rule is a cross-check in the record 2026-11-28 21:41:56 +01:00
feder-cr 5298149cd0 e2e: the stock twin runs headed, in the mode of ours (a real window on the display of the job), not in Firefox's headless mode 2026-11-28 21:36:40 +01:00
feder-cr 9140845e4d e2e: the select, drag and IntersectionObserver/lazy-frame tests are stock twins (the same steps on Playwright's own Firefox first, ours second, the verdict is the same as stock), in the new row wrapper.e2e.stock_twin (stock_firefox) and out of the whole-suite rows; each record keeps the page's and the chrome's devicePixelRatio and the real screen scale 2026-11-28 21:35:33 +01:00
feder-cr cb67c18332 e2e: a popup's position is Firefox's own rule (retail round 5: 4, 4 at scale 1.0), no popup_position pref is set; the second popup's stagger waits for capture round 8 2026-11-28 21:35:33 +01:00
feder-cr 652c911514 persona_cover: popup_client_top is a pref of the dpr dimension, the ui_normal and ui_compact rows of DERIVED go (no core writes them), persona-seeds.json regenerated with the core of c58efd7 2026-11-28 21:28:31 +01:00
feder-cr 229cfb7da2 Merge remote-tracking branch 'origin/main' into e2e/oop-frame-71
# Conflicts:
#	ci/required-suites.json
2026-11-28 20:47:26 +01:00
feder-cr 3259840c7c e2e: the tooltip's vertical offset is computed by Firefox's own rule (kDefaultTooltipOffset scaled by the system cursor size on Windows), not typed as 21 2026-11-28 19:56:28 +01:00
feder-cr c39a976a44 e2e: a tooltip opens at the real pointer, in the top document and in a frame of another site, at the four scales (red without the tooltip map), in the rows of the maximized-window test 2026-11-28 19:54:44 +01:00
Federico Elia df35204915 Merge pull request #629 from oss-invisible/ci/windows-worker-dumps
ci: every Windows e2e job leaves a full dump of a crashing python.exe in its evidence
2026-11-28 19:06:47 +01:00
feder-cr de9c19b578 ci: every Windows e2e job leaves a full dump of a crashing python.exe in its evidence
A pytest-xdist worker (python.exe) dies on the Windows e2e jobs with "node down: Not properly terminated" (a native "Windows fatal exception: access violation",
jobs 138402013609 and 138966622085) and nothing names the faulting native module. Each of the six Windows jobs that run pytest now sets, before its tests,
HKLM\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps\python.exe (DumpType 2 = full, DumpCount 3, DumpFolder RUNNER_TEMP/invpw-evidence/dumps/python,
WER made enabled, no dialog), so the dump travels in the evidence artifact the job already uploads (the Control+A job gets that upload). After the tests
scripts/ci_wer_dumps.py lists the dumps with their size and reads the minidump header (thread, exception code, faulting module+offset, failed access) into summary.txt.
Docs: https://learn.microsoft.com/windows/win32/wer/collecting-user-mode-dumps

Tests: the Windows jobs' rule test (red on the previous e2e.yml) and the reader on a synthetic minidump.
2026-11-28 18:39:32 +01:00
feder-cr 678978399c e2e: three new test files stored with LF, as the index of the repository has them (they were committed with CRLF) 2026-11-28 02:40:48 +01:00
feder-cr 310b88e81d e2e: the input test takes no tolerance: clientX/clientY of every click, hover, drag and wheel equal the requested whole CSS point exactly, and the message prints the requested point, the received one and the scale 2026-11-28 02:40:28 +01:00
feder-cr 6f84d62290 e2e: a page cannot reach the three chrome-only methods of the window-origin map (window, document, reachable objects, prototype chains, CanonicalBrowsingContext), in the rows of the maximized-window test 2026-11-28 02:40:28 +01:00
feder-cr eb2629fea1 e2e: the consumers of the window origin (early readings of a frame, popup moveBy/resizeBy/moveTo, drag into a frame, IntersectionObserver and lazy loading in a frame, input at four scales, select dropdown anchor), in the rows of the maximized-window test 2026-11-28 01:26:31 +01:00
Federico Elia 465386fd7d Merge pull request #625 from oss-invisible/tests/webgl-reference-on-our-gl
tests: the control launch of two WebGL e2e tests runs on the engine's own GL
2026-11-28 00:15:47 +01:00
feder-cr ce55e15e60 Merge remote-tracking branch 'origin/main' into tests/webgl-reference-on-our-gl
# Conflicts:
#	ci/required-suites.json
2026-11-27 23:45:45 +01:00
Federico Elia 21b5276c4d Merge pull request #624 from oss-invisible/tests/neutral-names-for-public-pages
tests: neutral names for the tests of public fingerprint and detector pages; one bundle and its two tests removed
2026-11-27 23:35:33 +01:00
feder-cr abfc2d2764 tests: the host-GL probe test writes down the page's WebGL at engine off and does not judge it
With the engine off the context comes from the host's Mesa, which a runner may not
serve (hunt run 45998187350: once in 3083 launches). The page still asks for WebGL,
which is what makes Firefox read GfxInfo; with the engine declared a missing context
is still red.
2026-11-27 23:35:16 +01:00
feder-cr 025ae12b72 tests: the control launch of two WebGL e2e tests runs on the engine's own GL
The control of the non-premultiplied WebGL canvas test and of the createPattern projection test had the engine off
(hw_seed 0), so WebGL ran on the host's Mesa: once in 3503 launches a runner gave no context. The control now keeps the
engine on, with the same declared GPU, and declares only the canvas noise off (zoom.stealth.canvas.substitute_pixels
false), as test_webgl_noise_active.py does. Both launches of both files, on Linux, check the maps of the engine's
processes with the rule of test_webgl_draws_on_the_engine_s_own_gl, now written once in engine_process_tree.py.
2026-11-27 23:17:13 +01:00
feder-cr 28841856d0 tests/vendor: the rules scanner's MIT notice is the copyright holder and year and the full permission text, verbatim from upstream; the contact address is left out (pm, 27/11) 2026-11-27 21:01:47 +01:00
feder-cr 9ba446ed3c e2e: the maximized window, its frames (also transformed) and its popups read as retail
The restored-window part of the retail window-geometry test is dropped
with the feature. What stays is read against retail Firefox 159.0 on
Windows at the four display scales: the maximized window and its probe
(round 4), fullscreen in and out from it, the same-origin and cross-site
frames and the popups (round 5).

New, from round 6 (GitHub run oss-invisible/core 46052782097,
RetailCaptures 4a37f5f, WINDOW_GEOMETRY_TRANSFORMED_FRAME.csv): a
cross-site frame under scale(1.5) and under rotate(10deg), one at a time,
read from inside after three real mouse moves to retail's CSS points. Its
mozInnerScreen equals retail's, and clientX/Y and screenX/Y equal retail's
at scale 1.0 and are within one pixel at the others.

A cross-site frame that reads the top's own mozInnerScreen now fails by
name: the out-of-process frame lost its own place in the top.

Registered in wrapper.e2e.suite.linux.3 and wrapper.e2e.suite.windows.4
with four tests each.
2026-11-27 20:56:16 +01:00
feder-cr 5e535d9faa tests/vendor: the headless detector bundle and its one test are removed (its required licence notice cannot ship without a studied system's name, and the local scanner is not changed); the rules scanner carries its upstream MIT notice verbatim in its header; min_tests of wrapper.e2e.suite.linux.1 (-2), wrapper.e2e.suite.windows.1 (-1), wrapper.e2e.suite.windows.4 (-1), wrapper.e2e.realness (-1) lowered by the tests removed (the headless detector test and the realness test that loaded its page) 2026-11-27 20:51:40 +01:00
feder-cr 0c43c7ec60 tests/vendor: the two upstream notices are left out until their place is decided; the README stays neutral 2026-11-27 20:51:28 +01:00
feder-cr 08f7fd91c7 tests: the licence notices of the two vendored bundles without a header are copied verbatim from the upstream LICENSE at the commit of the vendored version 2026-11-27 20:51:28 +01:00
feder-cr 90449bbdb2 tests: the README of the vendored bundles lists each with version, license, sha256 and where its licence notice lives; a test is red if a bundle changes without its row; unit counts +3 2026-11-27 20:51:28 +01:00
feder-cr dbdd7c7c6d tests: neutral names for the tests of public fingerprint and detector pages (file, functions, ids, references); behaviour and counts unchanged 2026-11-27 20:51:07 +01:00
Federico Elia 244fdcf0a8 Merge pull request #621 from oss-invisible/ci/retired-tests-by-nodeid
ci_verdict: retired single tests by nodeid, each declared once against the floor it lowers
2026-11-27 20:20:57 +01:00
feder-cr 53b5a1ef17 ci_verdict: a retired-test entry carries from_min_tests and allows its drop only while main's floor of the suite is still that value, so it is inert once the removal is on main; the five entries are written at 449, 333, 274 and 32 2026-11-27 13:42:20 +01:00
feder-cr eef12eb659 ci_verdict: ci/retired-tests.json declares single retired tests (nodeid, suite, count, reason, decided_by); a floor drops by exactly the declared count, any other lost test stays red; the entries of the two tests the rename removes 2026-11-27 13:42:20 +01:00
Federico Elia 54ce892a60 record 0.60.0 as published (#618) 2026-11-27 13:41:57 +01:00
Federico Elia f3f35ea0c3 Merge pull request #619 from oss-invisible/ci/install-job-deps-from-lock
user-install: the install-from-index harness comes from the hashed lock; every module the tests import is held to it
2026-11-27 13:06:40 +01:00
feder-cr 11c1b4573f CHANGELOG: 0.60.0 is dated 2026-11-27, the UTC day of its upload to the index (the line the ledger PR writes) 2026-11-27 08:09:12 +01:00
feder-cr 8a6ef83ef4 user-install: the harness comment names the helper and the rule test in words, not by path (the install-job gate reads every tests/ path of the file as a test the job runs) 2026-11-27 08:09:12 +01:00
feder-cr 4b97532753 user-install: the test harness of the install-from-index job comes from the wrapper's hashed lock, and a rule test holds every third-party module the tests import to that lock (psutil was missing, ledger PR #618) 2026-11-27 08:09:12 +01:00
Federico Elia 67648a9eb6 Merge pull request #617 from oss-invisible/tests/fission-frames-evidence
tests/fission frames: every test of the module keeps the module's evidence when it fails
2026-11-27 07:39:45 +01:00
feder-cr b4f7cde592 Merge remote-tracking branch 'origin/main' into tests/fission-frames-evidence 2026-11-27 07:07:10 +01:00
Federico Elia fb8a407084 Merge pull request #607 from oss-invisible/tests/webgl-engine-off-evidence
tests/canvas: an engine-off WebGL canvas that cannot be made says why, and the run keeps its gfx log
2026-11-27 00:27:59 +01:00
feder-cr 603ca155c9 tests/fission frames: every test of the module keeps the module's evidence when it fails (the wire, the engine trace, every frame's lifecycle)
Main run 45823271010 (linux part 1) saw the goto of /workers (A, its frame B, B's frame C: three processes) reach commit and domcontentloaded but not load in 30 s, with nothing in flight, in test_a_dedicated_worker_reports_the_identity_of_the_window_in_every_frame[blob]. The module arms FailureEvidence for all of its tests but only the one test that opened OnFailure saved it: that run kept nothing. Each test now runs in OnFailure with its page listened to (frameattached / framenavigated / framedetached, domcontentloaded, load). Diagnostic only: no wait or assertion changes; the 9 e2e nodes are the same.
2026-11-26 23:54:25 +01:00
feder-cr d12d722975 Merge remote-tracking branch 'origin/main' into tests/webgl-engine-off-evidence
# Conflicts:
#	ci/required-suites.json
2026-11-26 23:52:46 +01:00
Federico Elia c5709c6bd8 Merge pull request #616 from oss-invisible/release/0.60.0-firefox-70
release 0.60.0: pins invisible-core 70.83.0 on the engine firefox-70
2026-11-26 23:07:32 +01:00
feder-cr b39b7f65e1 release 0.60.0: the gate lock names core 70.83.0 (no locked distribution changes), the CHANGELOG heading is dated 2026-11-26 22:05:21 +01:00
feder-cr 1d21e84954 release 0.60.0: pins invisible-core 70.83.0 (engine firefox-70); persona seeds for that core 2026-11-26 21:55:59 +01:00
feder-cr 6e3e166bb7 CHANGELOG 0.60.0: the restored-window frame leaves (it ships with firefox-71) 2026-11-26 19:18:39 +01:00
feder-cr 91346ececc release 0.60.0: version and changelog (the unpublished 0.59.1 entry folds into 0.60.0; the core version and the engine tag are placeholders until they are published) 2026-11-26 19:18:32 +01:00
Federico Elia cccef5dadb Merge pull request #547 from oss-invisible/ci/windows-temp-on-d
ci: on Windows the browser's profiles and temp files go on D:, not on the saturated C:
2026-11-26 13:49:28 +01:00
feder-cr bb610da22e ci: the four Windows e2e jobs added since (network, host, page oracle, final seeds) also keep TEMP and TMP on D:
tests/test_ci_windows_temp_is_on_d.py was red on them on today's main (e2e-network-windows, e2e-host-windows,
e2e-page-windows, e2e-page-final-windows had TEMP on C:); green with the job env every other Windows job has.
2026-11-26 13:14:38 +01:00
feder-cr c3c1fcee2a ci: the unit rows count the test of the Windows temp folder (3949 -> 3964, 3953 -> 3968) 2026-11-26 13:14:38 +01:00
feder-cr c1b9c5392d Windows jobs keep the browser profiles on D:, not on C:
The profile of every Firefox the tests launch is made in TEMP. On the GitHub
Windows runners TEMP is on C:, and four browsers at once saturate that disk
(queue up to 144, latencies up to 4 s): the parent's main thread stays still
40-60 s and the e2e fail at random. Hunt of 20/11: profiles on C: took 5 of
4 shards, TEMP and TMP on D:\a\_temp took none.

Every Windows job that launches a browser (e2e, e2e-hunt, fakeweb, tests,
firefox-launch-matrix, real-sites, user-install) sets TEMP and TMP to
D:\a\_temp in its job env (matrix jobs: D: on Windows, /tmp on Linux).
tests/test_ci_windows_temp_is_on_d.py fails on the workflows of main.
2026-11-26 13:14:28 +01:00
Federico Elia cb31015dd5 Merge pull request #575 from oss-invisible/fix/screenshot-refuses-what-would-touch-the-page
Screenshot refuses by name the parameters Playwright honours by modifying the page
2026-11-26 13:14:09 +01:00
feder-cr 6834f16734 CHANGELOG 0.59.1: the screenshot refusal joins the entry #606 opened (the version is already 0.59.1 on main) 2026-11-26 12:45:10 +01:00
feder-cr d348c347f6 tests: omitBackground with png is compared with stock's exact first line, the API name included
The e2e asserted `^Not implemented`, and the client prefixes every server error with the API name, so the line is
`Page.screenshot: Not implemented` (and `Locator.screenshot`, `ElementHandle.screenshot`): red on every system in run 45081196889.
Stock Playwright 1.61.1 answers the same line: `FFPage.setBackgroundColor` throws `new Error("Not implemented")` and the Python
client writes `f"{apiName}: {error}"`. The test now compares the first line with that exact text for each way of asking.
2026-11-26 12:45:10 +01:00
feder-cr fe26fca02c fix: a refused screenshot of an element or a locator is refused before the page is scrolled or measured
The refusals of mask, style, animations="disabled", caret="initial" and omitBackground with png were inside PageDispatcher.op_screenshot, which the element's
screenshot reaches only after scrolling the element into view, taking its box and reading the document's scroll: a call that was going to be refused had moved the
page. They are now one function, _refuse_unserved_screenshot_parameters, called first by the page's screenshot and first by the element's (a locator's is the
element's). It reads the parameters and nothing else, so the element's second pass through the page's is the same answer. The required-suites counts follow the
13 unit and 10 e2e tests added.
2026-11-26 12:45:10 +01:00
feder-cr 2206289d7e tests: a refused screenshot of an element or a locator neither scrolls nor measures the page (red: the refusal came after the scroll)
ElementHandleDispatcher.op_screenshot scrolled the element into view, took its box and read the document's scroll before handing the call to the page's
screenshot, where the refusal of mask, style, animations="disabled", caret="initial" and omitBackground with png is. A refused call therefore moved the page. Unit:
for each refused parameter the element's call sends nothing to the engine, not a scroll, not a measure, not a picture (the page's call is held to the same, and the
call that is taken still scrolls and measures first). E2E: on a page scrolled to a known position with the element below the fold, a refused locator.screenshot and
element.screenshot leave window.scrollY as it was; the same call without the parameter does scroll.
2026-11-26 12:45:09 +01:00
feder-cr 3b362bab4b fix: a screenshot refuses what Playwright does by modifying the page: mask, style, animations="disabled", caret="initial"
PageDispatcher.op_screenshot never read these parameters, so the call succeeded with a picture that ignored them. It now refuses each by name with what to do
instead, and answers Firefox's own `Not implemented` for omitBackground with png (jpeg is a no-op, as in stock). caret="hide" and an absent caret are served: the
engine never draws the caret, which is what stock's default produces. The element's and a locator's screenshot reach the same call. The sentences are declared by
(operation, parameter) in perimeter.REFUSED_PARAMETERS and raised through _refuse_parameter, which the declared-refusals test holds to that table both ways.
2026-11-26 12:45:09 +01:00
feder-cr 020fe74328 tests: a screenshot refuses what would touch the page (red: mask, style, animations, caret="initial" and omitBackground were silently ignored)
Stock Playwright takes mask, style and animations="disabled" by modifying the page and draws the caret only for "initial"; its Firefox throws "Not implemented" for
omitBackground with png. PageDispatcher.op_screenshot never read any of them, so the call succeeded with a picture that ignored the parameter. Unit: the page, full
page, clip, element and locator calls refuse each parameter by name (and what is harmless passes), omitBackground png answers "Not implemented"; the refusals are
declared by (operation, parameter) in perimeter.REFUSED_PARAMETERS, both directions. E2E: the same through the client on a page, a locator and an element handle, the
page left untouched, and a measurement that no caret is in the picture with caret absent and "hide". Registered in wrapper.unit.all.* and wrapper.e2e.suite.{linux,windows}.1.
2026-11-26 12:45:09 +01:00
Federico Elia 250ac6919d Merge pull request #615 from oss-invisible/tests/the-tree-guard-names-the-launch-by-its-line-not-by-the-clock
tests: the tree guard's launch time is judged from the launch line, not by a window of seconds
2026-11-26 12:44:52 +01:00
feder-cr 444cf1128d tests: a process that exits between being listed and being read is gone for the tree guard's test, not an error
Wrapper #603's round (pytest ubuntu py3.13, job 139861116959): the same test failed with `psutil.NoSuchProcess: process PID
not found` from its helper `_alive`, which asked `pid_exists` and then `Process(pid).status()`: the grandchild the guard had
just killed was there for the first question and gone for the second. The guard itself already treats such a process as
gone (`kill_tree` suppresses `NoSuchProcess` and `psutil.Error`); the helper now does too.

Red on old: `test_a_process_that_exits_between_being_listed_and_being_read_is_gone` makes the race on purpose (a pid that
exists when listed and raises `NoSuchProcess` when read): the old `_alive` raised it (1 failed), the new one answers gone; a
process that is really there is still alive (the control). wrapper.unit.all rows +1.
2026-11-26 12:10:36 +01:00
feder-cr 2703848a44 tests: the tree guard's launch time is judged from the launch line, not by a window of seconds
`test_the_tree_guard_returns_at_the_timeout_kills_the_grandchild_and_names_the_launch_that_was_alive` asserted
`2 <= alive_s < 8`. `alive_s` is the time from the launch line the child writes to the moment the run is read; a child
that a loaded machine starts late writes that line late, so it was alive for less than 2 s when the tree was killed
and the check failed although the guard had done everything right (this repo's pre-push under the load of the whole
suite, twice in a row: `2 <= 1.75824`). A test cannot fail for the speed of the machine.

What holds whatever the load is asserted instead: the line cannot have been written before the run began nor after it
was read, and its `at` is whole seconds (`launch_line`, timespec="seconds"), so `0 <= alive_s <= spent + 1`; and the
message gives that number. The kill and the naming of the launch were already asserted and stay.

Red on the old check, on purpose: `test_a_launch_that_began_late_is_named_with_the_time_since_its_own_line` is a child
slowed until its launch line comes one second before the kill (`last_launch` read at a fixed `now`): the guard names it
alive for 1 s, the old window rejects it (asserted), the new check accepts it. A control shows the check refuses a time
the line cannot give (a line 30 s before a 3 s run, a line after the read). wrapper.unit.all rows +2.
2026-11-26 11:48:17 +01:00
Federico Elia 7369fffa53 Merge pull request #612 from oss-invisible/fix/core-328-frame-fields
persona cover and launcher test read the window frame of core #328 (ui_normal/ui_compact derived, the bar through declared_maximized_ui)
2026-11-26 07:48:56 +01:00
feder-cr e02024933a tests: the fake clock of the index wait stays out of the real subprocess.run (Popen.wait polls through time.sleep: a child not yet reaped moved the fake time past the deadline after one all-yes round); two tests, wrapper.unit.all counts 3855 linux, 3859 windows 2026-11-26 06:58:26 +01:00
feder-cr 5140ecd424 required suites: wrapper.unit.all counts the four new persona-cover tests (linux 3853, windows 3857, as collected by the round of #612) 2026-11-26 06:58:16 +01:00
feder-cr c39077a050 tests: persona cover derives the window-bar prefs from their dimension, so the stored seeds hold on the pinned core and on the core with the window-frame rule
The core now declares the maximized window's bar from the panel as well as the
scale (declared_maximized_ui) and adds ui_normal/ui_compact. persona_cover has a
DERIVED category: a pref that is a function of a dimension, checked to take one
value per value of it and kept out of the stored features. maximized_ui is of
screen_panel, ui_normal and ui_compact are of dpr. test_launcher_config reads
the bar through the core when it has declared_maximized_ui.
2026-11-26 06:57:59 +01:00
Federico Elia d1cf338a2f Merge pull request #613 from oss-invisible/tests/ab-network-dealloc-early-evidence
ab network: a TURN deallocation before the page began closing is evidence, not a problem
2026-11-26 06:56:56 +01:00
feder-cr 411c2ad6ae ab network: a TURN deallocation before the page began closing is evidence, not a problem: the page's reduced-precision clock cannot order it (published engine against itself on Windows, wrapper #612's round) 2026-11-26 06:24:49 +01:00
Federico Elia 8ca47cba13 Merge pull request #609 from oss-invisible/tests/the-os-cursor-is-parked-outside-the-window
tests: on Windows the OS cursor is parked outside the browser window before every e2e, and the gestures that record pointer events require it
2026-11-26 03:00:00 +01:00
feder-cr e2e1c49db6 ci: every Windows e2e job sets the runner's screen to 1920x1080 before its e2e, so the window leaves a strip to park the cursor in
Run 45719708645 of this pull request: the runner's screen is 1024x768 and the browser window of a 1920x1080 identity is 1936x1048, so
it covered the whole screen and the cursor parked at (1023,767), inside it; the gestures' precondition said so. Parking the cursor over
the browser's own chrome does not help: hunt 45724307513 showed native moves over the tab strip reach the page too (clientY < 0,
buttons=0) once Juggler input is in it. Hunt 45730213378: 1920x1080 is the largest mode the runner's video device accepts (Microsoft
Hyper-V Video; 2560x1440 is refused) on windows-2022 and windows-latest.

The six Windows jobs of e2e.yml set it with a declared step (Set-DisplayResolution, read back, red if the screen is smaller), before
their e2e. The engine's gate runs the same step, byte for byte, in its Windows wrapper.e2e rows. Two unit tests: the runner's
1920x1080 arrangement parks the cursor in the strip below the window, and every Windows job of e2e.yml declares the screen before it
starts pytest (red on main's e2e.yml). wrapper.unit.all rows +2.
2026-11-26 02:26:32 +01:00
feder-cr 041010070c tests: every e2e test on Windows starts with the OS cursor parked outside the browser window
An autouse fixture per e2e test, and one per module that has an e2e test (a module-scoped browser opens its window before the first test of the module),
calls tests/_os_cursor.py park: the cursor goes to the bottom-right corner of the virtual screen, where no window of the engine is, and is read back. The
window then opens away from the cursor and no native mouse move reaches the page in the middle of a recorded gesture; require_outside at the start of the
drag test and the humanise move count (previous commit) is green. Windows only: the Linux e2e run under xvfb-run, whose pointer is virtual.
2026-11-26 02:26:32 +01:00
feder-cr 9ea819445f tests: a gesture the page records starts with the OS cursor outside the browser window (red: on a Windows runner nothing parks it and it sits inside)
A headed window that appears under the real cursor gets a native WM_MOUSEMOVE for it; the first native move of a process passes Gecko's filter, so the
page saw `mousemove 512,299 buttons=0` after the press in the middle of test_a_real_page_sees_a_drag_that_travelled. The runner's cursor is at (512, 384),
inside the window (-8, -8) to (1928, 1040) of a 1920x1080 screen.

tests/_os_cursor.py: park_outside (a pure choice of a point of the virtual screen beyond every window rectangle plus a margin, a clear error when none
exists), cursor_is_outside, park (SetCursorPos read back with GetCursorPos) and require_outside, over user32 on Windows and no-ops elsewhere (the Linux e2e
run under xvfb-run, whose pointer is virtual). The drag test and the humanise move count (which asserts `off <= 2` page moves) call require_outside at
the start of their gesture. The unit rows of required-suites count the new file (+20 on each OS).
2026-11-26 02:26:31 +01:00
Federico Elia 2ec1a9026b Merge pull request #611 from oss-invisible/tests/ab-network-webrtc-evidence
ab network: the TURN path really works and the A/A proves it; the udp leaf counts STUN transactions
2026-11-26 02:25:59 +01:00
feder-cr f0d25a86ff ab network: the gateway marks the TURN deallocation from its payload (one shared reading), the count drops it by that mark, and one before the page began closing is a problem 2026-11-26 01:54:35 +01:00
feder-cr ca0c6e33f8 ab network: the TURN deallocation (a Refresh with lifetime 0, one best-effort send at teardown) is evidence, not a compared leaf; two of them, or one without an allocation, is a problem 2026-11-26 01:50:11 +01:00
feder-cr 46cf6a579a ab network: the A/A proves the TURN path it compares: a walk with no relay candidate, an error for the lab TURN, or a request the lab TURN refused is a problem on either side 2026-11-26 01:09:41 +01:00
feder-cr 0a031d2688 ab network: the probe uses the lab TURN's credential so the relay is really made; the fake TURN refuses a request whose integrity is wrong; the udp leaf counts STUN transactions, and a transaction over the engine's 7 transmits is a problem 2026-11-26 01:07:54 +01:00
feder-cr a9e56c0b21 ab network: the hunt also keeps the TURN server's answers, the relay's return datagrams and nICEr's log 2026-11-26 01:07:53 +01:00
feder-cr 04b7a79b66 ab network: the webrtc walk keeps, as evidence never compared, each datagram's time and STUN transaction and the page's own ICE times; e2e-hunt can repeat that walk alone 2026-11-26 01:07:53 +01:00
Federico Elia 2c5cd5ea79 Merge pull request #610 from oss-invisible/tests/worker-cache-back-evidence
tests/worker-cache: a red go_back keeps the Juggler record, the engine's session-history log and what the page says
2026-11-26 00:53:52 +01:00
feder-cr 877027f9f4 tests/worker-cache: the helpers of the evidence come after the test, so the guard reads wait_cacheable before the first go_back 2026-11-26 00:28:44 +01:00
feder-cr 0e48424da8 tests/worker-cache: a red go_back keeps the Juggler record, the engine's session-history log and what the page says
Candidate 45691494388 (job 139520127265) saw go_back end with "no new navigation on frame mainframe-11 in 30s" for top/other-site/goto and kept nothing. A hunt of 2960 iterations on that engine did not reproduce it (run 45711081489). The test now arms FailureEvidence with SHIPBFCache, nsSHistory, SessionHistory, BCWebProgress, DocumentChannel and BrowsingContext, and records what the page says when go_back raises and 2 s later. Diagnostic only: no assertion changes.
2026-11-26 00:19:44 +01:00
Federico Elia 43e1b355a3 Merge pull request #604 from oss-invisible/tests/unit-tests-never-reach-the-network
tests: a test that is not e2e never leaves the machine (socket and asyncio doors guarded, four tests declare the lab's exit)
2026-11-26 00:01:57 +01:00
feder-cr ebfd0fa573 tests: the ten unit tests that compose a launch declare the engine instead of asking GitHub for it
Run 45708815163 (this pull request, every pytest leg): the guard refused `api.github.com` in ten unit tests. Without
`binary_path=` a launch resolves the engine through `ensure_binary` (`_engine.resolve_executable`): with an engine in the
machine's cache it answers at once, with none it asks GitHub's release index and downloads the archive. So these
tests passed on any machine that had run `fetch` and went to the internet on a fresh runner (reproduced here with
INVISIBLE_PLAYWRIGHT_CACHE_DIR on an empty folder: 10 failed, 10 errors; with the fixture: all pass).

A fixture, `declared_engine` (tests/conftest.py), declares an empty executable in the test's folder as the answer of
`ensure_binary`; the file is never run. The ten tests take it:
  test_launcher_helpers.py: test_build_env_carries_the_declared_network, test_build_env_caller_env_override_wins,
    test_build_env_never_injects_font_env, test_build_env_no_font_keys_when_absent
  test_launcher_config.py: test_enter_with_profile_dir_calls_launch_persistent_context,
    test_enter_without_profile_dir_calls_launch_not_persistent, test_persistent_context_user_data_dir_is_created_if_missing,
    test_teardown_closes_persistent_context
  test_async_api.py: test_the_async_api_stamps_the_session_token_into_the_browser_env
  test_virtual_display_start_off_the_loop.py: test_a_second_browser_is_served_while_the_first_starts_its_display
The whole non-e2e selection with an empty engine cache and the guard: 3763 passed, 8 skipped (Windows).
2026-11-25 23:30:27 +01:00
feder-cr b699439355 tests: the version gate is the one declared third party of the guard (pypi.org, for its own file only)
Run 45647282454, job version: tests/test_version_is_not_taken.py asks the index whether the proposed version is
already published, which only the index can answer; the guard refused its lookup of pypi.org and the gate went red.
It is skipped unless IPW_CHECK_VERSION is set, which only the version job of tests.yml does.

tests/_no_network.py: DECLARED_THIRD_PARTIES names that file and that host alone. Its lookup of pypi.org passes and
the addresses it answered may be connected to; any other host, and pypi.org from any other file, stay refused.
Three cases (faked under the guard, nothing leaves the machine): the gate may ask the index and only the index; no
other file may ask it; the declared table is that one entry, so a new one changes a test in the same diff.
wrapper.unit.all rows +3 (3688 linux, 3692 windows).
2026-11-25 22:45:35 +01:00
feder-cr 7031c911c7 tests: the four tests that compose prefs through the core declare the exit of the lab
A new fixture, lab_exit (tests/conftest.py), declares the exit and the GeoIP database of the lab for one test that
is not e2e, as the e2e session has them (tests/_lab_egress.py). With no proxy the core asks the network where this
machine leaves from on every composition, even with a declared zone (zone, language and position come from the
exit): that is the product's rule, so the tests declare the answer instead of asking the internet.
2026-11-25 22:45:33 +01:00
feder-cr 464e0b132b tests: a test that is not e2e never leaves the machine (red: four tests asked the internet where this machine leaves from)
pyproject.toml says unit and integration are "no network", and nothing enforced it: the pre-push of the wrapper
failed on tests/unit/test_config_public.py where the network refused api.ipify.org and icanhazip.com.

tests/_no_network.py patches the four doors every client in the process goes through (socket.socket.connect,
connect_ex, sendto and socket.getaddrinfo) for every test that is not e2e (an autouse fixture of tests/conftest.py):
loopback, the unspecified address, localhost names, the documentation ranges and the address this host sends from
pass; anything else is refused (ConnectionRefusedError, what an offline machine shows) and recorded, and the record
fails the test at its teardown, with WHERE (the test), WHAT (door and destination), FIX and RULE, even when the code
under test swallowed the refusal.

Red on this commit, all through the core's one discovery of the exit (prepare_session_geo, no proxy):
  tests/unit/test_config_public.py::test_public_import_matches_direct_import
  tests/test_launcher_helpers.py::test_default_context_screen_matches_profile
  tests/test_launcher_helpers.py::test_default_context_color_scheme_follows_dark_theme
  tests/test_prefs_composition_arm.py::test_the_wrapper_composes_what_the_public_api_composes (green before: the
  core swallows the failed discovery when the zone is given, only the record catches it)

tests/test_a_test_that_is_not_e2e_never_leaves_the_machine.py (35 on Linux, 38 on Windows: the asyncio cases run on the selector loop, and on Windows on the Proactor loop too, which connects with ConnectEx and sends with WSASendTo, never through socket.socket) tests the guard; wrapper.unit.all rows +35 / +38.
2026-11-25 22:45:33 +01:00
Federico Elia a480b58677 Merge pull request #602 from oss-invisible/tests/h3-attempt-read-at-the-port
tests: h3 that was never tried is read as no datagram at the h3 port, not as a load time
2026-11-25 22:01:33 +01:00
feder-cr 995e2da01e tests: five h2 visits with no datagram at the h3 port are clean on a loaded runner, and a datagram there is an attempt whatever the load times
The verdict of an h2-only road is the judge of the protocols plus the attempt read at the port of the server; the time a visit took is no input of it.
One visit loaded in 2500 ms against 719 ms (a loaded runner) with nothing at the h3 port is clean; every visit fast with one datagram at the port is an
attempt. Four roads each; the unit rows of required-suites count the eight.
2026-11-25 21:00:48 +01:00
feder-cr 13286044c7 tests: the non-coherent SOCKS5 roads also read the attempt at h3 at the gateway (UDP ASSOCIATE asked, datagram into the relay)
The server's UDP port does not see an engine that tries h3 through the relay of a gateway: it asks for a UDP ASSOCIATE or sends into the relay.
relay_activity() is taken before the first visit (after the core's own measurement) and after the last; h3_attempts() reports what the engine
asked of the gateway in between. A unit test covers a granted and a refused ASSOCIATE and a datagram into the relay; the unit rows of
required-suites count it (+1 again).
2026-11-25 21:00:47 +01:00
feder-cr 4f4b8ab7a3 tests: behind an HTTP proxy (and where UDP is dropped) h3 is never tried, read as a datagram at the h3 port, not as a load time
The e2e judged the fallback by an absolute margin on page.goto (visit 2 loaded in 2500 ms against 719 ms), which is red on a loaded runner with
five visits that all read h2. The attempt is now read where it is born: H3Server records every datagram that reaches its UDP port
(udp_datagrams), a QUIC Initial included whether or not a handshake follows, and the h2 roads assert there is none. judge_visits no longer takes
load times, LOAD_MARGIN_MS and its debt entry in the clock exceptions are gone. A unit test proves the server sees an attempt that never
completes; the unit rows of required-suites count it (+1).
2026-11-25 21:00:47 +01:00
Federico Elia 46054486c9 Merge pull request #606 from oss-invisible/fix/element-handle-actions-walk-like-a-hand
ElementHandle pointer actions walk onto the element the way selector actions do (one click path, one fingerprint)
2026-11-25 21:00:14 +01:00
feder-cr 3e43f597e4 tests: the handle e2e prints what the page saw of the pointer and the core's turns when its opening sequence is wrong
Evidence only; the verdict is unchanged (`ordine[:2] == ['hover', 'click']`). Candidate 45621332479 recorded
['hover', 'hover', 'click'] once, and nothing told an exit and re-entry of the pointer from a spurious second
mouseover. The page now also keeps every mouseover, mouseout and click of the button with its relatedTarget, its
point and the button's box at that instant, and the first moves of the document; the test wraps the core's
actionability loop (Actions._retry, _center_point, hit_target: the originals are called with the same arguments) and
records the turns of each action, their hit-target verdicts and how they ended. All three go into the failure message.
2026-11-25 19:56:37 +01:00
feder-cr 8bcc2a9ca1 ElementHandle pointer actions walk onto the element the way selector actions do, one hand for every door
click, dblclick, hover, tap, check and uncheck (and so set_checked) of an ElementHandle called the core's actions directly: with no client cursor the approach is one mousemove onto the exact centre of the quad and a press there, while the selector actions go through Frame._by_hand / Pointer.act (a drawn path, a landing point of the session's own). The handle now goes through the same _by_hand with element=<its object id>: Pointer.act aims at that node (no selector looked up, the handle not disposed), and trial/force/strict/position/modifiers are read as before. The keyboard and text actions (fill, type, press, focus, selectText, setInputFiles) already end in the same core action as their selector twins and are unchanged. The comment that said a handle click was the humanised pointer is now true. Version 0.59.1.
2026-11-25 19:56:37 +01:00
feder-cr 292d86a15a tests: a handle's pointer action walks like a selector's (red: a handle click is one jump to the exact centre)
ElementHandle.click/dblclick/hover/tap/check/uncheck go straight to the core's actions, which with engine_approach off send one mousemove onto the exact quad centre and press there; the selector actions go through the server's hand. A unit test over the real core Actions and the real Pointer (only the connection and the injected script stubbed) and an e2e that asks the page. Both rows of wrapper.unit.all and one row per system of the e2e partition name the new files.
2026-11-25 19:56:37 +01:00
Federico Elia 2f5216b4c0 Merge pull request #605 from oss-invisible/fakeweb/stock-unsettled
fake web P2: a stock round that lost the end of a fetch the page aborted is stock unsettled, not a broken control
2026-11-25 19:56:04 +01:00
feder-cr c2c3d3c289 tests: the engine-off WebGL canvas test says why it got no context
The probe listens for webglcontextcreationerror and returns what it heard instead of null; after a first null the test waits 2 s and records a second attempt (statusMessages, renderer). The verdict stays the first attempt's. The test runs inside FailureEvidence with MOZ_LOG gfx2d.
2026-11-25 19:05:33 +01:00
feder-cr 4d0cbc8d08 fake web P2: a stock round that lost the end of a fetch the page aborted is stock unsettled, not a broken control; ours is judged against the declared outcome there 2026-11-25 18:16:44 +01:00
Federico Elia 7c4a9c0702 Merge pull request #599 from oss-invisible/tests/occlusion-cover-without-focus
tests/occlusion: on Linux the cover is a window of the test's own, and neither the pointer nor the focus may move
2026-11-25 18:15:17 +01:00
feder-cr 8fd5d8ae7d Merge remote-tracking branch 'origin/main' into tests/occlusion-cover-without-focus
# Conflicts:
#	ci/required-suites.json
2026-11-25 15:28:21 +01:00
feder-cr 2706c29676 tests/occlusion: the pointer, not the focus, is what the cover must not move
Run 45620136865 refuted the focus reading: with an X cover over the pointer 458 of 463 runs were red, FocusOut 0 of 40 on the old arrangement. With no window manager the focus is PointerRoot, the pointer sits inside the covered window, and a window mapped over it makes the pointer leave the toplevel; GDK turns that crossing into a GTK focus-out that redraws the window after FullyObscured.

- the display: the test warps the pointer to the bottom-right pixel of the root (from its read-back geometry) before any session starts.
- cover_rectangle keeps the pointer outside the cover (the margin shrinks on that side) and cover_window fails with "the pointer is inside the covered window, no free point on the screen".
- watch also selects Enter/LeaveWindowMask; crossings and focus events are kept with time, mode and detail; the pointer is read back once after the cover is up.
- precondition (both halves, before the page is judged): no crossing and no focus event on the covered toplevel, pointer outside both rectangles; message starts "arrangement: the covering moved the pointer or the focus".
- unit cases for all of it; min_tests of wrapper.unit.all.* raised by 11.
2026-11-25 15:27:21 +01:00
Federico Elia 1e8d47cb6e Merge pull request #598 from oss-invisible/ci/pin-actions-by-sha
ci: every action and reusable workflow pinned to a commit SHA, and a test that refuses an unpinned one
2026-11-25 14:37:04 +01:00
feder-cr 2273bb1f77 CI: pin every action and reusable workflow by commit SHA, with a rule test
Every uses: in .github/workflows is a local path or owner/repo@<40 hex> with the
version in a trailing comment. SHAs resolved from the official tags through the
API; the cross-repository noreply-identity reusable is pinned to the last core
commit that changed that file. tests/test_every_action_is_pinned_by_commit_sha.py
refuses any other form (FAIL file / job / step) and is in the wrapper.unit.all rows
(min_tests 3650 linux, 3651 windows).
2026-11-25 13:56:10 +01:00
feder-cr 063a507a9c tests/occlusion: the cover on Linux is a window of the test's own and the focus must not move
The covering window was the second Firefox session's. When it mapped it took the X focus; the covered toplevel got FocusOut and GTK draws a window that loses the focus (nsWindow::OnExposeEvent -> NotifyOcclusionState(VISIBLE)). When X delivered Partially, FocusOut and Fully in one batch, that draw ran after the Fully and the page never recorded hidden (hunt run 45603211231, 58 reds of 1294).

- _x_visibility: override-redirect InputOutput cover (cover_window, destroy_window), FocusChangeMask with VisibilityChangeMask on the covered toplevel, FocusIn/FocusOut kept with their time, focus_moved for the precondition.
- test_window_occlusion_e2e: on Linux no second session; both halves assert that no FocusOut reached the covered toplevel before the page is judged ("arrangement: the covering moved the focus"). Windows unchanged.
- _evidence_on_failure: MOZ_LOG_FILE carries %PID, one log file per process.
- unit cases for all of it; min_tests of wrapper.unit.all.* raised by 13.
2026-11-25 13:49:56 +01:00
Federico Elia 92adffd3ee ci/py-lock/gate: the pip lock of the engine series' gate, with hashes, read by its wheelhouse at wrapper_ref (#596)
* ci: the lock of the gate environment (ci/py-lock/gate.txt), resolved once with hashes, and the test that it follows its sources (ci-03)

The engine series' gate installs the wrapper's environment offline from a wheelhouse made of a lock that lives here. gate.in is written by
scripts/ci_py_lock.py from pyproject.toml (dependencies without invisible_core, and the dev extra), the dependencies of the pinned core, the playwright
pin and cryptography 44.0.3; gate.txt is its uv pip compile --universal --generate-hashes --no-build result. The new test reads both offline and is red on a
missing dependency, a range, an entry with no hash, a pin that moved without the lock. Registered in both wrapper.unit.all rows (min_tests recounted).

* ci: the archives of Playwright's Firefox are pinned by sha256 in ci/py-lock/playwright-browsers.json, with its generator and a test (ci-03)

The gate of the engine series installs Playwright's own Firefox for the stock rows. Its archives (Firefox and FFmpeg on both platforms, winldd on Windows) are
now pinned here, at the wrapper_ref the gate selects, for the Playwright of scripts/playwright_pin.txt.

scripts/ci_playwright_browsers.py writes the file: it asks the pinned Playwright for the URLs with `install --dry-run` on each platform, downloads each archive
once and hashes it. The test reads the file offline and is red on another version, a missing platform or archive, a bad hash, an absolute URL or a file that is
not the generator's bytes. It runs in wrapper.unit.all on both systems; min_tests 3624 -> 3642 (linux) and 3625 -> 3643 (windows), by collection.
2026-11-25 10:31:49 +01:00
Federico Elia fc8e7da94a ci: the rows of the registry carry the details of each leg (runner image, timeout, cores, ...) (#595)
The gate of the engine series will derive its matrix from ci/required-suites.json, so every per-leg
detail must be a field of the row. Optional fields, absent = the plain leg: runner_image, timeout_minutes,
needs_userns, core_dumps, stock_firefox, location_service, run, extra_steps (closed set), moz_log,
juggler_trace, artifact. Set on the rows that need them today; no row, os, test or minimum changes.

ci_verdict.py validates each known field (type and closed values, named); unknown names stay ignored.
A new test pins the validation and the table of the fields on the rows. wrapper.unit.all lists and
minimums follow the new test file (3610 / 3611, counted by collection on Python 3.11).
2026-11-25 02:55:31 +01:00
Federico Elia cad287d504 tests: date:date-time() called from an imported stylesheet is in the declared zone (#594)
An e2e test for the road a site uses: a main stylesheet that xsl:imports a
second one, both loaded by address, the imported one calling EXSLT's
date:date-time(). A context with timezone_id=Pacific/Kiritimati reads +14:00;
a launch with an empty declaration reads what getTimezoneOffset() says, and
that is not +14:00.

The file is added to wrapper.e2e.suite.linux.3 and wrapper.e2e.suite.windows.4
and their minimums go up by one.
2026-11-24 23:42:52 +01:00
Federico Elia 73a72cc540 tests.yml: the unit job judges the exact counts of wrapper.unit.all on Python 3.11, and min_tests follows the collection (#593)
PR #590 added a test to tests/test_ab_host.py without raising min_tests of
wrapper.unit.all.<os>; the PR checks (pytest tests/, floor 380) were green and
the engine series' gate went red ("the suite is exact").

The unit job now runs, on the Python 3.11 legs of both systems, the selection of
the row (ci_verdict.py args --with-marker) with a junit, and judges it with
ci_verdict.py judge from main against ci/required-suites.json, the list of main
as --main-required. The files outside the row run in a second, small pytest
(--ignore of every file of the row): no test runs twice. The plain run and its
floor stay for the other legs.

min_tests 3575 (linux) and 3576 (windows), counted by collection, including the
new test that holds the workflow to this.
2026-11-24 18:41:07 +01:00
Federico Elia a2dc1b6c2f record 0.59.0 as published (#591) 2026-11-24 12:09:59 +01:00
Federico Elia 9a6c12f0cb ab host: the presence of the pingsender and of what it spawns is listed, never red (#590)
Run 45364818483 (e2e on main 5a68489d, host windows): the A/A of the 68 broke on proc.socket<-pingsender, in no launch of one run and in every launch of the other. Whether a launch starts Mozilla's pingsender is canUpload()'s, not the engine's to hold, and with a few launches per side the rule of every kind turns that into a difference of the engine with itself. The kinds backgroundtask/pingsender and <kind><-pingsender are listed (not-judged), never red; their paths, their destinations and the separate pingsender[.exe] stay judged, and every other kind keeps the rule. A test with the shape of that run is red on the old oracle.
2026-11-24 11:14:44 +01:00
Federico Elia 5a68489dc3 Merge pull request #572 from oss-invisible/integ/candidate-69
Integration for the next candidate: #555, #567, #566 and #568 on main 3527f573
2026-11-24 10:23:56 +01:00
feder-cr 5076cec4c2 release 0.59.0: pins invisible-core 69.82.0 (engine firefox-69)
ci/persona-seeds.json names the core it was computed with: 69.82.0, same content.
2026-11-24 09:41:55 +01:00
Federico Elia 3722690103 Merge pull request #589 from oss-invisible/tests/ab-host-exit-ignores-reused-pids
ab-host: the wait for the exit ignores pids that Windows handed to another process
2026-11-24 07:00:18 +01:00
feder-cr 1156f42860 ab host: the run of the reused pid is 45328762166 2026-11-24 06:52:22 +01:00
feder-cr 69afb93aa2 ab-host: a pid of the tree is alive only while it is still that process
Windows hands the pid of an ended process to the next one it makes: pid 7352
of the tree ended at 05:05:33 and was TiWorker.exe at 05:05:38, so the wait
for the exit saw the tree alive for the whole 120 s (A/A seed 4 side A).
A pid of the tree has ended when the audit has its 4689 after its 4688, or,
with no 4689, when the process that has the pid was created after the birth
the audit gives. EXIT_LIMIT_S is unchanged.
2026-11-24 06:43:23 +01:00
Federico Elia 4eea99197d Merge pull request #588 from oss-invisible/ci/unit-min-tests-measured
ci: unit minimums are the counts the gate measured
2026-11-24 06:35:58 +01:00
feder-cr 539f5203ee ci: the unit minimums are the counts the gate measured (3563 Linux, 3564 Windows)
The two linux-deps PRs raised wrapper.unit.all by the size of each version of
tests/test_ci_linux_legs_read_no_mirror.py while the second one replaced the
first, so the minimum counted 78 new tests where 66 exist (plus 5 of the
occlusion test). Republish 45328762166 collected 3563 on Linux and 3564 on
Windows, against minimums of 3575 and 3576.
2026-11-24 06:20:23 +01:00
Federico Elia ec4db32b62 Merge pull request #587 from oss-invisible/tests/occlusion-control-sees-hidden
tests: the occlusion control judges that hidden was recorded after FullyObscured
2026-11-24 05:46:50 +01:00
feder-cr 7ce4b16a3a tests(occlusion): the engine's window log at Widget:4, the level of nsWindow's LOG 2026-11-24 05:37:47 +01:00
feder-cr 57a2e612b3 tests: the occlusion control judges that hidden was recorded after FullyObscured, not the final state
nsWindow::OnExposeEvent calls NotifyOcclusionState(VISIBLE) at every draw of the
window's container (Mozilla's code, the same in retail), so a draw after X's
FullyObscured makes the page visible again and the control, which read the
final state, was a race.

The control now takes the page's list of visibilitychange entries and passes
when hidden was recorded after FullyObscured; the product half is unchanged
(hidden never seen). A deterministic case on Linux draws the covered window
again while it stays covered (one pixel narrower through X): the page must
record visible, hidden, visible. The decision is a pure function with unit
tests, and the engine's Widget log goes into the evidence folder.
2026-11-24 05:29:08 +01:00
Federico Elia 7c9d414af9 Merge pull request #585 from oss-invisible/ci/linux-deps-repository
ci: Linux legs install from the run's repository of the closure (linux-deps, second form)
2026-11-24 05:23:08 +01:00
feder-cr a3cb07c126 ci(linux-deps): a root only provided is its one provider (libgtk-3-0's closure came without libgtk-3-0t64: apt-cache depends --recurse does not walk from a virtual root); identical to the series' copy 2026-11-24 04:49:16 +01:00
feder-cr ba86f02ee7 ci(linux-deps): each fetch of the closure retries 5 times, the MB and seconds of the download are logged (identical to the series' copy) 2026-11-24 04:20:10 +01:00
feder-cr 30ce3226d8 ci(linux-deps): a root may be a provided name, the entry per release of the image, the closure downloaded 8 at a time
libgtk-3-0 is a name libgtk-3-0t64 provides on noble and the root check read Package: alone (linux-deps-real-sites
red); a key per image build missed the entry whenever the builds of a release are mixed; the closure read one
package at a time took 13 minutes from a slow mirror. linux-deps.yml stays identical to the series' copy.
2026-11-24 03:48:21 +01:00
feder-cr 0663250d48 ci: the Linux legs install from the run's repository of the closure (second form of linux-deps)
The first form installed the .deb files the job's image lacked against the
leg's own image and lists; GitHub mixes builds of one image in one run, and
legs failed with "E: Unable to fetch some archives".

linux-deps.yml (identical to the series' copy) now hands the jobs a
repository: the roots and their whole closure, a Packages index and
roots.txt. A leg installs the roots by name with an apt that reads only that
repository (its own sources list and lists folder) and --no-download. The
Playwright pin is read from playwright_wrapper_ref (github.sha) instead of the
`playwright` flag.

tests/test_ci_linux_legs_read_no_mirror.py follows the same rules as the
series' test: the only apt lines are the two allowed ones, APT and the sources
list are local, the files are copied into apt's archives, the artifact is
downloaded before the install; it is red on the first form.
2026-11-24 03:20:40 +01:00
Federico Elia 13cd04a8d3 Merge pull request #584 from oss-invisible/ci/linux-deps-no-mirror
ci: Linux legs install packages from the run's linux-deps job, never from Ubuntu's mirror
2026-11-24 02:52:13 +01:00
feder-cr 83293b8184 ci: the Linux legs install their packages from the run's linux-deps job, never from Ubuntu's mirror
A run lost a green leg to its time limit because `playwright install-deps firefox` fetched 48.8 MB
from the mirror at 102 kB/s (about 8 minutes per leg). linux-deps.yml fetches the .deb files once
per runner image and list (xvfb, strace, gdb, elfutils or the leg's own packages, plus what
`install-deps --dry-run firefox` names for the pin of scripts/playwright_pin.txt), keeps them in a
cache entry and hands them to the run as the artifact linux-deps-<name>. The legs of e2e.yml,
fakeweb.yml, e2e-hunt.yml, real-sites.yml and user-install.yml need that job and install the local
files with --no-download: no apt-get update, no install-deps, no install from the archive.

tests/test_ci_linux_legs_read_no_mirror.py refuses those three in any job, requires each installing
leg to download the artifact of a linux-deps call it needs before its first install, and is in both
unit rows (3529/3530). The tests that read the job headers of e2e.yml, fakeweb.yml and
real-sites.yml follow the new needs.
2026-11-24 02:40:59 +01:00
feder-cr fead0e8c44 Merge tests/etw-session-lifecycle (#583) into the integration for the candidates 2026-11-23 23:12:13 +01:00
feder-cr a158db2151 ci: the stock control of the geolocation step reads the first host read Firefox makes for location, and our engine must make none
Republish 45257636942 (windows-2022): stock Firefox did not start the location utility process
(sandboxingKind=3), while on the same image it did in 45165805370, 45170547415 and 45252267809. The runner
has no source of position (getCurrentPosition answers code 2), so the utility depends on the runner. Stock
loaded capabilityaccessmanagerclient.dll (the CheckAccess of GeolocationSystemWin.cpp) in every launch
that ran, 5 of 5. The 68, the 68 again and the candidate loaded no location module in any of 168 launches.
- The stock control is broken only if stock ran and did not load capabilityaccessmanagerclient.dll. The
  utility is still recorded and printed.
- Our engine, on both sides of the A/A and the candidate in the A/B, the idle launch included: a location
  module or the location utility in any launch is red.
Unit rows 3492/3493.
2026-11-23 22:53:22 +01:00
feder-cr 0b63169b51 ci: the host oracle's ETW session is read from the list of sessions, waited for after its stop, and its errors say Windows' code
Gate 45257629988 (Windows, seed 6): `logman query <session> -ets`, the round trip between the canaries, failed
with 0x80071068 (4200, ERROR_WMI_GUID_NOT_FOUND) right after a successful create. The launch went without a
trace and the A/A was broken, under a line that blamed the administrator.
- The round trip reads the list of sessions (`logman query -ets`, which does not resolve the providers): the
  launch's session must be there and Running. A read that fails is read again every 0.25 s until the
  condition holds or the 120 s hang guard runs out. The browser starts only once it holds.
- After every stop, the next launch waits until the session is gone from that list (same read, same guard).
- Errors carry the command, the code in hex and Windows' text; "it needs an administrator" only for access
  denied (0x80070005).
Unit rows 3482/3483.
2026-11-23 22:06:11 +01:00
feder-cr 4a840e39b0 Merge tests/the-covered-window-is-covered-before-it-is-measured (#582) into the integration for the candidates 2026-11-23 21:06:48 +01:00
feder-cr 111dc3bf69 Merge tests/gl-probe-born-before-goto (#581) into the integration for the candidates 2026-11-23 21:06:48 +01:00
feder-cr 87f26ec99d Merge tests/location-checkaccess (#580) into the integration for the candidates 2026-11-23 21:06:48 +01:00
feder-cr 41738dcc3d ci: the host oracle judges the kinds of processes by the rule of the paths, keeps the raw audit of every launch, and drops a pid only when it is born again
Run 45228081536 (Windows): the A/A of the 68 was red on how many pingsenders a launch started (2, not 0 or 3)
and on whether they spawned a socket process. Mozilla's pingsender leaves in some launches and not in others
(measured: 6 short launches of 48, 5 long ones of 16).
- The kinds of processes follow the rule of the host paths: red only if a kind is in every measured launch of
  one engine and in no launch of the other. The other kinds, pingsenders included, are listed with their
  counts in not-judged[-a-a].json. The count rule for the pingsenders is gone. The separate pingsender
  executable and the pingsender's destinations are still judged, and so is the stock control's location
  utility process.
- process_tree: a pid of the tree stops counting only when it is born again as a process that does not join
  (plus the creator's name). A creator's end no longer excludes a child logged after it.
- Every Windows launch saves the raw 4688/4689 events of the tree and of the processes left out, with the
  reason, next to its footprint.
Unit rows 3464/3465.
2026-11-23 20:36:54 +01:00
feder-cr 3f63899afb tests: the covered window is measured only once Windows says the cover is in front and the tracker has been signalled (hunt run 45226548295)
The Windows half of the occlusion test judged the page after a Z-order change that the tracker never hears: WinWindowOcclusionTracker recalculates on
hooked events (foreground change, move or resize, minimize, state change, cloak, location change of a process that had a visible window), not on a
change of the Z-order, and the second move of the covered window went to where it already was, so it sent nothing. When the covered window kept the
foreground the tracker was never told, and the page stayed visible for the whole deadline.

The test now builds each precondition with calls the system honours and waits for it, with a deadline, as Windows reads it back:
- before the page is asked anything, the covered window is made topmost and moved by one pixel, and the test waits until nothing above it covers it and the
  page reads visible (a window of the same size opened over it by another session or by the load of the runner no longer reads as "hidden before anything
  covered it");
- the cover is made topmost, the covered window moves inside it, and the test waits until the read-back says the cover covers it ("the lab could not cover
  the window" otherwise, never a verdict about the page);
- the tracker is signalled after that with a real one-pixel move, repeated while the page still reads visible, so a page that never turns hidden is the
  engine's.

The step that only recorded, without a verdict, whether the system kept a plain Z-order is gone (it spent a full deadline in the control half and would
now read as kept every time); the foreground window and the number of signals are recorded on every run.
2026-11-23 19:07:26 +01:00
feder-cr e3572f289f ci: the host oracle's process tree takes a process only while its creator is alive in it
Run 45221868374 (Windows, idle launch of the 68): a Windows service (svchost wlidsvc), seven wevtutil and two
wsl of the oracle entered the engine's tree because their creator's pid matched a pid of the tree that Windows
had reused. The service never exited, so the wait for the tree's exit ran out and the A/A was broken.
process_tree now walks births (4688) and ends (4689) in order: a process joins only if its creator is alive in
the tree at its birth, and only if the creator's image matches ParentProcessName when the audit gives it.
A stranger that takes the pid of a process that has gone drops that pid. The trace turns on the
process-termination audit and puts it back afterwards; without it the tree relies on births alone.
Unit rows 3450/3451.
2026-11-23 18:20:50 +01:00
feder-cr 78271d32ce tests: with the engine off the host GL probe is born before the first goto (Linux) 2026-11-23 18:11:37 +01:00
feder-cr 16bf5d37c4 ci: the host job reads Windows' answer for location (CheckAccess) before and after turning it on, and is red unless Allowed
Run 45206303882 (gate, windows-2025): the location keys said Allow and lfsvc ran, and stock Firefox did not
start the Windows provider. Before it does, Firefox asks AppCapability("location").CheckAccess(), and that
answer was never read. The step now prints it before and after, and is red unless it is Allowed after.
2026-11-23 17:46:56 +01:00
feder-cr 71d8dfa4f6 Merge tests/journey-hang-guard (#579) into the integration for the candidates 2026-11-23 16:23:32 +01:00
feder-cr 1adc3f3ccf ci: a visit of the HTTPS and HTTP/3 walks is left only after its origin's favicon is served and the page is network-idle
A/A run 45189518824 (Linux): in one run the second visit of the HTTP/3 page asked for /favicon.ico, in the
other it did not. Over 14 transcripts of the day Firefox asks once per origin of a launch: in the journey
on the first page of each origin (140 of 140), on no page of the other steps (0 of 980), and in the walks
?v=1 always asks while ?v=2 does not (59 and 60 of 60). Hypothesis, not proved: the goto of ?v=2 races the
recording of ?v=1's favicon.
- settle_visit, the one point a visit is left from: the favicon of the page's origin has been asked for
  and served in full (WireServer.answered_at, marked after the last byte on http1, h2 and h3), then the page
  reaches networkidle. Each wait has the 120 s hang guard; one that reaches it is an error of the
  transcript that names the visit and the missing wait.
- The evidence of the transcript keeps the arrival and the end of the answer of the HTTP/3 requests,
  for the measure to make if this falls again. The journey is not touched.
- Unit rows 3443/3444.
2026-11-23 15:42:37 +01:00
feder-cr 2e2ce133df tests: the waits of the fake web's journey have a hang guard, and a wait that reaches it says its stage
Run 45176061220 (gate, Windows, network oracle): in one launch the runner was 3 to 4 times slower for
about 100 s. From the click to `load` steps 2 and 3 took 18.9 and 22.1 s (4.5 to 10.2 s on 480 pages in
6 runs), over the 15 s default deadline of the walk's context. A deadline meant for a hang became a leaf of
the comparison and the A/A of the published engine was red.
- TIMEOUT_MS becomes HANG_GUARD_MS (120 s), the deadline of every wait of the walk that has no time of its
  own; the wait for the noise uses it too. The back/forward keys and the networkidle time keep their own.
- A wait that reaches the guard says which wait, on which page, and the last request the site saw, in
  place of "Timeout Nms exceeded". Only the stage and the page are compared.
- Fake site pages that hold `load`: a click to a page that holds it 20 s is a passed step, and a page that
  never loads names `navigation to load` with a small guard.
2026-11-23 14:52:35 +01:00
feder-cr 472db8a7b3 Merge tests/oracle-controls-r2 (#578) into the integration for the candidates 2026-11-23 12:44:28 +01:00
feder-cr 5a328bb87c tests: the host e2e expects the stock control's footprint on Windows, in the A/A and with a candidate
Run 45165805370: the stock control passed (utility sandboxingKind=3) and the e2e was red only on the list of
footprints, which did not have it. expected_footprints holds the four cases (Windows/Linux, A/A/candidate).
Unit rows 3418/3419.
2026-11-23 12:44:06 +01:00
feder-cr 60f4fb7679 ci: the trace of the host oracle's stock control is rooted at the parent of stock Firefox, not at the oracle
Run 45162128126: stock Firefox answered getCurrentPosition (error 2) within a second and then stood in
`seed result` until its 120 s limit: the trace waited for the tree rooted at the oracle's own python, which
cannot exit (EXIT_LIMIT_S). The root is now the stock browser's parent process, found among the oracle's
descendants after the launch, as an engine's root is its parent; one not found is a broken control that says so.
Unit rows 3417/3418.
2026-11-23 12:23:04 +01:00
feder-cr 121cd4b5e0 ci: the host job turns on the runner's location service; the stock control has its own limit and says its phase; the network guard is the measured run plus 25%
Run 45153612447 (PR #578), host on Windows: the A/A was green, then the stock control stood still for more than 26 minutes,
until the test's guard killed the python child alone and nothing was said. On the runner the location service is off and
denied for the machine (lfsvc Disabled and Stopped, the machine's location consent Deny).
- e2e-host-windows turns the service on before any launch: lfsvc made startable and started, consent Allow for the machine
  and for the user's non-packaged apps. A setting that does not hold is red with its reason. The claim of the geolocation step
  is unchanged.
- The host test runs the oracle through crash.run_tree. The stock control runs in at most 120 s (crash.run_tree) and prints
  every phase, so a control that does not end says the phase it stood in.
- Network: the test's guard is the slowest measured run plus 25% (runs 45121964904 and 45153612447): 2197 s for the A/A,
  3285 s with a candidate. The network jobs of the PR have 50 minutes.
- Unit rows 3415/3416.
2026-11-23 11:59:07 +01:00
feder-cr b5f8865ea5 release 0.59.0: version and changelog (the unpublished 0.58.1 entry folds into 0.59.0) 2026-11-23 11:42:22 +01:00
feder-cr b1550faf89 ci: the unit rows counted again (3407/3408) and tests/test_glean_ready.py named in them 2026-11-23 11:02:42 +01:00
feder-cr efa6d948fe ci: the host and network oracles close only after Glean has initialised, and their controls say why they broke
Run 45121964904 (the gate of the 69) had three red controls, none from the candidate:
- network, Linux: the published 68 exited with -11 in the exit-pings launch. It is Mozilla's race:
  a session closed before Glean initialised makes it start inside the shutdown, where glean.init can
  panic ("No database found"). That launch had no window, so Glean was always born in the shutdown.
  Every launch of the two oracles now waits, right after its first page, for
  <profile>/datareporting/glean/db/data.safe.bin (a condition read from the host; 60 s is a red
  safety limit). The launch's own work always sits between the condition and the close. The
  exit-pings launch opens a page and navigates once before it closes, and its wait for the
  data-policy pref (which never came) is gone. The host's bare launch, never compared, is removed.
  Each launch keeps the listing of datareporting/ as evidence.
- network, Windows: the subprocess timeout killed only the python child; the firefox grandchild
  held the pipe and pytest timed out without a word. crash.run_tree writes the output to files,
  kills the whole tree, and names the launch that was alive and for how long.
- host, Windows: the stock control never started (Playwright's Firefox was not installed) and was
  reported as "does not reach the platform provider". It now runs after a green A/A on every
  Windows run, pull requests included. The job installs the browser, a missing executable is said by
  name, and a stock that ran without reaching the provider prints its processes and modules. A
  read-only step prints lfsvc and the location consent keys.
2026-11-23 11:02:42 +01:00
feder-cr 6d42084c95 Merge f2bd726e (#571) into the integration for the candidates
The partner tab of step 10 is closed from the walk's one point (Journey.leave) and the walk then waits
for its two pagehide requests, as integ already did; the fake tab of the unit test of that wait answers
the noise-done wait. The rows counted again by the collection: unit 3384/3385, suite.linux.2 412,
suite.windows.3 274.
2026-11-23 06:27:19 +01:00
feder-cr cf0c7ba3d2 Merge tests/ab-host-aa-stable into the integration for the candidates 2026-11-23 06:27:19 +01:00
feder-cr 3c09b863bf ci: the host oracle judges every host path by one rule, red only if in all measured launches of one engine and in none of the other, and lists the rest 2026-11-23 06:23:07 +01:00
feder-cr 583516ca34 tests: the host oracle's one rule on real A/A and A/B footprints and on built cases (red on the current judge) 2026-11-23 06:23:07 +01:00
feder-cr f2bd726ef4 tests: a page declares its noise done only once its fetch chain and its streams have sent their release
The network oracle of the run 45088980743 (Windows) saw `GET A/release?id=lp<TOK>` once in one run
of an engine and twice in the other: the home page of step 15 had sent its last stage and its
fonts, but its chain of seven fetches had not yet sent the release that ends it when the walk asked
for /account. window.__noiseDone did not cover that stage. It is now true once the fonts, the last
stage, the release of the fetch chain (stage 5) and the releases of the three aborted streams
(stage 9) have all been answered. A held request of a parked page stays out of it.

The check of the walk (journey_site.pages_left_before_their_noise) also asks, for every page, for
the release that ends its fetch chain, with the page as its referrer, before the walk leaves it.

Unit tests: a page left before that release is found; the page declares the new conditions. Both
red on the previous site. Counts: unit.all.linux 2426 -> 2427, unit.all.windows 2427 -> 2428.
2026-11-23 05:26:56 +01:00
feder-cr 715cbc9e59 tests: the late stylesheet of a partner page is read with the page's own URL as its referrer
The check of the p4 walk (journey_site.pages_left_before_their_noise) expected the late stylesheet
ld3 of a page of the other origin with the origin alone as its referrer. The partner page loads ld3
from its own origin: a same-origin request carries the whole URL of the page (O/partner/8). In the
run 45074928774 the stylesheet arrived 3 s after `load`, after the walk had waited for the page's
declaration, with that referrer, and the check called it missing (Linux job 137370233977, Windows
job 137370233997). The driver was right; the expected referrer was wrong.

Unit tests: the partner page is found by its own URL (red on the previous check, green here); step
10 closes the partner tab only after the wait for the tab's declaration (red when the cleanup
closes it at once); the source check also pins goto to the first page and forbids reload.

Counts: unit.all.linux 2424 -> 2426, unit.all.windows 2425 -> 2427.
2026-11-23 05:22:30 +01:00
feder-cr b44c5d64d0 ci: the rows counted again after #569 and #565 2026-11-23 01:20:30 +01:00
feder-cr 6582f222ce Merge 891abbf5 into the integration for the candidates 2026-11-23 01:17:08 +01:00
feder-cr afd5ca8f30 Merge 85a01e4b into the integration for the candidates 2026-11-23 01:17:07 +01:00
feder-cr 891abbf5ac tests: the refusal of two items with one name in createTempFiles is a wanted divergence, named in the budget with its witness 2026-11-23 00:48:51 +01:00
feder-cr c04752c86e fix: a stream is usable only by the context that made it; an unknown one is refused with the stock server's sentence
_upload_paths takes the context of the frame or the handle doing setInputFiles and accepts a WritableStream only if it is a child of that context. A guid that is unknown, or a stream of another context or another client, answers `streams[i]: no object with guid <g>` (the stock server's `_tChannelImplFromWire`); a guid of another type answers `object with guid <g> has type <t>, expected WritableStream`. Both doors (Frame and ElementHandle) pass their context.
2026-11-23 00:48:51 +01:00
feder-cr c8ac1fd329 tests: a stream is usable only by the context that made it, and an unknown one is refused with the stock server's sentence (red: another context's or another client's closed stream is accepted)
The stock server's streams are objects of one connection: a guid outside it answers `streams[i]: no object with guid <g>`. The unit tests drive the element's and the frame's setInputFiles with a closed stream of another context, of another client, and an own one, and read the exact sentence for a stream nobody made. Registry: unit rows +3.
2026-11-23 00:48:51 +01:00
feder-cr be7ac95cc4 fix: a path upload over connect is streamed into the session (createTempFiles and WritableStream served), and a file chooser the server cannot announce leaves a trace
A stock client on a remote connection uploads a path with createTempFiles, WritableStream write/close and setInputFiles{streams}; the server refused the first call with a sentence that said the opposite of the truth. BrowserContext now serves createTempFiles (one folder per call in the session's upload area, one file per item, names refused unless they are one bare file name, a folder refused as set_input_files refuses it, mtime from lastModifiedMs at close), the new WritableStream dispatcher appends and closes once, and _upload_paths reads streams as the closed files. The folder is removed by the context's released(), which a context close and a dropped client (_client_gone) both pass. The perimeter no longer names createTempFiles or write.

_announce_file_chooser records every early return in handler_errors, as the adoption failure already did.
2026-11-23 00:48:50 +01:00
feder-cr 43593669f6 tests: a path upload over connect is staged in the session, a stock client's file reaches the page whole, a file chooser the server cannot announce leaves a trace (red: createTempFiles is refused, four exits of the announcement are silent)
A stock client over `connect` uploads a path as a stream (createTempFiles, WritableStream write/close, setInputFiles{streams}) and the server refuses the first call. The unit file drives the real dispatchers and the served endpoint: names, one folder per call, write/close, the streams read by the upload, cleanup on context close and on a client dropping mid-copy. The e2e file gets a test that reads name, size, lastModified and bytes of two streamed files on the page, and its handler tests (2 and 4) now pass a Python function, which the client needs. Registry rows updated: unit rows +30, e2e rows +1.
2026-11-23 00:48:50 +01:00
feder-cr 209be2d08e tests: which path loses the file chooser: a direct click on an input, in process and on a served browser with a stock client, the event alone, a path and a payload, a fresh page (red: the evidence) 2026-11-23 00:48:50 +01:00
feder-cr 94f2b07540 tests: the real tap of an element leaves this branch: the engine cannot send a touch event since Firefox 159 (Juggler calls windowUtils.sendTouchEvent, which 159 removed); it waits on tests/a-tap-reaches-the-page-through-the-engine for the engine's fix 2026-11-23 00:05:18 +01:00
feder-cr f46565e900 Frame.tap of a context without touch is refused with stock's sentence before anything is looked up or sent (red: 2 unit); the e2e of the handle asks what stock answers: is_editable of a disabled button is stock's 'Element is not an <input>...' error, a page tap without touch is stock's refusal (+3 unit, +2 e2e) 2026-11-22 23:39:44 +01:00
feder-cr a75abbe7ec ci: the rows counted again after #566 and #568 2026-11-22 23:14:58 +01:00
feder-cr 6cda38db60 Merge fa849b58 (PR #568: the Linux e2e in three parts) into the integration for the candidates; the oracles' workflow tests read the Linux parts (e2e-linux) and their rows 2026-11-22 23:11:39 +01:00
feder-cr 4b216c9618 Merge 240f4ab6 into the integration for the candidates 2026-11-22 23:09:41 +01:00
feder-cr 690cbbdd16 ci: the rows counted again after #555 and #567 2026-11-22 23:03:55 +01:00
feder-cr b582b9e83d Merge 929ed9df (PR #567: the arguments of evaluate, the static check of the methods) into the integration for the candidates 2026-11-22 23:00:14 +01:00
feder-cr abf62dfe08 Merge 18f6225a (PR #555: the host oracle's rules, --junit, wrapper.e2e.ab_host_crash) into the integration for the candidates 2026-11-22 23:00:03 +01:00
feder-cr 88b3de4320 tests: the p4 walk leaves a page from one point, once the page has declared its noise done
Every page of the journey site now declares the end of its noise: window.__noiseDone is true once
the font stage is done (its stylesheet has loaded and document.fonts.ready has resolved after the
spans were laid out) and the last stage has loaded its stylesheet ld3; at once on a page without
noise.

The walk leaves a page only from Journey.leave, which waits for that declaration (deadline 30 s,
never a pause) before the act that leaves: every navigating click and Enter (Journey.navigate),
back and forward (history_step), closing the partner tab (step 10) and the end of the walk (the
context closes the last page). The same driver runs for stock Firefox and for ours, so the
verdict "same outcome as stock" is unchanged.

Unit tests (red on the previous commit's driver, green here): step 15, the form keys of steps 12
and 14, back and forward, the tab and the last page, a source check that every navigation, back,
forward and close of the walk goes through that one point, and the page's declaration.

Counts: unit.all.linux 2418 -> 2424, unit.all.windows 2419 -> 2425.
2026-11-22 22:51:11 +01:00
feder-cr bf3823036a tests: the p4 walk must leave a page only once its noise is done (red on the current driver)
The network A/A oracle on Windows differed at step 15 of the journey (ld3 1 vs 2, woff2 5 vs 7):
the walk clicks Account as soon as the home page has loaded, while the home page's noise still
runs on timers after load (fonts at 250 ms, the late stylesheet ld3 at 600 ms).

The lab can now make the last stage of the noise long (journey_site.start(last_stage_ms=...)),
and the site's record keeps the referrer and the type of every answer. The new e2e test runs the
walk with that stage at 3000 ms and reads the record: every page's ld3 (with the page as its
referrer) and its five woff2 must arrive before the walk's next navigation
(journey_site.pages_left_before_their_noise). The current driver leaves the home page of step 15
right after load, so the test is red on it by construction.

Counts: wrapper.e2e.fakeweb 4 -> 5, e2e.suite.linux.2 411 -> 412, e2e.suite.windows.3 273 -> 274,
unit.all.linux 2413 -> 2418, unit.all.windows 2414 -> 2419.
2026-11-22 22:44:57 +01:00
feder-cr 85a01e4be0 fix: a screenshot honours its scale: scale="css" is a picture in CSS pixels
PageDispatcher.op_screenshot sent omitDeviceScaleFactor false whatever the caller asked and never read `scale`: at a viewport of 1280x720 and a ratio of 1.25
page.screenshot(scale="css") was 1600x900, stock gives 1280x720. It now sends omitDeviceScaleFactor: scale == "css", as stock's Firefox page does. The element and
locator screenshots end in the same call, so they follow.
2026-11-22 22:33:42 +01:00
feder-cr b74a08c400 tests: a screenshot honours its scale: css pixels for "css", device pixels for "device" and by default (red: the driver always sent omitDeviceScaleFactor false)
Stock sends omitDeviceScaleFactor: scale === "css"; the driver never read scale, so at a viewport of 1280x720 and a ratio of 1.25 scale="css" gave
1600x900. Unit: the page, full page, clip and element calls put the right flag on the wire. E2E: at 1.25 and 2 the size and the pixels (colour blocks at known
CSS positions, one below the fold, one in an iframe) of the page, full page, clip and locators are those of the scale asked for. Both registered in the
wrapper.unit.all rows and wrapper.e2e.suite.{linux,windows}.1.
2026-11-22 22:33:30 +01:00
feder-cr fa849b582e ci: the unit rows count the tests of the final Linux job (2427 / 2428) 2026-11-22 22:21:47 +01:00
feder-cr 18f6225a95 Merge main (3527f573) into the A/B oracles: the rows and jobs of main kept as they are, the oracles' added
ci/required-suites.json: every row of main unchanged; the unit rows hold main's files plus the oracles' unit files, with the
minimum recounted (3080 Linux, 3081 Windows); the rows wrapper.e2e.ab_oracle, ab_network, ab_host and ab_host_crash added.
.github/workflows/e2e.yml: the Windows parts take their files from the rows wrapper.e2e.suite.windows.N (main's).
The oracles' e2e files are named as excluded in tests/test_the_e2e_suite_is_accounted_for.py (their own jobs), and the
oracle job tests check that no row of the shared suite holds them. The host oracle's unit tests take the 13 real WOF
lines of the Windows A/A and the 45 real lines of the Linux A/B of candidate run 45060573559.
2026-11-22 22:16:32 +01:00
feder-cr 0a6ae0e3e4 ci: the Linux e2e in three parts, one per row of the suite, and one check that waits for them
The single Linux job ran the whole e2e in 24.6 minutes on a normal runner and
35.7 on a slow one (every test slower by the same 1.44x), close to its
40-minute ceiling. It becomes a matrix of three parts, `e2e (linux, part N)`,
each running the row `wrapper.e2e.suite.linux.N` of ci/required-suites.json
(read with `ci_verdict.py args`, as the Windows parts read theirs) through
scripts/run_e2e.py under xvfb-run: the parallel pass with 4 browsers, then its
wall_clock tests alone. Every setup step of the Linux job stays; the uploads
are named per part (-linux-N).

The rows hold no test of wrapper.e2e.udp.exit or wrapper.e2e.udp.sandbox. The
root step and the sandbox step run in part 1 only (the lightest by the test
time of the Linux junit of run 45064266867: about 1893 s against 1988 and
2138), after its run, in the same order as before. The sandbox step now runs
the whole list of its suite (the file and the three node ids of the UDP line,
13 tests, as the gate's sandbox leg runs it): the rows leave those three
nodes to that suite, and without this they would run in no step.

A final job keeps the old check name, `e2e (linux, xvfb)`: it needs the
parts, runs with `always()` and the same gate of the core on the index, and
fails unless `needs.e2e-linux.result` is `success` (a failed, cancelled or
skipped part is red). While the core is not on the index it is skipped with
the parts, as the Linux job was.

Tests: the root and sandbox step tests read the new shape (rows of the parts
without the suites, the steps held to one part, the sandbox step to the
suite's list and count); test_ci_runs_once_per_commit.py holds the final job
(known-bad: no always(), accepting skipped, not needing the parts, exit 0,
another job's result, no gate of the core, success() || failure()). No change
to the registry, the judge or the series.
2026-11-22 22:13:02 +01:00
feder-cr abd471e031 tests: waiting for a state of a node that left the document answers as stock does for each of the six states: hidden and stable are met at once, visible, enabled, disabled and editable are 'Element is not attached to the DOM' (green on the code before: the core's injected script already answers as stock, measured on a detached node) (+6 unit, +6 e2e) 2026-11-22 22:10:15 +01:00
feder-cr 151824d806 The matches of a query rooted at an element are read in one command: the array is listed once with the core's properties, in numeric order, and the list is released; two commands for any number of matches instead of N + 2 2026-11-22 22:10:15 +01:00
feder-cr e8b1d1a0c9 tests: the list of a query rooted at an element is read in one command, whatever its length, in document order, and released when it cannot be read (red: 9 fail, the list is read by its length and then place by place) (+6 unit, +1 e2e) 2026-11-22 22:10:15 +01:00
feder-cr b720b66eba An element handle answers every method of the client but one: queries rooted at the element, its states, its gestures on that node, a handle of what a function returned; the wire-method budget loses 16 entries 2026-11-22 22:10:15 +01:00
feder-cr b3d9f167a0 tests: an element handle serves every method of the client, queries and states of the node, its gestures, a handle of what a function returned (red: 16 of the 17 answer 'a gap', 64 tests fail) (+64 unit, +22 e2e) 2026-11-22 22:10:15 +01:00
feder-cr 240f4ab63e tests: evidence of a popup that is not made: the activation, the gap from pointerdown, and null against a throw (run 45064266867) 2026-11-22 22:09:27 +01:00
feder-cr 6877a2dd28 tests: the page built again asks its new worker once: the second question got 2 (run 45064266867) 2026-11-22 22:08:08 +01:00
feder-cr 929ed9df3a tests: wait_for_function takes its argument as arg=, and the Date an exposed function answers is asked from the page's own realm (an evaluate runs in the caller's world, whose Date is another one) 2026-11-22 22:03:52 +01:00
feder-cr 56ca8b1ad1 tests: the refusals of an argument are pinned by their exact text, the decoder is pinned to the caller's world and leaves no global, and a page that counts Date, URL, Map, RegExp, Error and defineProperty sees none of them (+13 unit, +2 e2e) 2026-11-22 21:42:52 +01:00
feder-cr c0ee281f5b An ArrayBuffer (ab) in the argument of evaluate and its kin reaches the page: the page side of stock decodes it, so it goes to the decoder as it came; the tags this module handles are one constant 2026-11-22 21:41:22 +01:00
feder-cr 608ceea2f3 tests: every tag of a serialized value the driver accepts reaches the page, and an ArrayBuffer (ab) is one (red: ab is 'Attempting to deserialize unexpected value'; the tag list is read from the installed bundle's SerializedValue validator) (+19 unit) 2026-11-22 21:41:12 +01:00
feder-cr 012eca5db3 tests: the first launch from a new path runs in the serial lane: it starves the browsers of the parallel pass (run 45033639069) 2026-11-22 20:57:54 +01:00
feder-cr 51d2df9685 Every argument of evaluate and its kin reaches the page as Playwright sends it: handles, dates, URLs, errors, references, undefined and -0 are decoded in the page, not read as null 2026-11-22 20:54:15 +01:00
feder-cr 26804fcab3 tests: every form of an argument reaches the page as Playwright sends it, a handle, a date, a URL, an error, a reference, undefined, -0 (red: all of them reach it as null) (+73 unit, +23 e2e) 2026-11-22 20:54:15 +01:00
feder-cr 3c452f2e8d tests: the wire-method budget is checked out with LF on every system, as dump() writes it (red on the Windows runners: autocrlf) 2026-11-22 20:53:58 +01:00
feder-cr 645d68e05a tests: the clock guard sees a delay given to a lab server (rule lab-delay): such an e2e test is wall_clock or a reviewed entry 2026-11-22 20:37:58 +01:00
feder-cr 048340176b tests: the far-away gateway family, the whole UDP chain by name and the slow DoH run in the wall_clock lane 2026-11-22 20:37:58 +01:00
feder-cr 174f7a9a7f tests: a lab delay that the product answers in time is a wall-clock test (red: the guard does not see it, the far-away family is not in the serial lane) 2026-11-22 20:37:58 +01:00
feder-cr edf6153895 tests: every wire method the client sends is served, refused by name, or in a budget that only shrinks (26 holes, 3 partial) 2026-11-22 19:52:58 +01:00
feder-cr e64fc01e67 Merge main (3527f573: the characterization of firefox-68, PR #557) into the integration for the candidates 2026-11-22 19:43:37 +01:00
Federico Elia 3527f5736d Merge pull request #557 from oss-invisible/tests/characterization-69
tests: characterization of firefox-68 before the hooks of firefox-69 are reworked
2026-11-22 19:43:07 +01:00
feder-cr 30a5967409 ci: the accounting of the e2e suite counts the oracles and the host GL probe file (20 exclusions); the rows counted again 2026-11-22 18:58:24 +01:00
feder-cr f6aa5b4204 Merge b10b15af into the integration for the candidates 2026-11-22 18:56:06 +01:00
feder-cr 7a3bd43b7a Merge origin/char69/glxtest into the integration for the candidates 2026-11-22 18:56:05 +01:00
feder-cr 47022daa41 Merge origin/char69/occlusion-linux into the integration for the candidates 2026-11-22 18:56:05 +01:00
feder-cr 8a8a583664 ci: the rows counted again after the occlusion on Linux, the host GL probe and the held requests of p4 (the renamed p4 unit file) 2026-11-22 18:56:04 +01:00
feder-cr 3edbc3c791 ci: the unit rows' minimum follows the host oracle's install-folder, gfxtest and WOF tests and the host gate's junit 2026-11-22 18:55:39 +01:00
feder-cr 3e15901170 ci: the host oracle runs every engine from one folder, names the probe gfxtest, and reads a WOF stream as its file
Same install path: the content processes and the forkserver read the link of every
ancestor of <install>/omni.ja (Omnijar::ChildProcessInit -> realpath), so the 68 under
/tmp/ab-host-fetch-<random>/engines and the candidate under the checkout gave 10 leaves of
readlink per seed that were the place of the install. Each engine run (68, 68 again,
candidate) now copies the whole package to <RUNNER_TEMP>/ab-host/engine/firefox, runs from
there and removes it; nothing is normalised in the comparison.

gfxtest: the probe is labelled gfxtest (widget/gtk/GfxInfo.cpp:55 GFX_PROBE_BINARY); the
declared difference now names it (it named glxtest and was reported stale), and covers the
file leaves whose only toucher on the published side is that kind, in the seeds where the
kind is gone.

Windows: a path ending in :wofcompresseddata is the WOF compressed-data stream of the file
the process opened; the ETW reader reads it as that file. Other streams stay distinct.
2026-11-22 18:55:39 +01:00
feder-cr 4fff701c99 Merge b10b15af into the characterization line 2026-11-22 18:52:58 +01:00
feder-cr 2a7616b605 Merge origin/char69/glxtest into the characterization line 2026-11-22 18:52:58 +01:00
feder-cr 616919880a tests: the host GL probe starts only on an undeclared engine (Linux e2e)
A new e2e, Linux only (the GLX probe, gfxtest glx, is a child process of
Firefox on GTK; Windows has none): a declared engine starts no probe from
the launch to the page's WebGL context on firefox-69, and runs it on 68;
with zoom.stealth.fpp.hw_seed 0 Mozilla's probe starts on every engine.

The process tree is sampled with psutil in a thread from before the launch
(tests/_process_sampler.py). A poll can miss a child that lives tens of
milliseconds, so the launch runs under the strace stand-in (execve and the
clones only): every exec of the probe in the log must be a pid the sampler
saw as the probe, the sampler must cover the launch, and the log must hold
the browser's exec; otherwise the test is red with the problem, never green
on a miss. A unit file drives the real sampler with a fake tree.

Rows: wrapper.e2e.suite.linux.3 242 -> 244, Windows exclusion 16 -> 17;
wrapper.unit.all.linux 2382 -> 2389, wrapper.unit.all.windows 2383 -> 2390;
the firefox-69 gate is registered in tests/data/engine_gates.json.
2026-11-22 18:47:09 +01:00
feder-cr 887eb97bca Host gate: compare writes a junit with one testcase per invariant
--junit PATH writes the verdict of compare as xunit2: invariant:<name> for
each invariant and check:<name> for the other checks, classname
scripts.ci_host_gate (the path the hook tests name). A failed check is a
failure, a check with no dumps to look at is skipped.
2026-11-22 18:42:39 +01:00
feder-cr b10b15afdf tests: every held request of the journey starts after the load, the parked fetch of the category page too
The held fetch /hold?id=park of the category page (steps 7 and 8) was started by the noise script while the page was parsed, so
on an engine that announces a request before the commit the client attributed it to the previous document and did not count it.
It now starts from afterLoad(0, ...) like the keepalive fetch of the search page; URL, method and end are unchanged.
The unit test covers every held request (/hold with until) of every page of the steps that are not idle (7, 8, 12), and that no
other page of the journey holds one while it is parsed.
2026-11-22 18:40:02 +01:00
feder-cr f3e408a07d tests: on Linux the occlusion test owns its display and asks X whether the window was covered
The two sessions run on a private Xvfb (DISPLAY by monkeypatch, as the
focus test). The test's own libX11 connection selects VisibilityChangeMask
on the covered toplevel before the cover is mapped, raises the cover, reads
back once the stacking and the geometries (asserted: arrangement), and waits
for X's VisibilityNotify FullyObscured in both halves (never sent: red,
arrangement). With tracking enabled, FullyObscured sent and a page that never
turns hidden is red with a message that says ENGINE. The X record (window
ids, read-back, visibility events with their times) is kept on every run.
Windows side and product assertions unchanged. The parsing and the record
are unit-tested (10 tests, rows wrapper.unit.all.* +10).
2026-11-22 18:25:54 +01:00
feder-cr 9cf288fbd8 ci: the rows counted again after the navigation hook and the held ICE port 2026-11-22 18:04:46 +01:00
feder-cr 6c3f98b1b5 Merge e4f3dd27 into the integration for the candidates 2026-11-22 18:02:55 +01:00
feder-cr 78f34b2b1a Merge 153efcd156 into the integration for the candidates 2026-11-22 18:02:55 +01:00
feder-cr 7221b7da06 ci: the rows counted again after the navigation hook and the held ICE port 2026-11-22 18:02:54 +01:00
feder-cr 7e402528d0 Merge the reproduction of the held ICE port (e4f3dd27) into the characterization line 2026-11-22 18:01:05 +01:00
feder-cr 9745e5e754 Merge the e2e of the navigation hook (153efcd1) into the characterization line 2026-11-22 18:00:51 +01:00
feder-cr 153efcd156 tests: a same-site top-level goto is told moved (the browsing context is replaced); the negative case is a same-site iframe 2026-11-22 17:48:15 +01:00
feder-cr e4f3dd2712 tests: a port of the ICE socket that another process holds on loopback blinds the checks of two connections (red on firefox-68 on Windows; firefox-69 binds it exclusively) (+1 test) 2026-11-22 17:42:21 +01:00
feder-cr 7473b7e933 ci: the unit rows counted again after main 2026-11-22 17:05:25 +01:00
feder-cr a053458faf Merge main (3946c6c0: the evidence of the actions without a point) 2026-11-22 17:03:51 +01:00
feder-cr aebf02da8a ci: the unit rows counted again after main 2026-11-22 17:03:50 +01:00
feder-cr 33701e89d9 Merge main (3946c6c0: the evidence of the actions without a point) 2026-11-22 17:01:56 +01:00
Federico Elia 3946c6c024 Merge pull request #562 from oss-invisible/tests/actions-without-a-point-evidence
tests: the hidden-elements actions test keeps its evidence when it fails (second batch of the intermittent e2e)
2026-11-22 17:01:30 +01:00
feder-cr 9f575af60f ci: the unit rows' minimum follows the network oracle's evidence tests and the page oracle's crash records 2026-11-22 16:58:02 +01:00
feder-cr 1b54d76744 ci: the page oracle keeps what every browser wrote and records a tab that died as a leaf of its own
A candidate run lost the tab of a visit ("cannot find session" in every state.*) and the artifact held only args, json and xml: the crash was inferred.

* The launch probe puts a tee in front of the core's own reader of the browser's output (stdout and stderr on one pipe), so the whole output of EVERY launch is
  saved in crash/<run>/stderr/ whether it ended well or not, and a launch that never made a connection keeps its output too. A launch whose output could not be
  kept is red. Nothing is written to the browser: same environment, prefs, durations and launch count.
* The cores written since a launch began go through gdb whatever code the parent ended with (a content process can die and the parent end with 0); such a launch,
  or one with a minidump, is red. A launch with no core says where it looked.
* A tab that died or a session that was lost during a visit is the leaf crash.tab.<launch> (error and step) in the dump, not a cascade of state.* errors. The
  comparison puts "TAB CRASH side S seed N dpr D launch L at step ..." first, red on that leaf alone, and counts the leaves the dead tab could not read instead
  of listing them as <missing>.
2026-11-22 16:57:31 +01:00
feder-cr 2bafbb8dc7 ci: the network oracle's HTTP/1.1 site ends each connection after its answer, and each seed keeps its requests with their connection and moment outside the compared leaves
A/A run 45025164169 (engine candidate, oss-invisible/firefox_antidetect_patch) broke on both systems.

Linux: the HTTP/1.1 site had a resumed connection on one seed of one run and on none of
the five seeds of the other. The labs are already fresh for every seed (a new certificate,
a new TLS context, so new ticket keys, a new journey site), so nothing is shared between
the two runs: whether the browser opens a second connection to the site while the first
is still busy, before it has read the session ticket, is the pool's race. The site now
answers with Connection: close and ends the connection, so every request after the first
rides a connection opened after the ticket was read, and the resumption happens on every
seed of every run. The default of the capture server stays keep-alive.

Windows: step 15 of the journey (logo, then Account) had one request counted 2 against 1
(release, first Referer "/" against "/account") and the font 10 against 5, on seed 0 of the
second run only. The transcript folds a request into a count and drops the connection and
the moment, so it cannot say which page sent it. The tees now write the connection of each
head and the lab the moment; each seed's transcript keeps, outside the compared leaves
(like exits), the requests of the journey with connection, stage, referer and time, and the
connections of the HTTPS sites with time, stage, resumption and the requests of HTTP/1.1.
Nothing is excused for it.
2026-11-22 16:57:31 +01:00
feder-cr 174602e4ac ci: the unit rows' minimum follows the recorder's tests of how a launch ended 2026-11-22 16:37:23 +01:00
feder-cr 9196a86389 ci: a browser whose parent does not end with 0 is red in the page, network and host oracles, and what it left is kept
Every launch of every oracle (measured, idle, relaunch, warm-up, bare; A/A and A/B) is judged by how its parent ended: a code other than 0, or not seen, is a red
line naming the side, the seed, the launch and the code. A launch that did not end with 0 keeps, in the oracle's artifact, the strace tail and the fatal signal lines
(host), the core through gdb (thread apply all bt, the MOZ_CRASH reason, info sharedlibrary) with the build ids, the .extra and the minidump names, and what no
collector found. The trace records the fatal signals now and drops the signal lines where the log is read. Cores are enabled in every launch without touching the
working directory, the environment, the prefs or the crash reporter. The recorder's own e2e (a parent sent SIGSEGV is red with its evidence) runs in the host job.
2026-11-22 16:36:47 +01:00
feder-cr 0471b59911 tests: the network oracle's job test reads the Windows parts from the suite rows, where its files are in no row 2026-11-22 16:28:58 +01:00
feder-cr e1e6f416bc tests: the gateway reads a request's address in a static method again (as main's far-away watch wraps it); the address type is a thread-local of the module 2026-11-22 16:28:58 +01:00
feder-cr fd5d92cbfc tests: the gateway reads a request's address in a static method again (as main's far-away watch wraps it); the address type is a thread-local of the module 2026-11-22 16:28:58 +01:00
feder-cr 5947f04cf1 tests: a failed set_content of the hidden-elements test leaves the wire, the contexts, the stalls of the process and the runner's load (+10 tests)
The test was red once on Windows ("Runtime.evaluate: no response in 30s" at set_content) with nothing saved, so it could not be classified as a stall of the browser or an evaluate sent to a context that no longer answers.

The test now arms the Juggler wire and the engine's trace before the launch, records the client's frame and page events and each call, and saves them only when its body fails. The reading of the wire no longer depends on a marker in the code: every command with no answer is joined with its context, frame and url (when it was sent and at the end of the log), with the time it waited and whether its context was destroyed since; an answer says how long it took. A stall witness of the process and the runner's load run on the wire's clock, and one line of both goes on the exception as a note.

No probe changes the call it observes: nothing raises into the test, the unit tests make the recording, the probes and the note fail on purpose and the exception is the same object.
2026-11-22 16:23:13 +01:00
feder-cr 9533a9a35c Merge the Glean test of generate mode (13049ab0): firefox-69 carries both properties in the registry of engine gates 2026-11-22 16:21:32 +01:00
feder-cr 8f2f9e992a Merge remote-tracking branch 'origin/main' into integ/candidate-69 2026-11-22 16:19:31 +01:00
feder-cr ce328d8888 ci: the rows counted again after main and the Glean test 2026-11-22 16:16:36 +01:00
feder-cr 53f32936f0 Merge commit '13049ab0' into tests/characterization-69 2026-11-22 16:14:25 +01:00
feder-cr 1696d04a6d Merge main (b28bffd7: the first batch of the fixes of the existing tests) into the characterization line 2026-11-22 16:14:25 +01:00
Federico Elia b28bffd7af Merge pull request #561 from oss-invisible/tests/install-wait-without-a-real-clock
tests: first batch of fixes for the intermittent e2e of main (the install wait, the goto-stopped setup, the moving page's goto model, a read's timeout)
2026-11-22 16:13:44 +01:00
feder-cr e5ebd87472 ci: the entries of the suite rows are sorted 2026-11-22 16:13:16 +01:00
feder-cr 19e4fcc3cb Merge the two e2e of the navigation hook (tests/a-navigation-that-moved-is-told-by-the-engine, d4ba9b50) into the integration for the candidates; the rows counted again 2026-11-22 16:12:27 +01:00
feder-cr 13049ab0c9 tests: generate mode does not start Glean on firefox-69, and does on 68 2026-11-22 16:12:26 +01:00
feder-cr 02a7ac2766 Merge the oracles of the page, the network and the host (PR #555, 2851d1d9) into the integration for the candidates 2026-11-22 16:10:23 +01:00
feder-cr a9542fb863 Merge the batch of the fixes of the existing tests (tests/install-wait-without-a-real-clock, fd7d8a64) into the integration for the candidates 2026-11-22 16:09:38 +01:00
feder-crandClaude Sonnet 5.5 8095253e06 ci: the unit rows' minimum follows the page oracle's job test and the poison control's tests
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-22 15:53:48 +01:00
feder-cr 704851f0e7 ci: the control's reference is a Playwright Firefox that reads the machine's scheme, and the Windows canary is installed machine-wide
Run 45026082150: stock Firefox read no dark scheme on either system and, on Windows, did not see the per-user canary.

* the scheme: Playwright's playwright.cfg sets pref("ui.systemUsesDarkTheme", 0) (line 157 of the cfg of the build we install), and
  widget/nsXPLookAndFeel.cpp GetIntValue reads a set pref before the system (NativeGetInt: GTK's theme, the HKCU
  AppsUseLightTheme value of Windows), so whatever the poison says the stock reads light. The control now launches a COPY of that
  Firefox whose cfg has no such line (the same build and prefs otherwise; refused if the cfg or the line is not there), and says
  what it took out in poison-control.json. The control was never headless: the engines of the oracle run on a hidden desktop (the
  core's _headless.py), headed, and only `-headless` would use the hardcoded light of widget/headless/HeadlessLookAndFeelGTK.cpp.
* the font: on Windows the canary goes to the Fonts folder of the system and under HKLM (the runner is an administrator); undo
  removes both.
* nothing is in trial now: dark and the Windows canary are required again.
2026-11-22 15:52:55 +01:00
feder-crandClaude Sonnet 5.5 c6ca3ebaf5 ci: the page oracle's A/A has jobs of its own on a pull request, Linux and Windows, and the shared jobs leave its file out
Run 45030727459: the shared Linux e2e job hit its 40 minutes with every test passed; the page oracle (5 seeds, the H7 relaunch and the ab. visits) took 38 of them.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-22 15:52:51 +01:00
feder-cr fd7d8a64aa tests: a failed far-away gather says the control connection's times, the core's UDP measurement, the stalls of the process and the runner's load (+25 tests)
Both far-away gathers (the one with an rtt and the one after the page loaded) kept no record of where the time went when the core's UDP
measurement ends unmeasured. The watch now also starts, with the gateway's own record: a read of the control connections' times (connect,
greeting, authentication, ASSOCIATE asked and answered, and the longest wait inside the gateway for an answer); a handler on the core's
logger invisible_core._udp_exit at DEBUG, set and removed around the test, next to marks of the launch; a daemon thread that beats every
50 ms and keeps the gaps over 200 ms; and the runner's CPU and load every 0.5 s with psutil. They go in the saved evidence (cells.json,
stall-witness, runner-load, core-udp-exit-log) and as four short lines in the failure message (a note of the exception when the failure is
not an assertion). The second test now keeps evidence too. No budget, threshold or retry changes; every recorder takes one dict per record,
never raises into the test or a server, and a unit file makes each fail on purpose (clock, load source, log record, records list) and makes a
real stall of the whole process (a GIL-holding call) to see the witness catch it.
2026-11-22 15:30:30 +01:00
feder-cr b58e078035 tests: the journey's held keepalive fetch starts after load, not while the page is parsed (+5 tests)
Step 12 of the p4 journey asserts that an open keepalive fetch keeps networkidle from being reached. The search results started that fetch
during parsing, which races with the commit being told: the engine announces the request at once, the commit waits for the handshake, and
the client drops the request at the commit (the reference Juggler does the same). The page now starts it with afterLoad(0, ...), a task
after the load event, so the step tests the rule and not the race; the verdict and pages.json are unchanged. A unit test reads the served
page and forbids the held keepalive fetch outside an afterLoad callback.
2026-11-22 15:23:42 +01:00
feder-cr b1673988b4 tests: a lab guard reads the host interfaces once, not at each refusal
A gateway of the lab refused the browser's CONNECTs to the DoH the core
declares (162.159.61.4:443) 117 and 254 times in two single tests, 2296 in
one leg, and every refusal read the host interfaces again with psutil in the
pytest process that runs the core's UDP measurement.

LabGuard now reads the interfaces once, when it is made, and judges every
destination against that reading: a refusal is a synchronous list append.
The decision-time reading (and its read_errors path) is gone; the reason of
a refusal says the reading was made when the gateway was made.

test_a_guard_reads_the_interfaces_once_however_many_destinations_it_refuses
counts the readings of a fake psutil: 1 for 40 refusals and 3 decisions
(44 on the old code).
2026-11-22 15:22:04 +01:00
feder-cr 06e49f0b4d ci: the Windows e2e jobs keep TEMP and TMP on D:, as on tests/characterization-69 (766961dc, the same lines)
The Firefox profiles land in TEMP. On C: the four browsers of a part saturate the runner's disk and the parent's main thread stops for
seconds: A/B of the engine series, run 44780607530 (profiles on C:, 5 stalls) against run 44780612863 (TEMP on D:, none). Seen again on
this branch, run 45028125122, Windows part 3, test_fakeweb_p4_e2e step 1: the lab answered "/" at 1137.21 and the engine committed at
1144.78; no request reached the lab from 1137.21 to 1146.94 and from 1147.12 to 1156.22, while the 7 requests reported in flight had all
been answered and closed by 1147.12.
2026-11-22 14:57:51 +01:00
feder-cr ef0d836c28 tests: the storage test of the second page saves the frames, the wire and the evaluate's context when it fails (+15 tests)
The B frame of the second page raised "Execution context was destroyed" at window.__r once on Windows. Nothing here changes an assertion, a wait or
a deadline: the module arms FailureEvidence before the browser launches (Juggler wire, the engine's trace), and a failing test saves the client's
framenavigated, frameattached and framedetached of both pages with url and name, the times at which wait_frame returned and the evaluate was
called, page.frames at the failure, and a reading of the wire that joins the evaluate's context id with its frame, url and answer.
Every recording runs in one guard and takes its data under a single field, so none can raise into the test or collide with a field of the data.
2026-11-22 14:51:30 +01:00
feder-cr 2851d1d934 ci: the unit rows' minimum follows the A/B oracle's poison and realm tests 2026-11-22 14:45:11 +01:00
feder-cr 9c70b5abf7 ci: the control's scheme and Windows canary are in trial, measured and told but not required
Run 45026082150: the page A/A was zero on both systems, and the negative control read, for stock Firefox, no dark scheme on either
system and, on Windows, did not see the per-user canary font. Until a run shows that stock reads them they are IN_TRIAL: still
measured, printed, written to poison-control.json (in_trial) and to the job summary, never silently, but they do not make the control
broken. Everything else stays required: language, zone, formats, the canary and fonts.conf on Linux, the audio sink.
2026-11-22 14:44:45 +01:00
feder-cr aaebd7384f ci: the poison's verify reads what the system reports, the control follows the system scheme and a canary measures its own width, and the ab leaves leave out the launch's own noise
Run 45024276134 (page oracle A/A on the poisoned host), the harness defects:

* Windows: Set-WinUserLanguageList keeps the tag 'ja' for ja-JP, and verify wanted 'ja-JP'. The apply now records what the OS reports
  (culture, language list, zone, theme); verify holds the machine to that record and, separately, to the semantic check that culture
  and first language are Japanese, so it stays red when the poison is not in force and does not depend on the form of the tag. A
  failed apply also tells the later steps where its state is, so the undo runs.
* the negative control used Playwright's default context, which emulates a light scheme: it follows the system now (no-override),
  and requires that stock reads a Japanese format.
* the canary was 'present' when it measured differently from a generic family, which on Linux are the canary itself (the user's
  fonts.conf): it is present when a text measures its own width (216 px).
* the ab visit's canvas and OffscreenCanvas PNGs carry the launch's own deBG chunk (the host gate's noise.png_deBG), and the iframe
  origin carried the site's random port: the PNGs are hashed without that chunk (and the pixels are hashed too) and the port is
  not recorded.
2026-11-22 14:44:40 +01:00
feder-cr 2d0660c85d ci: the Linux poison also sets the user's fontconfig, and the poisoned run keeps what the published engine reads from the host
* ~/.config/fontconfig/fonts.conf makes the canary the first choice of sans-serif, serif and monospace and sets antialias off, full
  hinting, rgb subpixels and the light LCD filter; undo restores the file that was there or removes the one the poison wrote. The
  page probe measures the three generic families; the negative control requires stock Firefox to pick the canary for all of them on
  Linux, and an engine that does is a finding.
* the published engine is dumped on the clean runner before the poison (ci_ab_oracle.py clean); the oracle's own run is the poisoned
  dump of the same seeds, and every leaf that differs is written to poison-host-dependence-68.json and to the job summary: a host
  dependency the published engine already has, a finding and never a verdict.
2026-11-22 14:44:37 +01:00
feder-cr 91b576aed2 ci: the page A/B oracle reads a poisoned host and every realm a page can make, and holds both to the declared identity
The comparison of two engines on one machine lets through a value both read from it. The page oracle's leg now runs on a machine given
values the engine must never read, and the dumps are held to what the persona declares:

* scripts/ci_poison_host.py: apply, verify and undo per system. Windows: the zone of Lima (tzutil), the ja-JP culture and user language
  list, the dark scheme (HKCU AppsUseLightTheme and SystemUsesLightTheme), a per-user canary font. Linux: TZ, LANG, GTK_THEME, a
  user-installed canary font, and a null PulseAudio sink at 96000 Hz with 6 channels as the default. The canary is generated, byte for
  byte the same every time (no third-party font). Every PowerShell forces the invariant culture first, and the state it keeps is text
  read before any change. `control` is the negative control: Playwright's own Firefox on the same runner must read the offsets of Lima,
  the dark scheme, the canary's width and, on Linux, the 96000 Hz sink, or it is a broken control. The dumps' findings are the host's
  values against what the identity declares (the core's prefs of the seed and the retail reference).
* host_gate_page.html: the ab.poison probe (one block between two markers, which the control evaluates too).
* scripts/host_gate/ab and ci_host_gate.py: an extra visit of seeds 0 and 63 in a launch of ja-JP and in a context of de-DE and
  America/Lima: the top window, a cross-site iframe, a srcdoc iframe, a worker, a shared worker, a service worker answering a
  navigation, an audio worklet, OffscreenCanvas, canvas and WebGL hashes in each, window.open with and without features, the
  Accept-Language the server saw per kind of request, and a re-read after back/forward. Leaves are under ab. (skipped by the retail
  comparison like diag., compared by the A/B). Seed 63 is the control of seed 0: it must differ on at least AB_CONTROL_MIN leaves.
* the page oracle's test checks that the ab visit read, that the control held, and on a poisoned host that the poison is in force,
  that stock Firefox read it and that neither engine did.
2026-11-22 14:44:18 +01:00
feder-cr d4ba9b5046 tests: the registry of engine gates knows the firefox-69 test of a moved navigation; the e2e file is LF 2026-11-22 14:41:05 +01:00
feder-cr 6ff74cd2a0 ci: the unit rows' minimum follows the page oracle's final shards 2026-11-22 14:36:57 +01:00
feder-cr f21523aba7 ci: the page oracle visits seed 0 twice on one profile (second launch under relaunch.), the final seeds have an A/A in four shards on their own jobs, and the e2e guard is sized from the shard
The dump launches seed 0 a second time on a profile folder a first launch used, in the wrapper's persistent context, and keeps that launch's items under the relaunch. prefix of the visit: the retail comparison never reads them, the A/A and the A/B hold them to equality, count them apart from the visit's floor, and are red when a side lacks them. The e2e reads AB_ORACLE_SEED_SET and AB_ORACLE_SHARD and sizes its hang guard from the seeds of its shard, the engine runs and the extra launches. e2e.yml has a touched step and two jobs (Linux and Windows) of four shards each for the A/A of the final set, run only when a pull request changes a file of the page oracle.
2026-11-22 14:35:59 +01:00
feder-cr 3fa1232011 ci: the cap of rare system modules does not count a resource file with its library or a catalog under catroot, and says so
Run 45024863785: the host A/A of Windows was red for 21 rare modules in the measured launches of run A, 6 catalogs under catroot and 15 resource files, no library.
- A .mui does not count when its library (the same name without .mui, one folder up from the language folder) is among the modules seen in that run, in any launch: the
  library carries the count. An orphan .mui counts.
- A .cat under catroot does not count (Windows signature verification, not a module the engine chooses).
- Libraries and every other file keep the cap (5; 30 in the long layer), which is not raised.
- The report always prints the numbers: counted, .mui excused, .cat excused, orphans. In the A/B the .mui and .cat the 68 and the candidate opened are listed, and a new
  library shows through the library itself.
2026-11-22 14:33:05 +01:00
feder-cr 3b094de0a7 ci: the unit rows count the p2 history tests 2026-11-22 14:31:34 +01:00
feder-cr fe8b648f2a tests: the download test keeps LF line endings 2026-11-22 14:27:57 +01:00
feder-cr 86c2066571 tests: the download left to Firefox keeps the network and JS download logs, and its evidence from about 10 s
(cherry picked from commit 10c552698fe0a53b4ef7f1aaa86e94bfbcfdddbd)
2026-11-22 14:27:35 +01:00
feder-cr 8044dc0cb5 test(fakeweb p2): a round that does not idle keeps the whole in-flight list, what the lifecycle held open at the expiry, and each open request's history on the Juggler wire (+4 unit tests)
(cherry picked from commit c7b8c4533e)
2026-11-22 14:26:58 +01:00
feder-cr 36cba6a41a tests: a navigation the engine moved to another process is told by the engine (firefox-69), and one that stayed is not 2026-11-22 14:24:26 +01:00
feder-cr d922dffc86 tests: the far-away gather's watch records through one guard and never raises into the gateway (+7 tests)
The record of a datagram carried the keyword 'source' twice, which raised in the gateway's own inbound thread, so no datagram was relayed.
Every recording of every wrapper now runs in _Watch.safely, after the original call, with the journal field renamed origin. A unit file
drives a real gateway (UDP ASSOCIATE and a relayed datagram), also with each recording made to raise.
2026-11-22 14:23:31 +01:00
feder-cr a84cb8d95f Merge remote-tracking branch 'origin/char69/cores' into tests/characterization-69 2026-11-22 14:17:21 +01:00
feder-cr 52b2fa1344 tests: the occlusion test records, in both halves, whether the order without topmost is kept and who has the foreground
Before the topmost arrangement each half now does the plain one: the covered
window is inserted right after the cover, with no topmost. It then waits for
the answer the half waits for anyway (hidden with tracking, two frames
without) and records, as evidence and never as a verdict, the calls' answers,
the Z-order from GW_HWNDFIRST down to the covered window, and the foreground
window with its pid and process. It also records whether that pid is one of
the two sessions' engines (the owners of the two windows). FailureEvidence
saves the record under $RUNNER_TEMP/invpw-evidence/test_window_occlusion/ on
every run, green or red. Every message carries, per half, "order without
topmost: kept / not kept, foreground: pid X (engine yes/no)". The topmost
arrangement, the precondition read once and the assertions are unchanged.
2026-11-22 14:11:06 +01:00
feder-cr 8f6995c45b tests: the occlusion test makes the covering window topmost and records the arrangement it reads back
In e2e run 45022307128 (windows, part 4) the control half passed, and the
product half was red at the precondition: SetWindowPos returned success and
the covered window took the requested rectangle, yet the covering window was
not above it. The plain insert-after was never kept for that half (the state
read the same for 30 s). The test did not record the Z-order or the
foreground's process, so it cannot tell a request the system did not keep
from a covered window raised back.

The covering window is now made HWND_TOPMOST (the system keeps it above every
non-topmost window, whoever has the foreground), and then the covered window
moves inside it with SWP_NOZORDER | SWP_NOACTIVATE; that move, last, is the
tracker's signal. The precondition is read back once, right after. Every red
carries both calls' return values and GetLastError, the Z-order from the top
down to the covered window (process, class, topmost), and the foreground
window with its process, read right after the arrangement and again after
the page answered. The assertions are unchanged.
2026-11-22 14:01:08 +01:00
feder-cr 866436f822 tests: the core of any crash is read by gdb after the test that fails (temporary)
The -11 at the exit of the security state's generate (runs 44985244053, 45014369018) left no core: a release build crashes in silence, and only a core
tells a wanted crash (gMozCrashReason) from a bad access. tests/_crash_cores.py, TEMPORARY:

* tests/conftest.py raises the soft RLIMIT_CORE of the pytest session to its hard limit once, at pytest_configure, on Linux: every engine a test starts
  inherits it, the core's own launches included;
* a pytest_runtest_makereport wrapper, after every phase that fails, has gdb read every core* in $INVPW_CORE_DIR (all threads' backtraces and names,
  the signal's address, gMozCrashReason, registers, shared libraries with build ids, mappings; the executable from the core's header, else
  INVPW_BINARY_PATH) into $RUNNER_TEMP/invpw-evidence/cores/<test>/ and deletes the core; the cores left after a passing test are deleted and listed in
  cores/after-passing-tests.txt.

tests/_generation_evidence.py keeps only stdout, stderr and the profile's files of the core's launch: its core-limit raising and its own gdb call are
gone, and the direct launch of tests/test_security_state_engine_e2e.py no longer lifts its limit. The proof with a fake engine that dies by SIGSEGV
through the core's real generate now asserts gdb's text with a backtrace on Linux (where a core lands and gdb exists) and the Linux-only note on
Windows; tests/test_the_core_of_a_crash_is_read_by_gdb_after_a_failed_test.py drives the conftest hook with a fake core and a fake gdb on every
system. Unit rows: +4 each (2301 Linux, 2302 Windows).
2026-11-22 13:48:52 +01:00
feder-cr dd1fa5324e tests: the two-connections loopback test also keeps the statistics of both connections, the browser's stdout and who holds UDP 5353 when it fails
The page records the time after each of the four descriptions and, when the wait is over (or an await throws), the getStats of BOTH connections: every local and remote candidate and every candidate pair with its checks sent and answered. The connections are closed in the page whatever happened. The launch's stdout (the engine's timecards) is copied to engine-stdout.log by wrapping the stream the core hands to its own reader, in the test process; MOZ_LOG becomes timestamp,sync,mdns_service::*:3,mtransport:5,signaling:1 (the timecard exists only while signaling is enabled). When a run is not right, the machine's holders of UDP 5353 are written while the browser is still up (Get-NetUDPEndpoint and Get-Process on Windows, ss on Linux). No assertion, wait or deadline changes.
2026-11-22 13:47:22 +01:00
feder-cr 8a57737969 tests: the popup's recorder binds the error text before the lambda that writes it (F821) 2026-11-22 13:22:54 +01:00
feder-cr 10d15eee00 ci: the unit rows name the files of the merged fixes, counted again 2026-11-22 13:19:47 +01:00
feder-cr 5f64171b68 Merge commit '6f0a3af9' into tests/characterization-69 2026-11-22 13:17:20 +01:00
feder-cr ebcf4ab793 Merge the evidence of a failed security-state generation into the characterization line 2026-11-22 13:17:19 +01:00
feder-cr 06f0de8a7f Merge remote-tracking branch 'origin/char69/ownaddr' into tests/characterization-69 2026-11-22 13:17:10 +01:00
feder-cr 3571ea427e Merge the first batch of the fixes of the existing tests (PR #561, d76ecfbf) into the characterization line 2026-11-22 13:17:09 +01:00
feder-cr 72c7e6acf6 tests: the far-away gateway gather saves, when it fails, where the page's STUN request went
Evidence only (webrtc-far-away-<ice row>-<rtt>): the gateway's control connections and datagrams with their times and addresses,
the page's candidates, ICE errors and gathering states, the timings, the Juggler wire and the addresses of the runner.
Assertions, waits and deadlines are unchanged.
2026-11-22 13:12:02 +01:00
feder-cr 78670896b9 tests: the core's own generation of the security state keeps its evidence when it fails (temporary)
In run 45014369018 the -11 came from the CORE's generate, which _ready calls once per module and whose outcome three tests share; the test's own
launch had exited 0, so its save path never ran, and the core's launch writes stdout and stderr to the null device, deletes its work profile before
it raises and keeps the test process's core limit of 0. tests/_generation_evidence.py wraps the core's launch while _ready runs it: stdout and
stderr to files, the soft core limit raised to the hard one (Linux), the profile's files noted at the engine's exit, and on GenerationError all of
it saved in $RUNNER_TEMP/invpw-evidence/security-state-generate-core with gdb's backtrace where a core lands. The direct launch lifts its limit the
same way (preexec_fn, no sh wrapper). A unit test proves it with a fake engine that dies by SIGSEGV through the core's real generate.
2026-11-22 13:08:58 +01:00
feder-cr e461d9d763 test(h3 lab): the residual case of the QUIC-first order is measured: a client that starts a QUIC handshake and vanishes holds the TCP of its IP until the QUIC idle timeout (+1 unit test) 2026-11-22 13:07:46 +01:00
feder-cr 365df5d90f test(read after goto): the test saves, when it fails, the client's view of every request and navigation, the Juggler wire, the engine's trace and the server's record of the requests it served 2026-11-22 13:06:26 +01:00
feder-cr aa078c0ff9 test(popup): the server-side recorder passes every call through unchanged and a recording error never reaches the server 2026-11-22 13:06:00 +01:00
feder-cr 2ab0b97072 test(popup): the 25 s popup saves, when it fails, the engine's wire and trace, what the server sent to the client and did with the target, what the client heard and the destination's record 2026-11-22 13:05:59 +01:00
feder-cr 5e70b513ce tests: the two-connections loopback test keeps what the lab heard on the mDNS group, packet by packet, when it fails
A passive listener (tests/_mdns_listener.py) joins 224.0.0.251:5353 on 127.0.0.1, the interface the engine's responder joins, before each launch and records every packet with its time, source, query or response, names and addresses. It never sends or answers, shares the port with the engine's socket and never raises. No assertion, wait or deadline changes.
2026-11-22 13:05:59 +01:00
feder-cr c0683e010b tests: the two-connections loopback test keeps the mDNS and mtransport logs and the page's ICE timeline when it fails
On failure the test saves the engine's own log of the failing launch (mdns_service and mtransport, MOZ_LOG_FILE in the evidence folder), the timings and the page's timeline of every launch up to it: each icecandidate of both connections, every ice and connection state change, when each addIceCandidate was called and settled. No assertion, wait or deadline changes.
2026-11-22 13:05:59 +01:00
feder-cr 525832571f tests: the no-proxy HTTP/3 test keeps the engine's HTTP log, the lab server's record and the visit timings when it fails
On failure the test saves the engine's own log of the launch (nsHttp and the neqo_glue, neqo_http3 and neqo_transport modules, MOZ_LOG_FILE in the evidence folder), the lab server's record of every TCP and QUIC connection (start, handshake, each request with its path, close and reason) and the url, protocol, goto time and read time of each visit. No assertion, wait or deadline changes.
2026-11-22 13:05:55 +01:00
feder-cr 6f0a3af9fd tests: the focus test gives the X input focus itself, as the window manager the private Xvfb lacks
On the private Xvfb no window manager runs, so nobody calls XSetInputFocus: the
focus stays PointerRoot and GDK activates the toplevel under the pointer
(has_pointer_focus when no _NET_SUPPORTING_WM_CHECK), while Firefox presents a
window (gtk_window_present_with_time, XSetInputFocus without a WM) only when it
is not active already. XGetInputFocus therefore read PointerRoot for the whole
wait although the first page had the focus.

The test now does the window manager's part on Linux: it finds the window the
step names by its _NET_WM_NAME and gives it the X input focus (the first
session's, the second session's, and the session's own new window as a focus
on map), then reads the focus back before judging; on Windows the same steps
ask for the foreground as before. X errors no longer end the process.
2026-11-22 12:57:09 +01:00
feder-cr e68597cdb8 ci: the unit file of the lab server's QUIC-first order is in the rows of the whole unit suite (+5 tests) 2026-11-22 12:54:59 +01:00
feder-cr 59186492f3 test(h3 lab): LF line endings for the new test file, as the rest of the repository 2026-11-22 12:54:43 +01:00
feder-cr 9ef9ae651c test(h3 lab): the TLS of a TCP connection waits for the QUIC handshake in progress of the same client, as a real network orders them (QUIC 1 RTT, TCP+TLS 2) 2026-11-22 12:54:27 +01:00
feder-cr 13ecefb579 test(h3 lab): the QUIC connection of a client is ready before its TCP+TLS one while its QUIC handshake is in progress (red on the current server) 2026-11-22 12:53:30 +01:00
feder-cr 93239a1a10 tests: the save-on-failure helper of the e2e (tests/_evidence_on_failure.py as on tests/characterization-69 bc6d861f, unchanged), for the journey's evidence 2026-11-22 12:50:09 +01:00
feder-cr 42c344a180 test(fakeweb): a failure of the journey's request log is never the client's 2026-11-22 12:49:55 +01:00
feder-cr 261883cfd5 test(fakeweb): the journey saves, when it fails, the site's record of each request, the client's log of every request event per step and each step's in-flight list 2026-11-22 12:49:55 +01:00
feder-cr 652d7ead39 tests: a gateway says why it refused and which interfaces of this host it read; an unreadable list raises
Every refusal of LabGuard now carries its reason: the lab's rule (a name that is not localhost; an address that is not loopback, not a
documentation range and not one of the N addresses of this host read at the decision) or the narrower rule of the gateway (the DoH gateway
carries only loopback; the IPv6 literal gateway only its listener). The record also says, once per gateway, the interfaces of this host as
read when the gateway was made (by interface name) and how they were read (psutil.net_if_addrs, its version, the normalisation).

The reading never fails silently any more: _own_addresses returned an empty set on any exception (psutil raising or not importing, _witness
not importing), which made every address of this host "not the lab's" without a word. _witness.read_host_interfaces raises
HostInterfacesUnreadable (also for an entry that is not an address and for a list with no address at all); the guard raises when it is made,
a failure at a decision refuses with that reason and raises at the close; the witness keeps an arrival it cannot judge as the host's and
raises when read.

The refusals of 10.1.0.52 in run 45014369018 (Windows part 2) were the DoH gateway's own rule in
test_nothing_of_a_context_leaves_but_through_its_proxy_e2e (the witness stands at the runner's address and no proxy may forward to it),
which the record did not say. Nine unit tests, red on the old helpers; registry: unit.all 2269 (Linux), 2270 (Windows).
2026-11-22 12:42:37 +01:00
feder-cr d76ecfbfbb Version 0.58.1: a read that runs out of time says Playwright's timeout (no tag: the release is decided with firefox-69) 2026-11-22 12:11:29 +01:00
feder-cr fc3622345f ci: the unit rows hold the model of a moving page's goto and the read whose probe ran out (24 tests more) 2026-11-22 11:49:22 +01:00
feder-cr c208d2f895 A read's probe running out of time is the read's timeout, not a second look at the clock 2026-11-22 11:49:05 +01:00
feder-cr a57ea6d34a tests: a read whose probe ran out of time is the caller's timeout, whatever the clock says 2026-11-22 11:49:05 +01:00
feder-cr bdb5a84508 tests: after a goto of a moving page raises the frame may go with either page; each test of the moving pages has its own page 2026-11-22 11:49:05 +01:00
feder-cr d8179ab1e0 tests: the model of where the frame goes after a goto of a moving page raises, on a fake page (red on the model that picks one page) 2026-11-22 11:49:05 +01:00
feder-cr 84ce385ef5 tests: the goto-stopped test says in one line why a page is not reused 2026-11-22 11:41:25 +01:00
feder-cr 4cc4b8e7c8 tests: each iteration of the goto-and-every-way-it-is-stopped test runs on its own page, so a refresh the engine replays late cannot fall on the next iteration's setup goto 2026-11-22 11:41:25 +01:00
feder-cr bc6d861f62 tests: the download left to Firefox keeps its evidence when slow, the shutdown ping is judged on the core's own grace
- test_a_context_without_download_options_is_left_to_firefox: the download reputation prefs are no longer switched off (a slow save is the product's); the seconds from the click to the file stay a junit property, and a save slower than 40 s (judged after the fact, never a verdict) keeps in invpw-evidence/download-left-to-firefox the test server's record, the client's requests, the Juggler wire and trace, and a MOZ_LOG of the download machinery
- _evidence_on_failure: keep(why) saves what the helper holds though the test passed; arm(moz_log=...) and note_records(...)
- test_the_shutdown_ping...: no patch of SENDER_GRACE nor of the session's safety net; the ping must be on the endpoint when the session has ended, within the core's 10 s grace
2026-11-22 11:38:07 +01:00
feder-cr 8f8a191e9b ci: the unit rows count the new test of the Marionette helpers 2026-11-22 11:17:51 +01:00
feder-cr eca6652f56 Merge remote-tracking branch 'origin/char69/movesonevidence' into tests/characterization-69 2026-11-22 11:16:41 +01:00
feder-cr fbae6d54a4 Merge remote-tracking branch 'origin/char69/misc' into tests/characterization-69 2026-11-22 11:16:41 +01:00
feder-cr 836e16724e Merge commit 'eb203fc5' into tests/characterization-69 2026-11-22 11:16:40 +01:00
feder-cr 2ca4fa8084 Merge remote-tracking branch 'origin/char69/windowdet' into tests/characterization-69 2026-11-22 11:16:30 +01:00
feder-cr 8dc5c3745a Merge remote-tracking branch 'origin/char69/pids' into tests/characterization-69 2026-11-22 11:16:30 +01:00
feder-cr 759bc060b0 tests: the crash-file collector and the closed-tab wait are proved on the losing interleaving, built on purpose
- The watcher test depended on a thread and on when the file was written: it could see the name before the content and delete the profile before the next look. The
  collector now has scan_once (the thread's look, and stop's last one); the tests drive it: the file is placed empty, then half written, then complete, and a file seen
  empty is read again when its size changes. Red when a file is read once, green on the size re-read.
- The network walk test made the beacons arrive from a thread after real sleeps and asserted a wall-clock bound: the beacons now reach the site one at each look of the
  walk's own wait (the losing interleaving: the walk is already waiting), and "no wait" is no look at all. Red without the wait, green with it.
- The geo lab test's request has a hang guard of 60 s, not 5.
2026-11-22 10:51:45 +01:00
feder-cr 364175411e ci: the unit rows count the install wait's busy-machine case (one test more) 2026-11-22 10:43:07 +01:00
feder-cr 87bd845ac0 tests: the install wait runs on a fake clock, so its rounds do not depend on the load of the machine 2026-11-22 10:40:21 +01:00
feder-cr 7f25429b4f tests: a busy machine cuts the install wait's rounds short (red: the wait reads the real clock) 2026-11-22 10:38:53 +01:00
feder-cr ce65951227 tests: the type a process was given is read for the process instance, not for the pid alone
remote_types read the engine's child logs in the order of their names (child-10 before child-2) and kept the last
type per pid, so a pid reused by a later content process could be read as the site of the ended one and the waits
for "no process of the site is left" never became true. The lines are now stamped with the time MOZ_LOG logs, ordered
by it (then by child number as a number), and a process takes only the types logged at or after its own creation time.
Unit tests with fake logs: reused pid, child-10 against child-2.
2026-11-22 10:36:04 +01:00
feder-cr 766961dcdb tests: steady e2e of the characterization round (download without options, shutdown ping, dom iterables, windows TEMP)
- test_a_context_without_download_options_is_left_to_firefox: Firefox's own save no longer runs the download reputation check; the time until the file landed is recorded (not judged)
- test_the_shutdown_ping...: the sender is given 120 s (_profile.SENDER_GRACE) and the session's safety net follows, so the verdict waits for it to end by itself
- test_dom_iterables_from_evaluate_e2e: one browser per case
- e2e.yml: TEMP and TMP on D:\a\_temp in the Windows jobs, as the engine series' gate
2026-11-22 10:19:58 +01:00
feder-cr eb203fc58c tests: the Marionette port is the one the browser got, and the language worker test waits on each content process
- the browsers of the e2e tests are launched with marionette.port 0 and the port is read from <profile>/MarionetteActivePort
  (webfont_probe.marionette_active_port): no port is freed for a browser to take, so a neighbour cannot bind it first
- the worker with its own language is read after a process script has read intl.accept_languages in the content process of each tab
- the script cache test keeps the file size of the sample that matched
2026-11-22 10:17:18 +01:00
feder-cr 3f4ee5c61e tests: the focus and fullscreen window tests judge after the event, not after a pause
The focus test is wall_clock (it runs alone, after the parallel tests), its two
sessions share a private Xvfb on Linux, and before judging it reads from the OS
that the focus is where the step says (X input focus, GetForegroundWindow on
Windows); "no blur" is judged after that and a round trip to the page's process
instead of a two-frame pause.

The fullscreen test waits for the condition itself with the engine on (declared
size, display-mode fullscreen, fullscreenElement) and for fullscreenchange and
the following resize with it off; on Windows it reads the monitor first and
declares a size that is not the monitor's.
2026-11-22 10:17:09 +01:00
feder-cr d358b5f2e5 ci: the long launches are a layer of the host oracle's system-module class
A/B: a module the candidate's idle or bare launch opened is red only if no launch of either 68 run opened it (the measured seeds, the warm-ups and the long launches).
A/A: the modules only one run has are counted in two layers, the measured launches (cap 5) and what only a long launch of the run opened (cap 30), each printed with
its count; a module the other run has in any launch is not rare. Paths outside the class stay as they were.
2026-11-22 09:27:14 +01:00
feder-cr 5d0be75316 tests: the occlusion test puts the covering in place on Windows and checks it as the tracker reads it
WinWindowOcclusionTracker marks a window OCCLUDED only when the windows above
it in the Z-order cover its rectangle, the second session's window lands above
the first only if the system lets its process take the foreground, and a move
of another process's window is heard only once that process was seen with a
visible window. Opening the second window left all three to the runner: red in
one Windows run, green in two. On Windows the test now moves the first window
right under the second, inside its rectangle (a maximized window counts as its
work area), with SWP_NOACTIVATE; that move is the tracker's own signal. Before
waiting it checks the cover is visible, uncloaked, opaque, not a popup, above
the first window and containing it, and a red names what did not hold.
2026-11-22 09:25:11 +01:00
feder-cr 0f265fedd9 ci: the host oracle's Windows system modules are red only when the candidate alone opens one, and the preloaded newtab is absent or present
- System modules (System32, SysWOW64, WinSxS; the catalogs are under System32\catroot): loaded by the Windows loader on behalf of system DLLs, no page reads them. A set
  per path over the launches that are compared (the seeds and the warm-up). A/B: red only a module the candidate opened that no launch of either run of the 68 opened; a
  module the candidate lacks is printed, not red. A/A: a module only one run has is rare, printed with its count; red when a run has more than 5. The idle and the bare
  launch are not in the class (run 44993377458: 19 of the 21 modules only run A had were theirs). Everything else stays strict, the shortcut inventory is its own rule.
- Privileged Cont (the preloaded about:newtab, NewTabPagePreloading.sys.mjs:96, browser.newtab.preload firefox.js:1952): absent or present per launch, more than one is red;
  it depends on the idle time after startup.
2026-11-22 09:24:32 +01:00
feder-cr 410ef27100 ci: the unit rows' minimum follows the network and host oracles' new tests 2026-11-22 09:16:34 +01:00
feder-cr 91e5aa43f0 ci: the host oracle's idle launch holds no rule on the pings, and the Windows system modules are a set over the seeds
Run 44993377458:
- The data-policy notification is never recorded because it is never needed: the core declares the terms of use accepted (invisible_core prefs.py termsofuse.accepted*,
  browser.preonboarding.enabled false), so canUpload() is true from the start (TelemetryReportingPolicy.sys.mjs:839; _delayedSetup :1156 returns before _userNotified
  :988). The idle launch no longer requires the notification or any number of pingsenders (Linux started 1, new-profile; Windows 0): evidence until proven. A separate
  pingsender[.exe] there stays red. The {0, 3} rule of the short launches stays: Linux 3 in all 12 and Windows 0 in all 12.
- Windows system modules (a path under c:\windows) are compared as a set over the union of the measured seeds of a side: a module that is in a seed of each side is
  the same module; one that only one side has in any seed is still red (2 of the 4 differences of the run remain: wevtapi.dll in one tab process, the resource file of
  twinapi.appcore.dll in one parent).
2026-11-22 09:15:47 +01:00
feder-cr 303817c9ef ci: the attribution of datagrams is the set of kinds per destination over the transcript; unattributed ones are counted and printed, not compared 2026-11-22 09:13:06 +01:00
feder-cr dbd2022e34 tests/test_a_page_that_moves_on_e2e.py: a failing read-after-goto round leaves the client log, Juggler wire, engine trace and server record 2026-11-22 07:23:08 +01:00
feder-cr 3c0ef88d88 tests: the bare launch and shortcut cases use lab paths; the unit rows' minimum follows 2026-11-22 07:19:45 +01:00
feder-cr 39fd73116a ci: the host oracle lists what the idle launch left in the places of the shortcut code
On Windows the idle launch of each engine run is bracketed by two snapshots of the places the shortcut code reads and writes: the Start menu of the user and of
ProgramData (Programs below them), the Desktop of the user and the Public one, the pinned taskbar shortcuts and ImplicitAppShortcuts, and every Mozilla-* folder of
ProgramData (the shortcuts log is there). The files that are new, changed or gone (name, size, mtime) are kept in the footprint and summarized in one line of the report
(SHORTCUTS ...): the direct proof of whether the engine leaves a shortcut or a log on the host. Evidence, not compared. The Create disposition stays.
2026-11-22 07:18:52 +01:00
feder-cr b825a5542b ci: the host oracle keeps the old idle launch as a bare case that records how a browser ended, and lists what the tree asked the system to make
The idle launch of run 44988820319 (no client, no page) ran a crash reporter on both systems. It was not a crash: the process is `crashreporter --ping-cleanup`
(CrashManager.in.sys.mjs cleanupPings, started by runMaintenanceTasks 57 s after the launch, AGGREGATE_STARTUP_DELAY_MS), the parent and the reporter ended with exit 0,
and the reporter ran 2 s (send_ping.rs cleanup_main sleeps 2 s). The idle launch now has a page, and the old one stays as a case of its own, never compared:

- bare launch: no client, no page, the same wait; records the exit code or signal of its parents, every crashreporter or minidump-analyzer process with its command
  line, the `.dmp` names and `.extra` contents found in the profile's minidumps and the Crash Reports/pending folders (a watcher reads them while the launch lives, the
  profile is deleted when it ends), and on Linux core dumps in the launch's folder (ulimit -c unlimited) with `gdb -batch -ex bt` and the kernel's core pattern;
- Windows: the footprint lists the host paths a process of the tree asked the system to make (the Create event's disposition: create, open-or-create, overwrite,
  supersede), the evidence of a file written and not only looked for.
2026-11-22 07:18:51 +01:00
feder-cr ac5a519244 tests: every proxy of the tests that could forward outside the lab carries only the lab's destinations
The base Gateway of _socks_servers (CONNECT relay and UDP relay, tcp_from_exit included), Socks5TcpOnly
and the SOCKS5 server of test_proxy_socks_auth_e2e refuse and record any destination that is not the
lab's (loopback, the documentation ranges, the addresses of this host's interfaces, localhost): a
CONNECT is answered with reply 2, a datagram is dropped, and the refusal is written down (time since the
gateway started, address type, destination as received, port, protocol) under
$RUNNER_TEMP/invpw-evidence/<gateway>/, always, when the gateway is closed. forward_only_to only narrows.
The gateway of test_ipv6_literal_connect_e2e reuses the base behaviour and keeps its evidence.
New unit test with known-bad inputs; the two unit rows of the registry name it.
2026-11-22 07:12:32 +01:00
feder-cr f585ea8ccb tests: the host oracle's public-class cases use the public resolvers the gates allow 2026-11-22 07:09:59 +01:00
feder-cr 18f4b716fe tests: the inventory list uses lab paths 2026-11-22 07:09:13 +01:00
feder-cr fb5125b78c tests: the host oracle's stray-path case uses a lab path 2026-11-22 07:08:46 +01:00
feder-cr 6b07f2c1d7 tests: the inventory case's synthetic paths are on a lab drive 2026-11-22 07:08:31 +01:00
feder-cr 0181b29eb8 ci: the unit rows' minimum follows the host oracle's class tests 2026-11-22 07:07:19 +01:00
feder-cr 702aee3930 ci: the host oracle compares a public destination as its class, the shortcut inventory as absent or complete, and what a pingsender spawns with the pingsenders
From the A/A of run 44988820319 (the host oracle, both systems):
- Linux: the parent's direct connects differed only by address (DNS rotation: 140.82.112-114.x:443, 185.199.108-110.133:443, 151.101.x.91:80). A public destination
  is compared as its class, the kind, the verb, the transport and the port; the number of distinct addresses of a class is tolerated, the reason written once
  (NET_CLASS_REASON). No name is made up from an address.
- Windows: in one launch the parent ran the shortcut inventory (the Start menu, Public\Desktop, Quick Launch\User Pinned\TaskBar, the shortcuts log of ProgramData, the
  shell libraries loaded for it): StartupOSIntegration.sys.mjs onStartupIdle -> ensurePrivateBrowsingShortcutExists (hasPinnableShortcut) and CustomIconManager
  enumerateInstallShortcuts, Mozilla code at startup idle. Its paths (the parent's first opens from the first to the last open of a path of the places it walks, by the
  order of the system's log) are absent or, on both sides, the same set.
- Windows: four socket processes in one launch were the parent's and one of each of the three pingsenders (a background task is a Firefox of its own): what a
  pingsender spawns is named `<kind><-pingsender` and comes and goes with the pingsenders; it is compared when they are on both sides.
- A creator pid that Windows reused before the launch is not in the tree (a pingsender of an earlier launch counted in the lifecycle).
- The idle launch opens a page: with no window the notification of the data policy was not recorded in 120 s on either system and the launch had a crash reporter.
2026-11-22 07:06:49 +01:00
feder-cr 37267260a3 ci: the unit rows' minimum follows the network oracle's launch-stage tests 2026-11-22 07:00:06 +01:00
feder-cr f5d2ec81f9 Merge remote-tracking branch 'origin/char69/network' into tests/characterization-69 2026-11-22 06:41:14 +01:00
feder-cr 6d1bd1047b ci: the whole-e2e suite holds the characterization tests, the adapted Windows tests leave the exclusions, a third Linux row
The 35 new e2e files of the characterization branch are in one row of each system (balanced on the junits of runs 44942540063 and 44985244053, about 9.4 minutes of estimated wall time per Linux row, 10.2 per Windows row, 4 browsers). The four tests adapted to Windows (the headed popup, two fission process-name tests, the service-worker process test) are no longer excluded and are named by their files in the Windows rows. Linux gets wrapper.e2e.suite.linux.3.
2026-11-22 06:40:46 +01:00
feder-cr ac75085d10 tests: the ipv6 literal gateway records every CONNECT with time since launch, address type, destination as received and port 2026-11-22 06:31:57 +01:00
feder-cr 8ab1d3d68a Merge remote-tracking branch 'origin/ci/e2e-suite-on-candidate' into tests/characterization-69 2026-11-22 06:31:29 +01:00
feder-cr b58edbf367 Merge remote-tracking branch 'origin/char69/fakeweb' into tests/characterization-69 2026-11-22 06:31:29 +01:00
feder-cr aad5ac38da Merge remote-tracking branch 'origin/char69/skips' into tests/characterization-69 2026-11-22 06:31:29 +01:00
feder-cr ac62151198 Merge remote-tracking branch 'origin/char69/secstate' into tests/characterization-69 2026-11-22 06:31:28 +01:00
feder-cr 94fd5740c8 Merge remote-tracking branch 'origin/char69/screen' into tests/characterization-69 2026-11-22 06:31:28 +01:00
feder-cr 174c6b8b88 Merge remote-tracking branch 'origin/char69/platform' into tests/characterization-69 2026-11-22 06:31:28 +01:00
feder-cr 4bf9b5e009 tests: the ICE host candidates test leaves: in the product configuration a page reads only mDNS names, and what depends on the declaration is already asserted by test_declared_host_network_e2e.py 2026-11-22 06:31:28 +01:00
feder-cr 37aa78d339 ci: the network oracle records the CONNECTs and DNS questions of the launch stage with the process that opened each
The launch stage held only the UDP; it now holds the CONNECTs (the DoH road left out: its
start-up connection lands in this stage or in the journey's first step, so it is counted with the
journey's), the DNS questions and the datagrams, each with who opened it: `core` (the Python
process that runs the lab and makes the core's own requests at launch), `browser:<kind>` (parent,
socket, tab..., backgroundtask:pingsender) or `unknown`. The idle launches and the exit-ping launch
record the same.

The gateway looks at the client's source port while it serves the handshake and finds the owner
with psutil.net_connections (Linux and Windows both give the pid); a datagram carries the
opener of the UDP ASSOCIATE it came on (the association's control connection), and a DNS
question the opener of the connection that carried it. Only the stages that ask for it are looked
up (launch, idle, exit).
2026-11-22 06:26:26 +01:00
feder-cr 0af776766a tests: a generation of the security state that does not exit 0 saves the engine's stderr, the profile's files and, on Linux, the gdb backtrace of the core it left (e2e.yml installs gdb and points kernel.core_pattern at a folder) 2026-11-22 06:23:53 +01:00
feder-cr f5234742e6 tests: the ipv6 literal e2e gateway forwards nothing outside the lab; assert the CONNECT shape, not a count 2026-11-22 06:19:23 +01:00
feder-cr 07018c00b7 tests: the script cache test keeps every amount the two preloaders report under a path (the parent's scriptCache.bin and the child's scriptCache-child.bin share the reporter paths) and records the files of startupCache/ in each assertion message 2026-11-22 06:18:45 +01:00
feder-crandClaude Sonnet 5.5 b37287094e tests: the closed-context service-worker process test runs on Windows (process types from the engine log) instead of skipping
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-22 06:18:19 +01:00
feder-cr 2c50950f9a ci: the unit rows' minimum follows the oracles' new tests 2026-11-22 06:09:50 +01:00
feder-cr 9dab7a335b tests: the oracles' public addresses and runner paths in their cases are the allowed public resolvers and a neutral lab path 2026-11-22 06:09:14 +01:00
feder-cr b732bda9e3 tests: the host oracle's public addresses in its cases are public resolvers the gates already allow 2026-11-22 06:08:21 +01:00
feder-cr ec8e0fdc19 ci: the host oracle changes no pref, and compares what only the pingsender touches when it is on both sides
- Removed the lab telemetry endpoint of the idle launch (toolkit.telemetry.server) and its server: no pref is changed in any launch of any oracle. The idle
  launch stays, still ended by the notification recorded in the profile's prefs.js; its strict comparison is what does not depend on the third party: the
  notification seen, three pingsender processes of the three types, always the background task, spawned by the parent.
- A pingsender that goes to the telemetry host direct is the product's behaviour in a session with no proxy: the rule about a public destination is gone from
  the host oracle (behind a proxy it is the network oracle's). A destination of the pingsender kind is `public, telemetry`; the outcome of the connection is
  not in the verdict.
- The paths and destinations only the pingsender kind touches are compared when it is present on both sides of the same launch (the measured launches and the
  two warm-ups) and left out when it is on one side only, so a return to pingsender[.exe] or to a new read of the host shows.
2026-11-22 06:04:51 +01:00
feder-cr 881df0df5d ci: the host oracle's idle launch is where the exit pings must leave, a short launch has 0 or 3 of them
The exit pings leave as `firefox --backgroundtask pingsender` through the session's route when Mozilla's canUpload() is true (TelemetrySend.sys.mjs:1083), which is
the case once the notification of the data policy was recorded (TelemetryReportingPolicy.sys.mjs:988 `_userNotified`, from `ensureUserIsNotified` at
`sessionstore-windows-restored`, :1140-1175; the first-run tab, or the infobar at 60 s, :51). A short launch may or may not have got there.

- Short measured launches: the number of pingsenders is 0 or 3 (the first run's new-profile, first-shutdown and event, spawned by the parent, the background task
  and never the separate pingsender[.exe]); any other number or form is red, and the paths and destinations only they touch are not compared.
- The idle launch of each engine run (no journey, the telemetry endpoint is a loopback server of the lab so no ping goes to the internet) waits until the
  profile's prefs.js records the notification (a file of the launch, no channel into the engine; at most 120 s), then closes. The comparison there is strict: the
  notification seen, three pingsenders of the three types, spawned by the parent, none to a public address (B266). A launch behind a session proxy also fails on any
  pingsender destination that is public.
2026-11-22 06:04:49 +01:00
feder-cr c395116f9e ci: the e2e hang guard of the network oracle counts the exit-ping launch and still fits the job's 40 minutes 2026-11-22 06:04:23 +01:00
feder-cr e0a103dada ci: the network oracle's idle launch behind the proxy waits for the data reporting notice and counts the exit pings
The first seed gets one more idle launch per engine (idle/exit_pings), behind the lab's
coherent proxy and with no pref changed: it reads the profile's prefs.js every 0.5 s until
datareporting.policy.dataSubmissionPolicyNotifiedTime is there (120 s only end a launch that
never gets there: recorded is false and the A/A must agree), closes, and records until the
tree has exited, the pingsender of the shutdown included.

What went to the proxy towards a name outside the lab is compared strictly (the form of the
target, the number of each, the order): the proxy answers those CONNECTs itself with a SOCKS
reply 4 (host unreachable, as it does for any name outside the lab) and writes them down,
nothing leaves the lab. A connection of the browser or of its pingsender that did not go to
the proxy is in direct, which is red on either side. The e2e's hang guard counts the launch.
2026-11-22 06:03:22 +01:00
feder-cr 53a9e4da1e ci: the unit rows' minimum is the number of tests their files hold today (the oracles' tests were added without raising it) 2026-11-22 05:53:43 +01:00
feder-cr 8c394f4e72 ci: the host oracle runs alone on its own jobs and keeps the evidence that proves when the shutdown spawns what
Run 44982522362: the Windows A/A of the host oracle differed on the pingsender (3 vs 0 in one measured launch) and the Linux one on a /proc/self/fd/N open
of the parent. Neither is excused. What the run shows and what the oracle now records:

- the report counted 150 to 1000 paths per seed opened by firefox.exe processes OUTSIDE the tree on Windows: the other tests' browsers ran at the same
  time on the shared e2e machine, and the engine's own timers (the telemetry notification that decides whether the shutdown spawns the pingsender; the
  idle flush of the shared data that the parent copies read-only through /proc/self/fd/N) race with a loaded machine. The host oracle has jobs of its own,
  e2e (host, linux) with strace and e2e (host, windows), one test each, and the shared jobs leave its file out like the network oracle's;
- Linux keeps the order of starts and ends of the tree (strace with the exit lines, signals off), the call that touched each path (open, openat, stat, ...),
  and every open of /proc/self/fd/<n> with the memfd_create that made the descriptor; Windows adds the Kernel-Process stops to the ETW session (the exit
  code: 0 by itself, 1 for the core's TerminateProcess) and the times of the 4688 events (a refusal of the provider is said, not red);
- every footprint keeps how the close ended: the return code of the root and the seconds the core's close took (evidence, never a threshold).
2026-11-22 05:52:35 +01:00
feder-cr f7450cfd5b ci: the host oracle's journey ends with a geolocation step, the candidate must start no Windows location utility process, and stock Firefox is the negative control 2026-11-22 05:52:34 +01:00
feder-cr d4f4f86d88 ci: the host oracle compares the netlink sockets and the public destinations of each kind on Linux
The whole-run trace of the host oracle now also records, per process kind, every netlink socket the tree
opens (by protocol: NETLINK_ROUTE, NETLINK_KOBJECT_UEVENT, ...), the requests it sends on it (RTM_GETLINK,
RTM_GETADDR, ..., read from strace's decoding or from the message bytes) and the multicast groups it binds
to, and every connect or send towards a public address, with transport, family, address and port. A socket
is known by the inode -y prints for it, so a send names the protocol of the socket() that made it, whichever
thread sends. The set per kind enters the comparison like the host paths: identical, no exception. Loopback,
the lab's documentation ranges (192.0.2.0/24, 198.51.100.0/24, 203.0.113.0/24), private, link-local and
multicast destinations are not compared and are counted by class as evidence. The warm-up report lists the
network entries only the warm-up had.

The strace stand-in traces socket, connect, bind, sendto, sendmsg and sendmmsg only when the host oracle asks
(network=True); the font tests' default is unchanged.

Windows is not covered and the report says why: the connect and send events are in the
Microsoft-Windows-Kernel-Network provider, which needs a second provider in the session, logs every packet of
the machine and has no field names verified on a hosted runner yet; interface enumeration there is NSI by
IOCTL, not a socket.
2026-11-22 05:52:34 +01:00
feder-cr 4d97eae291 tests: the closed-context process test judges by the processes that host the frames' sites, not by a count
The count of content processes holds the preallocated pool and what the browser starts for itself, so it moved with whatever ran beside the test (gate run on Windows: [9, 9] while open, [9] after). The test now waits until the processes that host the sites of the frames (B and C) exist while the context is open, and until none is left once it is closed: by the name of the process on Linux, by the remote type the engine logs on Windows.
2026-11-22 05:49:03 +01:00
feder-cr a4e6c8f56d tests: a popup naming only left reads that x and the declared default y 2026-11-22 05:48:26 +01:00
feder-cr 9bd7622e83 ci: the walk waits for what a closed tab sends as it leaves; a resumption must happen in every run; the ECH grease aead is one volatile entry again
- tests/fakeweb/profile_p4.py: the tab of step 10 is closed by the walk's cleanup and its
  two pagehide requests reach the site after close() returns. The walk now goes on when
  the site has both (an event; a failsafe keeps a request that never comes from blocking
  it), so they belong to the step that closed the tab. A/A run 44982522362, Windows seed 6:
  in 19 launches of 20 both landed in step 11, in one n=2 landed in step 10; both were sent
  in every launch. The per-journey summary of those requests is gone.
- Optional entries (resumed connections) get an invariant: an origin that resumes on some
  seed in one run must resume on some seed in the other; an engine that stops (or starts to)
  is red. Which launch resumes stays timing.
- The ECH GREASE aead: the existing volatile entries cover fresh and resumed connections
  (security/nss/lib/ssl/tls13ech.c:2257: the aead is chosen by the low bit of HKDF output of
  a fresh key, for every ClientHello without real ECH); two fingerprints that differ only by
  the aead are one.
2026-11-22 05:41:15 +01:00
feder-cr 435d261ce4 test(fakeweb): evidence helper with LF endings 2026-11-22 05:38:54 +01:00
feder-cr 36634bc63f ci: the network oracle's A/A of run 44982522362: no shared port numbers, optional resumptions, leaving traffic over the journey, the ECH grease as a draw
- Lab: two servers of a lab never share a port number (open_lab makes the lab again when
  they do). A port is normalised into the role of its server, and on Linux seed 4 the port
  of the origin O and that of the HTTP/3 server were the same number in one run: 667 leaves
  read journey-o.test:h3. The lab also gives the walk's step counter back when it closes.
- Resumed connections: an origin may have one in a run and none in the other (ticket and
  pool timing; 108 leaves per seed on Linux h1). The volatile list can name an `optional`
  owner: what is under it is excused when one run has nothing there and compared when both
  have something. The fresh connections and the protocols are always compared.
- The ECH GREASE AEAD is written as what it is, a draw from 1 and 3 (any other value is a
  difference), on fresh and resumed connections alike; the two per-leaf entries are gone.
- What the page sends from its pagehide handler (the beacon and the keep-alive POST) is
  summarised over the journey with its counts, as the CONNECTs are: the pair reaches the
  lab while the driver moves to the next step and straddled the boundary in one run
  (Windows, steps 10 and 11).
2026-11-22 05:35:04 +01:00
feder-cr 8a42ed3676 test(fakeweb): the networkidle-under-load case saves its evidence when it fails
On failure only, into RUNNER_TEMP/invpw-evidence/fakeweb-leaving-beacons-under-load/: the fake web's own record of every
connection and request (arrival, answer, error), the client's log of every request, the Juggler wire of the served browser,
the engine's Juggler trace (INVISIBLE_JUGGLER_TRACE_DIR) and the cells. No assertion, wait or deadline changes.
2026-11-22 05:32:57 +01:00
feder-cr 2c6a93900f tests: the headed popup test and the two process-by-site bench tests run on Windows instead of skipping
The headed window.open test asked for DISPLAY, which Windows never has: it now asks for it only off Windows.
The bench tests found a site's process by its name, which only Linux sets: on Windows they read the remote type the
engine logs for every process it creates (MOZ_LOG Process) and count the live content processes of that site.
2026-11-22 05:29:42 +01:00
feder-cr 756f722d40 Merge remote-tracking branch 'origin/char69/platform' into tests/characterization-69 2026-11-22 05:22:56 +01:00
feder-cr 215f552a10 ci: the whole e2e suite as seven rows of the gate (linux 1-2, windows 1-4, control_a), run on the candidate's binary by scripts/ci_suite_run.py
The rows are balanced on the test times of run 44942540063 and exact; the Windows parts of e2e.yml read them instead of taking every fourth file.
tests/test_the_e2e_suite_is_accounted_for.py holds every e2e test in one row of each system or in a named exclusion.
2026-11-22 05:14:46 +01:00
feder-cr 98da306330 tests: the warm session's script cache is compared with the file left on disk when the fresh session ended (a rewrite at shutdown replaces the adopted one) 2026-11-22 05:02:50 +01:00
feder-cr b14f479e09 Merge remote-tracking branch 'origin/char69/icehost' into tests/characterization-69 2026-11-22 04:59:24 +01:00
feder-cr af48556777 Merge remote-tracking branch 'origin/char69/platform' into tests/characterization-69 2026-11-22 04:59:23 +01:00
feder-cr 5776836ab6 tests: the DOM iterables that firefox-68 iterates from evaluate stay; the WebGPU features case keeps its red proof on its branch 2026-11-22 04:59:23 +01:00
feder-cr da0720364a tests: a page with a media permission reads the declared network in its ICE host candidates (characterization of firefox-68) 2026-11-22 04:47:24 +01:00
feder-cr c3295c5b12 tests: the launch counter test reads browser/omni.ja with the core's jar reader (Mozilla's optimized jar is refused by zipfile on Windows) 2026-11-22 04:43:43 +01:00
feder-cr a7b1acf732 tests: iterating DOM iterables from page.evaluate, one case each 2026-11-22 04:42:13 +01:00
feder-cr 9072dbb74f ci: the host oracle warms each engine up, compares the tree only, and the network oracle has jobs of its own
Host oracle
- Each engine run starts with a discarded warm-up launch (the first seed), an experiment control and not an excuse: its trace is kept in the
  footprint and the report lists what only the warm-up did (WARMUP-ONLY, per kind and per path, with the process that did it), and which of those
  both engines have. The measured launches are compared as they are: a pingsender or a socket process that differs after the warm-up is red.
- Only the tree of the launch is compared. On Windows the ancestry is the creator's pid chain of the 4688 events and every open of the machine is read,
  so what a process outside the tree opened (a service, the antivirus) is counted by process name (OUTSIDE THE TREE) and left out; on Linux the strace
  tree is the tree.
- A path or a kind that differs names the processes to blame: touched_by (the kinds that opened each host path, on both systems, a thread's open
  counted for its process) and spawned_by (the kinds that spawned each kind), in the DIFF lines and the problems.

e2e.yml
- tests/test_ab_network_e2e.py has its own jobs, e2e (network, linux) and e2e (network, windows), with the setup of the shared jobs, one test that must
  pass (no skip), 40 minutes (the test's own budget for 5 seeds is 30); the shared Linux job ignores the file (OWN_JOB_FILES) and the Windows parts
  leave it out of the collection (own_job). The workflow tests take a job by its name now, and the network jobs are held to the same rules as the others.
2026-11-22 04:39:18 +01:00
feder-cr 88b058956a ci: the host oracle's Windows classification is spelling-independent and names what it can name
From the A/A of run 44963364060 (Windows part 4, 129 differences):
- the runner's TEMP is the 8.3 spelling (the short spelling of the user folder) and the engine opens the same folder under both spellings, so 70 paths of the
  launch's own profile were classed host: the context puts every root and every path in the long spelling (GetShortPathNameW / GetLongPathNameW
  of the user's folders, the temp root and the package), whatever the NT prefix;
- uninstall_ping_<install hash>_<uuid>.json(.tmp) in C:\ProgramData\Mozilla-<install id> (30): the uuid of the ping is normalized, the folder and
  the name are still compared;
- a firefox.exe --backgroundtask pingsender (three in the first launch of the run, the cause of its extra parent kinds, imagehlp.dll and a .mui) is
  the kind backgroundtask/pingsender by its command line, not a parent;
- the start canaries are three, with a round trip to the session before each, and the last one must be in the trace (the first canary of the first
  launch was not);
- the footprint keeps, as evidence, which kinds of process opened each host path.
2026-11-22 04:12:39 +01:00
feder-cr 8d6d6ae208 Merge remote-tracking branch 'origin/char69/platform' into tests/characterization-69 2026-11-22 04:04:03 +01:00
feder-cr 194ae6f042 Merge remote-tracking branch 'origin/char69/automation' into tests/characterization-69 2026-11-22 04:04:03 +01:00
feder-cr dee362ea02 Merge remote-tracking branch 'origin/char69/mediajs' into tests/characterization-69 2026-11-22 04:04:03 +01:00
feder-cr f8e5ff8700 Merge remote-tracking branch 'origin/char69/locale' into tests/characterization-69 2026-11-22 04:04:03 +01:00
feder-cr e8b3efa8c9 Merge remote-tracking branch 'origin/char69/screen' into tests/characterization-69 2026-11-22 04:04:02 +01:00
feder-cr b02f74ed58 Merge remote-tracking branch 'origin/char69/window' into tests/characterization-69 2026-11-22 04:04:02 +01:00
feder-cr b48592587f tests: the popup frame control is a second declared frame (the engine off reads the host's own frame on Windows) 2026-11-22 03:51:47 +01:00
feder-cr 66e5b75cb6 tests: the launch counter's address is read from the engine's module in the binary, the shutdown ping goes to an allowed host (a refused host is a control), the warm session's script cache is moved aside until rewritten 2026-11-22 03:51:20 +01:00
feder-cr 8e4be5b67d tests: a goto to a refused port waits for the error page's navigation before the next goto starts 2026-11-22 03:51:20 +01:00
feder-cr 69a9c60328 tests: escape the line breaks of the native-endings probe; the branding test reads only chrome://, the one place a page can load 2026-11-22 03:50:27 +01:00
feder-cr 2c562c035f ci: the network oracle compares the resumed ClientHellos and the protocols per origin, and its e2e has a hang guard sized from its seeds
- fold_wire: the connections whose ClientHello resumes a session are a set of their own
  (the number of tickets offered left out), and `protocols` is the set of protocols that
  carried a request (h1, h2, h3), not how many requests each carried.
- tests/test_ab_network_e2e.py: the default 420 s of the e2e killed the xdist worker of the
  A/A on 5 seeds on Linux and Windows (run 44963364060). The test's guard is 120 s to start
  plus, per engine run, 240 s for the first seed and 150 s for each next one (measured: 120 s
  and 145 s per engine run for the first seed on Linux and Windows); the subprocess ends at
  that budget and the worker's guard comes 120 s after it.
2026-11-22 03:49:45 +01:00
feder-cr 2b9858570a tests: the second window session runs in a thread of its own (no sync client inside another one's loop) 2026-11-22 03:48:00 +01:00
feder-cr bd71ac2026 tests: leave out of the locale characterisation what the product cannot do or the 68 engine does not do (running-worker language change, worker canvas group, shared and service worker Accept-Language) 2026-11-22 03:47:58 +01:00
feder-cr 731ec861c5 ci: the network oracle compares what the engine says on each connection, not what the pool did
A/A run 44960767715 left 214 leaves on Linux and 297 on Windows, all of them the pool:
a second connection with no request (in the first visit's stage in one run, the
second's in the other), the page's requests split between HTTP/2 over TCP and
HTTP/3 over QUIC (4 and 1, then 1 and 4) with their stream numbers, priorities and
frame counts, the HTTP/3 datagram count, and the start-up connection to the DoH
landing in the launch stage or not.

Each role (h1, h2, h3) now has one summary over its whole walk (fold_wire): the
distinct fingerprints of the connections that carried a request and are not resumed
(ClientHello, ALPN, SETTINGS, first WINDOW_UPDATE/PRIORITY, QUIC parameters, pseudo-header
order), and every request, with its count, wherever it rode. In the h3 role the
transport's own headers (te, alt-used) belong to the connection and the page's
priority is kept for the page. Not kept: the number of connections, a connection that
carried no request, stream numbers, frames after the first request, the h3 datagram
count. The CONNECTs of the launch stage count with the journey's. The direct-connection
rule is untouched. The volatile entries follow the new paths.
2026-11-22 00:54:03 +01:00
feder-cr aabf0516cc tests: the host oracle's trace cases use a neutral lab home 2026-11-22 00:40:18 +01:00
feder-cr 50c08fb950 ci: the A/A of the page, network and host oracles runs every seed when the pull request touches the oracle
On a pull request the three A/A controls ran on a few seeds (page 2, network 1, host all). The A/A is what every A/B verdict
rests on, so when the pull request changes the code or the data of an oracle it must be zero on every seed of the candidate
set [0, 2, 4, 6, 63], Linux and Windows.

scripts/ci_ab_pr_seeds.py holds the files of each oracle (what they share: ci_ab_oracle.py, persona_cover.py,
ci/persona-seeds.json), fetches the base commit and lists `git diff --name-only <base> HEAD` (HEAD is the merge commit the
runner checks out), and prints AB_ORACLE_PR_SEEDS, AB_NETWORK_PR_SEEDS and AB_HOST_PR_SEEDS (every seed, or the default 2, 1
and 2). One step of e2e.yml, on a pull request, in the Linux job and the Windows parts, appends them to $GITHUB_ENV; no
third-party action. The three e2e tests read their variable with pr_seed_count and, without it (a push, a manual run), keep
their default. Unit tests: the path rule per oracle, the shared files, the variable (a carriage return, a bad value), the
fetch-then-diff order, LF-only output, and the step in the workflow.
2026-11-22 00:33:28 +01:00
feder-cr 11dc585abf ci: the host oracle compares the whole trace of a closed run, not a photograph of one instant
The A/A of the host oracle kept finding noise because it read the tree once, after a wait for quiet: the number of live
content processes, one font mapped lazily, the number of short-lived children. The oracle now compares the TRACE of the
run, from the launch to the exit of the browser (the quiet point is the exit of the process):

- processes by kind (parent, -contentproc type + sandboxingKind + isForBrowser/notForBrowser, helpers by what they ran)
  from the command lines of the launch; every kind and its count identical, except the count of the kinds of type tab
  (idle time): for those only the presence counts, with the reason written once;
- the SET of host paths the tree touched, identical with no exception. Every path is classified ours (the package, the
  profile and temp dirs of the launch, the run's cache, its own shared memory) or host; ours leaves the comparison as a
  class, the reason written once.

Linux: strace -f -y of the whole tree, now with the file calls (open, openat, stat, access, readlink, execve, ...), read
after the group has exited. Windows: the process starts with their command lines come from the process-creation audit
(event 4688, switched on for the run and put back), a file trace from an ETW session on Kernel-File (logman, tracerpt),
two canary files and the lost-events line check that the session was recording. It needs an administrator.

Gone: the volatile list (tab count, tahoma7_04.ttf, the job total, the WMI count) and its mechanism, the module snapshot,
the quiet wait, the WMI trace and the poller. The declared glxtest difference stays, applied by kind.
2026-11-22 00:33:19 +01:00
feder-cr cba46aa042 Merge remote-tracking branch 'origin/char69/platform' into tests/characterization-69 2026-11-22 00:18:02 +01:00
feder-cr 55ce95a1ad Merge remote-tracking branch 'origin/char69/window' into tests/characterization-69 2026-11-22 00:18:01 +01:00
feder-cr a837e63a08 Merge remote-tracking branch 'origin/char69/webglread' into tests/characterization-69 2026-11-22 00:18:01 +01:00
feder-cr 70f81bbb3a Merge remote-tracking branch 'origin/char69/automation' into tests/characterization-69 2026-11-22 00:18:01 +01:00
feder-cr 3a67051a92 Merge remote-tracking branch 'origin/char69/locale' into tests/characterization-69 2026-11-22 00:18:01 +01:00
feder-cr 112607291a Merge remote-tracking branch 'origin/char69/screen' into tests/characterization-69 2026-11-22 00:18:01 +01:00
feder-cr 38fb8b6877 Merge remote-tracking branch 'origin/char69/mediajs' into tests/characterization-69 2026-11-22 00:18:00 +01:00
feder-cr 2703b5fc97 Merge remote-tracking branch 'origin/char69/audiohw' into tests/characterization-69 2026-11-22 00:18:00 +01:00
feder-cr 1791f7ea68 ci: the A/A of the network and host oracles is clean, from the evidence of run 44946411675
Network oracle (5,580 leaves differed between the published engine and itself):
- the ad frame's origin travels as a URL parameter (a=http%3A..%3A<port>) and the slow
  frame holds id=sf<token><i>: the normaliser now turns the encoded port into the role of
  its server and drops the token (the index stays), so a request has the same key in
  every run (5,532 leaves);
- the lab cuts the journey into steps when the driver moves on, and what the browser does
  on its own (a connection, a second lookup of a name once its 30 s are over) landed in
  whichever step was current: the CONNECTs and the DNS questions are one summary of the
  whole journey, the requests and datagrams stay in their step;
- the HTTP/3 datagrams are summed over the walk (a visit leaves packets in flight for the
  next one: 12+8 and 13+7);
- the "ERROR in the transcript" scan no longer names the text a page answered
  (steps/14/extra/error is the sign-in page's own message);
- ci/ab-network-volatile.json: the counts of connections (the pool's) and the ECH GREASE
  AEAD (random per connection), each with the run that proved it.

Host oracle: a volatile list of its own (ci/ab-host-volatile.json), applied in the A/A and
in the A/B, per system, stale when it matches no leaf, and a leaf that vanishes is not noise
unless the entry says so: the live tab-process count and one lazily mapped font on Linux,
the job's total process count on Windows.

The three oracles' launches use a cache folder of their own (XDG_CACHE_HOME on Linux, the
wrapper's cache pinned), so they leave no fontconfig cache of the bundle in the user's
folders for the fontconfig test's cold launch.
2026-11-22 00:01:05 +01:00
feder-cr 323d272a32 tests: negative controls with the engine off or another declared screen, second sync client in a thread of its own 2026-11-21 23:56:27 +01:00
feder-cr b7f974788a tests: negative controls with the engine off or another declared screen, second sync client in a thread of its own 2026-11-21 23:51:23 +01:00
feder-cr 3f372e4675 tests: the WebGPU adapter is read in the page realm, where the features iterate 2026-11-21 23:47:53 +01:00
feder-cr a9ec63caed tests: the fullscreen test pins the device pixel ratio with the screen 2026-11-21 23:47:27 +01:00
feder-cr 50f2e53c9c tests: the click on a download left to Firefox does not wait for a navigation, the file does 2026-11-21 23:46:42 +01:00
feder-cr 0a0a2f4efd tests: negative controls with the engine off or another declared screen, second sync client in a thread of its own 2026-11-21 23:46:02 +01:00
feder-cr 8add8e4a42 tests: the locale of a live context is changed through the product's Juggler command; the canvas test records every measure 2026-11-21 23:44:28 +01:00
feder-cr 5e18bdc03f gitattributes: the persona seeds file is LF on every checkout, as its test compares it byte for byte 2026-11-21 23:40:40 +01:00
feder-cr 89c7d3be3b Merge remote-tracking branch 'origin/char69/platform' into tests/characterization-69 2026-11-21 21:28:04 +01:00
feder-cr 241d156f1f Merge remote-tracking branch 'origin/char69/automation' into tests/characterization-69 2026-11-21 21:28:04 +01:00
feder-cr d6dc3bf0ba Merge remote-tracking branch 'origin/char69/mediajs' into tests/characterization-69 2026-11-21 21:28:04 +01:00
feder-cr 74deb6a060 Merge remote-tracking branch 'origin/char69/locale' into tests/characterization-69 2026-11-21 21:28:04 +01:00
feder-cr fa735a74e7 Merge remote-tracking branch 'origin/char69/window' into tests/characterization-69 2026-11-21 21:28:03 +01:00
feder-cr d6498e527b Merge remote-tracking branch 'origin/char69/screen' into tests/characterization-69 2026-11-21 21:28:03 +01:00
feder-cr 92712b1658 Merge remote-tracking branch 'origin/char69/audiohw' into tests/characterization-69 2026-11-21 21:28:03 +01:00
feder-cr ab3247d359 Merge remote-tracking branch 'origin/char69/fonts' into tests/characterization-69 2026-11-21 21:28:03 +01:00
feder-cr 4bf642a58a Merge remote-tracking branch 'origin/char69/canvasreaders' into tests/characterization-69 2026-11-21 21:28:03 +01:00
feder-cr 360a22887f Merge remote-tracking branch 'origin/char69/webglread' into tests/characterization-69 2026-11-21 21:28:02 +01:00
feder-cr 2d31ecdfff Merge remote-tracking branch 'origin/char69/webglparams' into tests/characterization-69 2026-11-21 21:28:02 +01:00
feder-cr 03ec71cf72 tests: the host oracle's normalizer cases use neutral lab paths 2026-11-21 21:21:49 +01:00
feder-cr 6b67a514e5 tests: characterise the script cache, the launch counter, the shutdown ping, the geolocation of the host and the WebGPU adapter on firefox-68 2026-11-21 21:21:31 +01:00
feder-cr f42d5ecd26 tests: characterize automation hooks on firefox-68 (download cancel and no-options control, refused port goto, element atoms, hybrid xray control and cross-origin handover) 2026-11-21 21:19:32 +01:00
feder-cr e89a789354 tests: the network oracle's e2e has no switch that weakens its verdict 2026-11-21 21:13:55 +01:00
feder-cr 38aaebd4f2 ci: the page A/B oracle has a control: the published engine against itself, alone on a pull request
ci_ab_oracle.py run dumps the published engine twice and compares the two (the A/A). A
difference, or a dump that did not run, is a broken control (exit 2) and the A/B is not
run. Without a candidate (a pull request: the engine under test is the published one,
given with --published-binary, under the seal of the core) the A/A is the whole run, on
the first two seeds of the candidate set (--limit 2); with a candidate it runs on every
seed first and the A/B follows against the first dump. compare --a-a repeats it from the
files.

tests/test_ab_oracle_e2e.py no longer requires INVISIBLE_SEAL_FILE: both modes save their
dumps and diffs in $AB_ORACLE_OUT or $RUNNER_TEMP/invpw-evidence/ab-oracle. 11 unit
tests for the A/A, its broken-control exit and the command line.
2026-11-21 21:13:04 +01:00
feder-cr 813b889c78 ci: the network and host A/B oracles are required suites, their unit files in the unit rows 2026-11-21 21:09:08 +01:00
feder-cr 3877438598 ci: the host-footprint A/B oracle, the process tree and the mapped modules per kind after the same journey
scripts/ci_ab_host.py walks the first steps of the fake web's journey with the stock client,
waits for the tree to be quiet and, before closing, takes the multiset of process kinds, the
modules each kind has mapped (normalized: install dir, system dirs, temporary paths, memfd and
shm names without numbers) and the children born and gone before the snapshot (Linux: strace;
Windows: the job's TotalProcesses and a WMI process-start trace). `ab` runs the A/A control
(the published engine twice: a difference is a broken control, exit 2) and, with a candidate,
the published engine against it, with the declared differences of ci/ab-host-expected.json
(glxtest on Linux; a declared difference that does not show is red as stale).

tests/test_ab_host.py is the comparator on synthetic footprints; tests/test_ab_host_e2e.py runs
it on Linux and Windows: the A/A on a PR's e2e, the A/A and the A/B with a candidate.
2026-11-21 21:08:43 +01:00
feder-cr 9cd828654f ci: the network A/B oracle, the same journey on the lab with the published engine and with a candidate, every leaf of what the wire carried compared
tests/_wire_capture.py reads what a client puts on the wire, with the standard library, hyperframe/h2 and aioquic: the TLS ClientHello (MSG_PEEK until the whole record is
buffered, then the same socket goes to ssl; GREASE is one word, the random, the session id, key share bytes and PSK identities are dropped), the HTTP/2 frames (SETTINGS in order,
WINDOW_UPDATE, PRIORITY, PRIORITY_UPDATE, the pseudo-header order of each request), HTTP/1.1 request heads as written, and an HTTP/3 client (QUIC transport parameters in order,
the SETTINGS frame, the header order). WireServer serves one HTTPS site on TCP (h1 or h2 by ALPN) and QUIC on one port.

scripts/ci_ab_network.py runs the P4 journey, an HTTPS page on each protocol, an HTTP/3 page, a WebRTC page (STUN and TURN through the relay) and two idle launches through a
coherent SOCKS5 gateway with the fake DoH, the witness and the watcher, writes a normalised transcript per engine, and compares two transcripts leaf by leaf (path and both
values). A direct connection on either side is red by itself; the leaves that differ between two runs of one engine live in ci/ab-network-volatile.json (empty until the A/A
measures them; an entry that matches no leaf is stale and red). --a-a runs the published engine twice: a difference there is a broken control (exit 2), and with a candidate
the A/A runs first.

tests/test_ab_network.py, tests/test_wire_capture.py and tests/test_wire_capture_quic.py hold the comparator, the normalisation, the lab and the parsers to known inputs, no
browser. tests/test_ab_network_e2e.py runs the A/A on a pull request (evidence under RUNNER_TEMP/invpw-evidence/ab-network) and the A/A then the A/B with a candidate.
2026-11-21 21:08:43 +01:00
feder-cr 050dbb159f ci: the A/B oracle visits the persona seeds, each at its own DPR
scripts/persona_cover.py computes, from the prefs the core emits for the seeds 0..99999
(every pref that varies across seeds belongs to a dimension or is excluded with its reason),
two sets of seeds: `candidate`, the smallest set that reaches every webgl renderer and every
DPR (5 seeds), and `final`, a greedy cover with reverse delete of every reachable value of
every dimension (20 seeds). ci/persona-seeds.json holds them with the sha256 of the
dimensions and features; `check` recomputes and says what changed.

ci_ab_oracle.py takes its visits from that file: the candidate set by default, each seed at
its own DPR (nothing pinned; ci_host_gate.py dump gets --visit and --no-pin), or
--seed-set final with --shard i/n to split the 20 seeds over several jobs. The e2e test
passes AB_ORACLE_SEED_SET and AB_ORACLE_SHARD through. tests/test_persona_cover.py holds the
stored file to a recompute, the covers to the dimensions, and a cover with a seed less red.
2026-11-21 21:00:55 +01:00
feder-cr 1f06722137 Characterize the readers of a WebGL/WebGPU canvas and the as-drawn painter on firefox-68
Five e2e tests written before the hooks of fingerprint/canvas/noise-projection and
fingerprint/canvas/as-drawn are redone: every reader of a WebGL element, an
OffscreenCanvas and a transferred placeholder gives the same noised bytes; a WebGPU
canvas reads noised through toDataURL and toBlob; -moz-element paints a WebGL canvas
as drawn. Each carries its control in the same test (canvas noise declared off).
2026-11-21 20:56:43 +01:00
feder-cr 9f91d752e4 tests: characterise the language and zone of workers, worklets, canvases, the page realm and every request kind (firefox-68) 2026-11-21 20:56:29 +01:00
feder-cr c820dd50f9 tests: characterize the bundle-only font list, src:local names, regional-indicator measureText, vertical text metrics and createPattern projection on firefox-68 2026-11-21 20:54:54 +01:00
feder-cr 20af8c4509 tests: characterize window occlusion, fullscreen without a window manager, and focus on OS deactivation (e2e, firefox-68) 2026-11-21 20:52:11 +01:00
feder-cr c6d3ded241 tests: characterisation e2e for screen, popup geometry, iframe click origin and css-media hooks 2026-11-21 20:52:05 +01:00
feder-cr 11db0d50b5 tests: characterize the declared WebGL parameters and the shader language on firefox-68 2026-11-21 20:52:05 +01:00
feder-cr 79b46cc0a2 Characterization e2e of the media enumeration, voice URIs, eval name, native line endings and branding on firefox-68 2026-11-21 20:50:35 +01:00
feder-cr 8c926d9551 tests: characterize audio noise, audio context values, sample rate and hardware declarations on firefox-68 2026-11-21 20:48:55 +01:00
feder-cr c65828d809 tests: characterize the IPv6 literal gate of firefox-68 (direct refused, mapped refused, SOCKS destination left to the proxy) 2026-11-21 20:37:26 +01:00
feder-cr 37cae03940 ci: the A/B oracle, same seed and same bytes, the published firefox-68 engine against the candidate
scripts/ci_ab_oracle.py runs the host gate's dump twice on one machine with the same
core and wrapper: with the engine published as firefox-68 (its seal.json and archive
fetched through the core's own download under that seal) and with the candidate binary
under its own seal. Every leaf of every visit must be equal; only the noise entries of
exceptions.json and the diag. keys are excused. A difference is red with its leaf, both
values and the seed; a visit that compares fewer leaves than the host gate's reference
holds (16439) is red. It writes dump-68.json, dump-candidate.json and diff.json.

tests/test_ab_oracle.py holds the comparator to known inputs (27 cases, no browser), in
the rows of the whole unit suite. tests/test_ab_oracle_e2e.py is the gate's leg, the new
row wrapper.e2e.ab_oracle on Linux and Windows.
2026-11-21 19:40:51 +01:00
344 changed files with 67338 additions and 11148 deletions

No files matched your search

+15
View File
@@ -13,3 +13,18 @@
# Linux one. The gate folds CRLF vs LF deliberately, but there is no reason to
# make it do that work.
PUBLISHED.json text eol=lf
# The persona seeds are compared byte for byte with their canonical rendering (tests/test_persona_cover.py): LF on every checkout.
ci/persona-seeds.json text eol=lf
# The wire-method budget is compared with what `dump()` writes, byte for byte
# (tests/test_every_wire_method_is_served_or_refused.py): a Windows runner checks
# out with autocrlf and would hand the test CRLF that nobody wrote.
tests/gates/wire_method_debt.json text eol=lf
# The lock of the gate is hashed byte for byte: its header names the sha256 of gate.in, so neither file may be rewritten with CRLF on a Windows checkout.
ci/py-lock/** text eol=lf
# The vendored bundles are third-party bytes whose sha256 is pinned in tests/vendor/README.md: no checkout converts their line endings
# (a Windows runner with core.autocrlf=true would hand them over with CRLF and the hash would no longer match).
tests/vendor/*.js -text
+10
View File
@@ -38,3 +38,13 @@ Describe what you ran:
- [ ] `pytest` passes locally.
- [ ] I updated `README.md` / `docs/` if user-visible behavior changed.
- [ ] My change is in scope for this repo (Python wrapper / sampler / CLI / packaging - not the patched Firefox C++ source).
## Patch questions (filled by maintainers)
<!--
Every applicable project rule question, answered with proof.
"Not proven yet" blocks the merge; a question that does not apply says why in one line.
-->
| Question | Answer | Proof (file:line, run id, test and its red-on-old run) |
|---|---|---|
+3 -3
View File
@@ -35,18 +35,18 @@ jobs:
timeout-minutes: 10
steps:
- name: Check out the script (main)
uses: actions/checkout@v4
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 (v4.4.0)
with:
path: main
- name: Check out the badges branch
uses: actions/checkout@v4
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 (v4.4.0)
with:
ref: badges
path: badges
- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5 (v5.6.0)
with:
python-version: "3.12"
+77 -4
View File
@@ -22,6 +22,15 @@
# Windows runner separates the two without asking anyone to stay off it
# for six hours.
#
# A second use, chosen by the input `ab_network_webrtc_seed` (empty = the loop
# above, as always): the network oracle's WebRTC walk of that seed, alone,
# `runs` times for each engine of its A/A (the published engine twice). It
# exists to tell two readings apart when the A/A of that walk differs from
# itself in the number of TURN Allocate datagrams (scripts/ci_ab_network.py:
# AB_NETWORK_HUNT): each repetition keeps every datagram with its time and its
# STUN transaction id and the page's own ICE times (network/hunt/<engine>-<i>.json,
# summary in network/hunt/summary.json). It decides nothing: the step exits 0.
#
# Doesn't start on its own: `workflow_dispatch` only. It's not a gate, it's
# an investigation tool, and it must not be added to the required contexts.
# ─────────────────────────────────────────────────────────────────────────────
@@ -34,6 +43,10 @@ on:
description: "How many runs at most (at 12% it takes ~18 for a 90% chance)"
required: false
default: "18"
ab_network_webrtc_seed:
description: "A seed (e.g. 4) to repeat ONLY the network oracle's WebRTC walk of, `runs` times for each engine of its A/A, instead of the e2e loop. Empty: the e2e loop."
required: false
default: ""
os:
description: "Where to hunt. windows-latest answers a DIFFERENT question: are the interaction retries seen on the dev machine the product or contention?"
required: false
@@ -59,9 +72,27 @@ env:
GITHUB_TOKEN: ${{ github.token }}
jobs:
# The Ubuntu packages of the Linux hunt, from Ubuntu's archive once per runner image and list (linux-deps.yml), never by the hunt. On Windows this job is
# skipped and the hunt runs on (the condition below accepts `skipped` and `success`, nothing else).
linux-deps-hunt:
name: linux-deps-hunt
if: startsWith(inputs.os, 'ubuntu')
uses: ./.github/workflows/linux-deps.yml
with:
name: hunt
packages: xvfb
playwright_wrapper_ref: ${{ github.sha }}
hunt:
name: hunt (${{ inputs.os }})
needs: linux-deps-hunt
if: ${{ !cancelled() && (needs.linux-deps-hunt.result == 'success' || needs.linux-deps-hunt.result == 'skipped') }}
runs-on: ${{ inputs.os }}
# TEMP and TMP on D:\a\_temp (the runner's temp folder): the Firefox profiles land in TEMP and on C: they saturate the disk (queue up to 144,
# latencies up to 4 s, parent main thread still 40-60 s). On the job, not in a step: `runner.temp` is not readable in a job's `env`.
env:
TEMP: ${{ startsWith(inputs.os, 'windows') && 'D:\a\_temp' || '/tmp' }}
TMP: ${{ startsWith(inputs.os, 'windows') && 'D:\a\_temp' || '/tmp' }}
# 18 runs of ~6 minutes plus install time. Deliberately generous: the
# ceiling here must NEVER be the thing that stops the hunt, or we're back
# to a killed job that explains nothing, which is the original defect.
@@ -88,16 +119,49 @@ jobs:
# Linux only: on Windows the browser launches on the runner's desktop,
# and `firefox-launch-matrix.yml` has shown for months that it really
# starts there.
- name: System deps (xvfb + Firefox runtime libs)
- name: The Linux packages (the run's linux-deps-hunt job, no mirror)
if: runner.os == 'Linux'
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
with:
name: ${{ needs.linux-deps-hunt.outputs.artifact }}
path: /tmp/linux-deps
- name: System deps (xvfb + Firefox runtime libs; the repository of the linux-deps-hunt job)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y xvfb
sudo "$(which python)" -m playwright install-deps firefox
set -euo pipefail
# The run's linux-deps repository and nothing else: apt reads only its sources list and lists folder, the files are already in apt's archives,
# and the roots are installed by name with --no-download: a package the repository does not hold is named here and red, never fetched.
read -r OS VER < /tmp/linux-deps/image.txt
echo "the repository was read on $OS $VER; this runner is $ImageOS $ImageVersion"
sudo mkdir -p /tmp/linux-deps-apt/lists/partial /tmp/linux-deps-apt/parts
echo "deb [trusted=yes] file:/tmp/linux-deps ./" | sudo tee /tmp/linux-deps-apt/sources.list >/dev/null
APT="-o Dir::Etc::SourceList=/tmp/linux-deps-apt/sources.list -o Dir::Etc::SourceParts=/tmp/linux-deps-apt/parts -o Dir::State::Lists=/tmp/linux-deps-apt/lists -o Acquire::Languages=none"
sudo apt-get $APT update
sudo cp /tmp/linux-deps/*.deb /var/cache/apt/archives/
sudo apt-get $APT install -y --no-download --no-install-recommends $(cat /tmp/linux-deps/roots.txt)
- name: The security state (a fixed directory of the repository)
if: inputs.ab_network_webrtc_seed != ''
run: python scripts/ci_lab_security_state.py set --pin ci/security-state.pin.json
- name: Fetch the published firefox binary
run: echo "FF=$(python -m invisible_playwright fetch | tail -1)" >> "$GITHUB_ENV"
- name: The GeoIP database (made by the repository, same bytes every run)
if: inputs.ab_network_webrtc_seed != ''
run: python scripts/ci_lab_geoip.py build
# The hunt of the network oracle's WebRTC walk: instead of the loop below, never with it. `runs` is the number of repetitions per engine.
- name: The network oracle's WebRTC walk of one seed, repeated (decides nothing)
if: inputs.ab_network_webrtc_seed != ''
env:
PYTHONUNBUFFERED: "1"
AB_NETWORK_HUNT: webrtc:${{ inputs.ab_network_webrtc_seed }}:${{ inputs.runs }}
run: |
set -u
if [ "$RUNNER_OS" = "Linux" ]; then PRE="xvfb-run -a"; else PRE=""; fi
mkdir -p network
$PRE python -u scripts/ci_ab_network.py ab --a-a --out network --published-binary "$FF"
- name: Loop until it catches one
if: inputs.ab_network_webrtc_seed == ''
env:
PYTHONUNBUFFERED: "1"
INVPW_TEST_WATCHDOG_FILE: evidence/e2e-watchdog.log
@@ -152,3 +216,12 @@ jobs:
evidence/e2e-watchdog.log
if-no-files-found: warn
retention-days: 14
- name: Upload the hunt of the network oracle's WebRTC walk
if: always() && inputs.ab_network_webrtc_seed != ''
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: e2e-hunt-network-webrtc-${{ inputs.os }}-${{ github.run_id }}-${{ github.run_attempt }}
path: network/hunt
if-no-files-found: warn
retention-days: 14
+1174 -56
View File
File diff suppressed because it is too large. Load diff
+36 -6
View File
@@ -53,11 +53,27 @@ jobs:
core-on-index:
uses: ./.github/workflows/core-on-index.yml
walk:
name: fakeweb ${{ matrix.profile }} (${{ matrix.os }})
# The Ubuntu packages of the Linux legs, from Ubuntu's archive once per runner image and list (linux-deps.yml), never by a leg.
linux-deps-fakeweb:
name: linux-deps-fakeweb
needs: core-on-index
if: needs.core-on-index.outputs.available == 'true'
uses: ./.github/workflows/linux-deps.yml
with:
name: fakeweb
packages: xvfb
playwright_wrapper_ref: ${{ github.sha }}
walk:
name: fakeweb ${{ matrix.profile }} (${{ matrix.os }})
needs: [core-on-index, linux-deps-fakeweb]
if: needs.core-on-index.outputs.available == 'true'
runs-on: ${{ matrix.runner }}
# TEMP and TMP on D:\a\_temp (the runner's temp folder): the Firefox profiles land in TEMP and on C: they saturate the disk (queue up to 144,
# latencies up to 4 s, parent main thread still 40-60 s). On the job, not in a step: `runner.temp` is not readable in a job's `env`.
env:
TEMP: ${{ startsWith(matrix.runner, 'windows') && 'D:\a\_temp' || '/tmp' }}
TMP: ${{ startsWith(matrix.runner, 'windows') && 'D:\a\_temp' || '/tmp' }}
timeout-minutes: 30
strategy:
fail-fast: false
@@ -80,12 +96,26 @@ jobs:
python -m pip install --upgrade pip
python -m pip install ".[dev]"
python -m pip install "playwright==$(cat scripts/playwright_pin.txt)"
- name: System deps (xvfb + Firefox runtime libs)
- name: The Linux packages (the run's linux-deps-fakeweb job, no mirror)
if: matrix.os == 'linux'
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
with:
name: ${{ needs.linux-deps-fakeweb.outputs.artifact }}
path: /tmp/linux-deps
- name: System deps (xvfb + Firefox runtime libs; the repository of the linux-deps-fakeweb job)
if: matrix.os == 'linux'
run: |
sudo apt-get update
sudo apt-get install -y xvfb
sudo "$(which python)" -m playwright install-deps firefox
set -euo pipefail
# The run's linux-deps repository and nothing else: apt reads only its sources list and lists folder, the files are already in apt's archives,
# and the roots are installed by name with --no-download: a package the repository does not hold is named here and red, never fetched.
read -r OS VER < /tmp/linux-deps/image.txt
echo "the repository was read on $OS $VER; this runner is $ImageOS $ImageVersion"
sudo mkdir -p /tmp/linux-deps-apt/lists/partial /tmp/linux-deps-apt/parts
echo "deb [trusted=yes] file:/tmp/linux-deps ./" | sudo tee /tmp/linux-deps-apt/sources.list >/dev/null
APT="-o Dir::Etc::SourceList=/tmp/linux-deps-apt/sources.list -o Dir::Etc::SourceParts=/tmp/linux-deps-apt/parts -o Dir::State::Lists=/tmp/linux-deps-apt/lists -o Acquire::Languages=none"
sudo apt-get $APT update
sudo cp /tmp/linux-deps/*.deb /var/cache/apt/archives/
sudo apt-get $APT install -y --no-download --no-install-recommends $(cat /tmp/linux-deps/roots.txt)
- name: Playwright's own Firefox (the control)
run: python -m playwright install firefox
# The security state is a ready directory of the repository (ci/security-state/, a result with no data, the sha256 in ci/security-state.pin.json): with
+8 -3
View File
@@ -50,6 +50,11 @@ jobs:
needs: core-on-index
if: needs.core-on-index.outputs.available == 'true'
runs-on: ${{ matrix.os }}
# TEMP and TMP on D:\a\_temp (the runner's temp folder): the Firefox profiles land in TEMP and on C: they saturate the disk (queue up to 144,
# latencies up to 4 s, parent main thread still 40-60 s). On the job, not in a step: `runner.temp` is not readable in a job's `env`.
env:
TEMP: 'D:\a\_temp'
TMP: 'D:\a\_temp'
strategy:
fail-fast: false
matrix:
@@ -60,10 +65,10 @@ jobs:
python: ["3.12"]
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 (v4.4.0)
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v5
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5 (v5.6.0)
with:
python-version: ${{ matrix.python }}
cache: pip
@@ -146,7 +151,7 @@ jobs:
- name: Upload diagnostics on failure
if: failure()
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 (v4.6.2)
with:
name: launch-failure-${{ matrix.os }}-py${{ matrix.python }}
path: |
+188
View File
@@ -0,0 +1,188 @@
# ─────────────────────────────────────────────────────────────────────────────
# linux-deps.yml — the Ubuntu packages of a workflow's Linux jobs, read from Ubuntu's archive ONCE per runner image and list, never by the jobs.
# The same file in the series and in the wrapper.
#
# Republish 45297517213: wrapper.e2e.fakeweb-linux-x86_64 was cancelled at its 25 minutes with every step green, because `playwright install-deps
# firefox` fetched 48.8 MB from the archive's mirror at 102 kB/s ("Fetched 48.8 MB in 7min 59s"). The speed of a mirror is a third party's.
# The first form of this file handed the jobs only the packages missing on ITS runner image and installed them against the job's own image: the
# wrapper's PR #584 ran that job on ubuntu24 20261116.376.1 and the legs on 20261116.133.1, and the legs' apt wanted a package the files did not
# hold ("E: Unable to fetch some archives"). GitHub mixes builds of an image in one run, so the files cannot depend on the image they were read on.
#
# So this job hands the jobs a REPOSITORY: the roots (the packages named with their recommends, the recommends themselves, the packages named without,
# and the roots `playwright install-deps firefox` installs for the Playwright of the wrapper's pin, read from its table), their whole closure of
# Depends and Pre-Depends with the virtual packages' providers, INCLUDING what the image already has, a Packages index, and roots.txt. A job
# installs the roots BY NAME with an apt that reads only that repository (its own sources list and lists folder) and --no-download: whatever its
# image has or lacks is resolved from the files, and a package that is not there is named by apt, red, never fetched from a mirror.
# The files are kept in a cache entry keyed by the image's OS, the date of its release and the sha of the list (an entry of .deb files on GitHub's
# runners, this file only), and handed to the run's jobs as the artifact linux-deps-<name>. Not by the image's build: the repository does not depend
# on it, and the builds of one release are mixed in a run (20261116.133.1, 20261116.376.1), so a key per build missed the entry run after run and
# read the archive each time (wrapper PR #585: 13 minutes for a closure, from a slow mirror). The download runs 8 at a time: the slowness seen is
# per connection.
# ─────────────────────────────────────────────────────────────────────────────
name: linux-deps
on:
workflow_call:
inputs:
name:
description: the artifact is linux-deps-<name>
type: string
required: true
packages:
description: packages installed with their recommends (as `apt-get install -y` did)
type: string
default: ''
packages_no_recommends:
description: packages installed without their recommends
type: string
default: ''
playwright_wrapper_ref:
description: the oss-invisible/playwright ref whose scripts/playwright_pin.txt names the Playwright of `install-deps firefox`; empty for none
type: string
default: ''
outputs:
artifact:
description: the artifact that holds the repository
value: ${{ jobs.debs.outputs.artifact }}
permissions: { contents: read }
jobs:
debs:
name: debs
runs-on: ubuntu-24.04
timeout-minutes: 20
outputs:
artifact: linux-deps-${{ inputs.name }}
steps:
- name: Checkout wrapper (its Playwright pin)
if: inputs.playwright_wrapper_ref != ''
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
repository: oss-invisible/playwright
ref: ${{ inputs.playwright_wrapper_ref }}
path: linux-deps-pin
fetch-depth: 1
sparse-checkout: scripts/playwright_pin.txt
sparse-checkout-cone-mode: false
- name: Set up Python
if: inputs.playwright_wrapper_ref != ''
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
with: { python-version: '3.11' }
- name: The list and its entry (the runner image and the sha of the list)
id: spec
shell: bash
env:
PACKAGES: ${{ inputs.packages }}
NO_REC: ${{ inputs.packages_no_recommends }}
PW_REF: ${{ inputs.playwright_wrapper_ref }}
run: |
set -euo pipefail
: "${ImageOS:?no ImageOS: not a GitHub runner image}" "${ImageVersion:?no ImageVersion: not a GitHub runner image}"
PIN=""
if [ -n "$PW_REF" ]; then PIN="$(tr -d '[:space:]' < linux-deps-pin/scripts/playwright_pin.txt)"; [ -n "$PIN" ] || { echo "ERROR: empty scripts/playwright_pin.txt at $PW_REF"; exit 1; }; fi
mkdir -p "$RUNNER_TEMP/linux-deps-spec"
printf 'form: repository of the closure\nrecommends: %s\nno-recommends: %s\nplaywright-roots-firefox: %s\n' "$PACKAGES" "$NO_REC" "$PIN" > "$RUNNER_TEMP/linux-deps-spec/spec.txt"
cat "$RUNNER_TEMP/linux-deps-spec/spec.txt"
SHA="$(sha256sum < "$RUNNER_TEMP/linux-deps-spec/spec.txt" | cut -c1-16)"
echo "pin=$PIN" >> "$GITHUB_OUTPUT"
RELEASE="${ImageVersion%%.*}"
echo "key=linux-deps-$ImageOS-$RELEASE-$SHA" | tee -a "$GITHUB_OUTPUT"
- name: The entry of this image and list
id: restore
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: /tmp/linux-deps
key: ${{ steps.spec.outputs.key }}
- name: A new image or list - the repository from Ubuntu's archive, once
if: steps.restore.outputs.cache-hit != 'true'
shell: bash
env:
PACKAGES: ${{ inputs.packages }}
NO_REC: ${{ inputs.packages_no_recommends }}
PIN: ${{ steps.spec.outputs.pin }}
run: |
set -euo pipefail
printf '%s\n' 'Acquire::http::Timeout "60";' 'Acquire::https::Timeout "60";' 'Acquire::Retries "5";' \
| sudo tee /etc/apt/apt.conf.d/80-ci-network >/dev/null
sudo apt-get update -qq
command -v apt-ftparchive >/dev/null || sudo apt-get install -y -qq apt-utils
PW_ROOTS=""
if [ -n "$PIN" ]; then
python -m pip install --quiet "playwright==$PIN"
# The roots `playwright install-deps firefox` installs (with --no-install-recommends): the `tools` and `firefox` lists of this system's
# entry in the driver's table, the list install-deps itself reads.
PLATFORM="ubuntu$(. /etc/os-release && echo "$VERSION_ID")-x64"
PW_ROOTS="$(python - "$PLATFORM" <<'PY'
import os, re, sys
import playwright
path = os.path.join(os.path.dirname(playwright.__file__), "driver", "package", "lib", "coreBundle.js")
text = open(path, encoding="utf-8").read()
at = text.find('"%s": {' % sys.argv[1])
if at < 0:
sys.exit("no entry %s in %s" % (sys.argv[1], path))
roots = []
for group in ("tools", "firefox"):
m = re.compile(r"\b%s: \[(.*?)\]" % group, re.S).search(text, at)
if not m:
sys.exit("no %s list after the entry %s" % (group, sys.argv[1]))
roots += re.findall(r'"([a-z0-9][a-z0-9.+-]*)"', m.group(1))
if "xvfb" not in roots or len(roots) < 10:
sys.exit("the roots read from %s are not install-deps' list: %s" % (path, roots))
print(" ".join(sorted(set(roots))))
PY
)"
echo "playwright install-deps firefox roots: $PW_ROOTS"
fi
# The recommends of the packages named with their recommends (as `apt-get install -y` installed them), one level, as roots themselves.
RECS=""
[ -z "$PACKAGES" ] || RECS="$(apt-cache depends --no-depends --no-pre-depends --no-suggests --no-conflicts --no-breaks --no-replaces --no-enhances $PACKAGES \
| sed -n 's/^ *|\{0,1\}Recommends: \([a-z0-9][^ <>]*\)$/\1/p' | sort -u | tr '\n' ' ')"
NAMED="$(echo $PACKAGES $RECS $NO_REC $PW_ROOTS | tr ' ' '\n' | sed '/^$/d' | sort -u | tr '\n' ' ')"
# A name only provided (libgtk-3-0, libgtk-3-0t64's on noble) is its provider, as `apt-get install` resolved it: `apt-cache depends
# --recurse` does not walk from a virtual root (wrapper PR #585: the closure of libgtk-3-0 came without libgtk-3-0t64, 92 packages of 230).
ROOTS=""
for r in $NAMED; do
if apt-cache show --no-all-versions "$r" 2>/dev/null | grep -qx "Package: $r"; then ROOTS="$ROOTS $r"; continue; fi
p="$(apt-cache showpkg "$r" | sed -n '/^Reverse Provides:/,$p' | sed '1d' | awk 'NF {sub(/:.*/, "", $1); print $1}' | sort -u)"
[ "$(echo "$p" | wc -w)" = 1 ] || { echo "ERROR: the root $r is not a package and is provided by [$p], not by one package"; exit 1; }
echo "the root $r is provided by $p"
ROOTS="$ROOTS $p"
done
ROOTS="$(echo $ROOTS | tr ' ' '\n' | sort -u | tr '\n' ' ')"
echo "roots: $ROOTS"
# The closure: Depends and Pre-Depends, recursively, the providers of every virtual package, what the image has included.
CLOSURE="$(apt-cache depends --recurse --no-recommends --no-suggests --no-conflicts --no-breaks --no-replaces --no-enhances $ROOTS \
| grep -E '^[a-z0-9]' | sed 's/:amd64$//' | grep -v ':' | sort -u)"
REAL="$({ apt-cache show --no-all-versions $CLOSURE 2>/dev/null || true; } | sed -n 's/^Package: //p' | sort -u)"
rm -rf /tmp/linux-deps && mkdir -p /tmp/linux-deps
# The lists were refreshed above (apt-get update), so every closure name has its current version; each fetch retries 5 times. The MB and
# the seconds of the download go to the log, so the archive's speed is measured run after run.
T0="$(date +%s)"
( cd /tmp/linux-deps && echo "$REAL" | xargs -n 20 -P 8 apt-get download -qq -o Acquire::Retries=5 )
T1="$(date +%s)"
echo "download: $(echo "$REAL" | wc -w) packages, $(du -sm /tmp/linux-deps | cut -f1) MB in $((T1 - T0)) s"
( cd /tmp/linux-deps && apt-ftparchive packages . > Packages )
for p in $REAL; do grep -qx "Package: $p" /tmp/linux-deps/Packages || { echo "ERROR: $p of the closure was not downloaded"; exit 1; }; done
# A root is a package of the repository or a name one of them provides (libgtk-3-0 is libgtk-3-0t64's on noble, as `apt-get install` resolved it)
for r in $ROOTS; do
e="$(printf '%s' "$r" | sed 's/[.+]/\\&/g')"
grep -qE "^(Package: $e|Provides: (.*, )?$e( \(.*\))?(,.*)?)$" /tmp/linux-deps/Packages || { echo "ERROR: the root $r is not in the repository"; exit 1; }
done
echo "$ROOTS" | tr ' ' '\n' | sed '/^$/d' > /tmp/linux-deps/roots.txt
cp "$RUNNER_TEMP/linux-deps-spec/spec.txt" /tmp/linux-deps/spec.txt
echo "$ImageOS $ImageVersion" > /tmp/linux-deps/image.txt
echo "$(wc -l < /tmp/linux-deps/roots.txt) roots, $(find /tmp/linux-deps -name '*.deb' | wc -l) packages in the closure, $(du -sh /tmp/linux-deps | cut -f1)"
- name: Keep the entry
if: steps.restore.outputs.cache-hit != 'true'
uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: /tmp/linux-deps
key: ${{ steps.spec.outputs.key }}
- name: The repository for the jobs of this run
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: linux-deps-${{ inputs.name }}
path: /tmp/linux-deps
retention-days: 1
if-no-files-found: error
+1 -1
View File
@@ -9,4 +9,4 @@ permissions:
contents: read
jobs:
noreply-identity:
uses: oss-invisible/core/.github/workflows/noreply-identity.yml@main
uses: oss-invisible/core/.github/workflows/noreply-identity.yml@6d048ac02fc886a50791a4ae0423cbca2a547d72 # core main, the last change of noreply-identity.yml
+2 -2
View File
@@ -63,10 +63,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out the repo (docs + the converter)
uses: actions/checkout@v4
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 (v4.4.0)
- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5 (v5.6.0)
with:
python-version: "3.12"
+8 -8
View File
@@ -62,7 +62,7 @@ jobs:
present: ${{ steps.probe.outputs.present }}
version: ${{ steps.probe.outputs.version }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 (v4.4.0)
- id: probe
shell: bash
run: |
@@ -88,10 +88,10 @@ jobs:
contents: read
checks: read
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 (v4.4.0)
with:
fetch-depth: 0
- uses: actions/setup-python@v5
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5 (v5.6.0)
with:
python-version: "3.12"
@@ -206,8 +206,8 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 (v4.4.0)
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5 (v5.6.0)
with:
python-version: "3.12"
- name: Install the wrapper (its core comes from the index)
@@ -225,10 +225,10 @@ jobs:
contents: write # to commit the ledger entry back
pull-requests: write # and to open one when protection declines the push
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 (v4.4.0)
with:
fetch-depth: 0
- uses: actions/setup-python@v5
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5 (v5.6.0)
with:
python-version: "3.12"
- run: python -m pip install --upgrade pip build
@@ -237,7 +237,7 @@ jobs:
run: |
pip install twine
twine check dist/*
- uses: pypa/gh-action-pypi-publish@release/v1
- uses: pypa/gh-action-pypi-publish@7245906fb61fa33a13554f9d5fb856fe61758086 # v1.14.3
- name: record what was published, and commit it back
# The action above holds the OIDC credential and does the upload; the
# thing that writes PUBLISHED.json is invisible_core.release. So the
+44
View File
@@ -0,0 +1,44 @@
# ─────────────────────────────────────────────────────────────────────────────
# published-set.yml - the control side of the A/B oracles is the last PUBLISHED SET, and this keeps its lock equal to the index.
#
# An A/B oracle holds a candidate against the engine published before it, and that engine is launched by the core it was built for (it refuses a launch whose
# declarations that core does not emit). So the control is a set: the last `invisible-playwright` on the index, the `invisible-core` it pins exactly, and the engine
# that core's seal pins, in a venv of their own, installed by hash (ci-03): ci/py-lock/published.txt, made by scripts/ci_published_set.py. Nothing in it is chosen
# by hand; a new release is the new baseline.
#
# The lock is a committed file so that a run installs it offline (the wheelhouse of the run holds the files it names). What can go stale is the lock, the day a
# release is published: this reads the index (the JSON of the two packages, nothing is installed or run) and is RED when the committed lock is not the index's last
# release. The fix is one command, `python scripts/ci_published_set.py resolve --write`, in the pull request that records the release.
# ─────────────────────────────────────────────────────────────────────────────
name: published-set
on:
schedule:
- cron: "41 5 * * *"
pull_request:
paths:
- ci/py-lock/published.txt
- scripts/ci_published_set.py
- .github/workflows/published-set.yml
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && format('pr-{0}', github.event.pull_request.number) || github.run_id }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
lock-is-the-index:
name: the committed published set is the index's last release
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Check out the lock and the script
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 (v4.4.0)
- name: Set up Python
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5 (v5.6.0)
with:
python-version: "3.12"
- name: The lock against the index (reads the index, installs nothing)
run: python scripts/ci_published_set.py check
+56 -8
View File
@@ -146,16 +146,29 @@ jobs:
echo "version=$version" >> "$GITHUB_OUTPUT"
echo "admission: $admission, invisible-playwright $version"
# The Ubuntu packages of the Linux legs, from Ubuntu's archive once per runner image and list (linux-deps.yml), never by a leg.
linux-deps-real-sites:
name: linux-deps-real-sites
needs: plan
uses: ./.github/workflows/linux-deps.yml
with:
name: real-sites
packages: xvfb libgtk-3-0 libdbus-glib-1-2 libasound2t64
round:
name: round (${{ matrix.os }})
needs: plan
needs: [plan, linux-deps-real-sites]
runs-on: ${{ matrix.os }}
timeout-minutes: 40
strategy:
fail-fast: false # one system failing must not hide the other's table
matrix:
os: [ubuntu-24.04, windows-latest]
# TEMP and TMP on D:\a\_temp (the runner's temp folder): the Firefox profiles land in TEMP and on C: they saturate the disk (queue up to 144,
# latencies up to 4 s, parent main thread still 40-60 s). On the job, not in a step: `runner.temp` is not readable in a job's `env`.
env:
TEMP: ${{ startsWith(matrix.os, 'windows') && 'D:\a\_temp' || '/tmp' }}
TMP: ${{ startsWith(matrix.os, 'windows') && 'D:\a\_temp' || '/tmp' }}
VERSION: ${{ needs.plan.outputs.version }}
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
@@ -163,11 +176,26 @@ jobs:
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
with: { python-version: '3.12' }
- name: Linux runtime libraries for the browsers
- name: The Linux packages (the run's linux-deps-real-sites job, no mirror)
if: runner.os == 'Linux'
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
with:
name: ${{ needs.linux-deps-real-sites.outputs.artifact }}
path: /tmp/linux-deps
- name: Linux runtime libraries for the browsers (the repository of the linux-deps-real-sites job)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y xvfb libgtk-3-0 libdbus-glib-1-2 libasound2t64
set -euo pipefail
# The run's linux-deps repository and nothing else: apt reads only its sources list and lists folder, the files are already in apt's archives,
# and the roots are installed by name with --no-download: a package the repository does not hold is named here and red, never fetched.
read -r OS VER < /tmp/linux-deps/image.txt
echo "the repository was read on $OS $VER; this runner is $ImageOS $ImageVersion"
sudo mkdir -p /tmp/linux-deps-apt/lists/partial /tmp/linux-deps-apt/parts
echo "deb [trusted=yes] file:/tmp/linux-deps ./" | sudo tee /tmp/linux-deps-apt/sources.list >/dev/null
APT="-o Dir::Etc::SourceList=/tmp/linux-deps-apt/sources.list -o Dir::Etc::SourceParts=/tmp/linux-deps-apt/parts -o Dir::State::Lists=/tmp/linux-deps-apt/lists -o Acquire::Languages=none"
sudo apt-get $APT update
sudo cp /tmp/linux-deps/*.deb /var/cache/apt/archives/
sudo apt-get $APT install -y --no-download --no-install-recommends $(cat /tmp/linux-deps/roots.txt)
# Two venvs that share nothing: what a user gets from the index, and what a user of stock Playwright gets. The wrapper is installed by its published version
# (the index may lag a few minutes behind a publication: only the install is asked again), then its engine is fetched the way a user fetches it.
@@ -245,9 +273,14 @@ jobs:
# One pass of stock over the list, on one system: five of them per system make the admission.
admit:
name: admit (${{ matrix.os }}, pass ${{ matrix.repeat }})
needs: plan
needs: [plan, linux-deps-real-sites]
if: needs.plan.outputs.admission == 'true'
runs-on: ${{ matrix.os }}
# TEMP and TMP on D:\a\_temp (the runner's temp folder): the Firefox profiles land in TEMP and on C: they saturate the disk (queue up to 144,
# latencies up to 4 s, parent main thread still 40-60 s). On the job, not in a step: `runner.temp` is not readable in a job's `env`.
env:
TEMP: ${{ startsWith(matrix.os, 'windows') && 'D:\a\_temp' || '/tmp' }}
TMP: ${{ startsWith(matrix.os, 'windows') && 'D:\a\_temp' || '/tmp' }}
timeout-minutes: 40
strategy:
fail-fast: false
@@ -260,11 +293,26 @@ jobs:
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
with: { python-version: '3.12' }
- name: Linux runtime libraries for the browser
- name: The Linux packages (the run's linux-deps-real-sites job, no mirror)
if: runner.os == 'Linux'
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
with:
name: ${{ needs.linux-deps-real-sites.outputs.artifact }}
path: /tmp/linux-deps
- name: Linux runtime libraries for the browser (the repository of the linux-deps-real-sites job)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y xvfb libgtk-3-0 libdbus-glib-1-2 libasound2t64
set -euo pipefail
# The run's linux-deps repository and nothing else: apt reads only its sources list and lists folder, the files are already in apt's archives,
# and the roots are installed by name with --no-download: a package the repository does not hold is named here and red, never fetched.
read -r OS VER < /tmp/linux-deps/image.txt
echo "the repository was read on $OS $VER; this runner is $ImageOS $ImageVersion"
sudo mkdir -p /tmp/linux-deps-apt/lists/partial /tmp/linux-deps-apt/parts
echo "deb [trusted=yes] file:/tmp/linux-deps ./" | sudo tee /tmp/linux-deps-apt/sources.list >/dev/null
APT="-o Dir::Etc::SourceList=/tmp/linux-deps-apt/sources.list -o Dir::Etc::SourceParts=/tmp/linux-deps-apt/parts -o Dir::State::Lists=/tmp/linux-deps-apt/lists -o Acquire::Languages=none"
sudo apt-get $APT update
sudo cp /tmp/linux-deps/*.deb /var/cache/apt/archives/
sudo apt-get $APT install -y --no-download --no-install-recommends $(cat /tmp/linux-deps/roots.txt)
- name: Stock Playwright and its Firefox, then one pass
shell: bash
+63 -15
View File
@@ -53,8 +53,8 @@ jobs:
needs: core-on-index
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 (v4.4.0)
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5 (v5.6.0)
with:
python-version: "3.12"
- name: install the pinned core, which carries the gate
@@ -82,8 +82,8 @@ jobs:
needs: core-on-index
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 (v4.4.0)
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5 (v5.6.0)
with:
python-version: "3.12"
- name: install the pinned core, which carries the gate
@@ -108,8 +108,8 @@ jobs:
needs: core-on-index
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 (v4.4.0)
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5 (v5.6.0)
with:
python-version: "3.12"
- name: install the pinned core, which carries the gate
@@ -135,8 +135,8 @@ jobs:
needs: core-on-index
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 (v4.4.0)
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5 (v5.6.0)
with:
python-version: "3.12"
- name: install the pinned core, which carries the gate
@@ -164,13 +164,18 @@ jobs:
# email (author, committer, tagger). The judge lives in oss-invisible/core and
# is read from its main, never from this branch.
noreply-identity:
uses: oss-invisible/core/.github/workflows/noreply-identity.yml@main
uses: oss-invisible/core/.github/workflows/noreply-identity.yml@6d048ac02fc886a50791a4ae0423cbca2a547d72 # core main, the last change of noreply-identity.yml
unit:
name: pytest (${{ matrix.os }}, py${{ matrix.python }})
needs: core-on-index
if: needs.core-on-index.outputs.available == 'true'
runs-on: ${{ matrix.os }}
# TEMP and TMP on D:\a\_temp (the runner's temp folder): the Firefox profiles land in TEMP and on C: they saturate the disk (queue up to 144,
# latencies up to 4 s, parent main thread still 40-60 s). On the job, not in a step: `runner.temp` is not readable in a job's `env`.
env:
TEMP: ${{ startsWith(matrix.os, 'windows') && 'D:\a\_temp' || '/tmp' }}
TMP: ${{ startsWith(matrix.os, 'windows') && 'D:\a\_temp' || '/tmp' }}
strategy:
fail-fast: false
matrix:
@@ -190,7 +195,7 @@ jobs:
- { os: windows-latest, python: "3.13" }
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 (v4.4.0)
# main, for the tests that compare a list of this change with the list of main (tests/test_the_e2e_tests_do_not_wait_on_clocks.py: the debt of
# the e2e tests only shrinks). The checkout is one commit deep; without this the comparison has nothing to read and the test says so.
@@ -199,7 +204,7 @@ jobs:
run: git fetch --no-tags --depth=1 origin main:refs/remotes/origin/main
- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v5
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5 (v5.6.0)
with:
python-version: ${{ matrix.python }}
cache: pip
@@ -248,11 +253,37 @@ jobs:
run: python scripts/ci_lab_geoip.py build
- name: Run pytest
if: matrix.python != '3.11'
shell: bash
run: |
set -o pipefail # or tee would swallow pytest's exit code
pytest tests/ -v --tb=short -rs | tee tests-report.txt
# The legs of Python 3.11 (the version the engine series' gate runs, on both of its systems) run the suite the way that gate does: the files and the
# marker of the row wrapper.unit.all.<os> of ci/required-suites.json (printed by scripts/ci_verdict.py args), one junit, and the judge below reads
# it. Until 2026-11-24 this workflow ran `pytest tests/` with a floor of 380 and nothing judged the exact counts the gate holds: PR #590 added a test
# without raising min_tests, this workflow was green, and the gate went red on main's next series run ("the suite is exact").
# No test runs twice: the row leaves out the files of the environment (a clone with its hooks armed, one with origin/main, the package index, ...: named,
# each with its reason, in tests/test_the_unit_suite_is_accounted_for.py), so a second pytest, with --ignore for every file of the row, runs those
# and any file that is in no row: together the two runs are what `pytest tests/` ran.
- name: Run pytest (the selection of the gate, then the files outside the row)
if: matrix.python == '3.11'
shell: bash
env:
SUITE_OS: ${{ startsWith(matrix.os, 'windows') && 'windows' || 'linux' }}
run: |
unset PYTEST_ADDOPTS
python scripts/ci_verdict.py args --required ci/required-suites.json --suite "wrapper.unit.all.$SUITE_OS" --os "$SUITE_OS" --with-marker | tr -d '\r' > "$RUNNER_TEMP/unit_args.txt"
mapfile -t ARGS < "$RUNNER_TEMP/unit_args.txt"
IGNORE=()
for a in "${ARGS[@]}"; do
case "$a" in tests/*::*) ;; tests/*) IGNORE+=("--ignore=$a") ;; esac
done
rc=0
python -m pytest "${ARGS[@]}" -o addopts='' -o junit_family=xunit2 -q --tb=short -p no:cacheprovider -p no:rerunfailures -rs --junitxml="$RUNNER_TEMP/unit-junit.xml" || rc=$?
python -m pytest tests/ "${IGNORE[@]}" -v --tb=short -rs || rc=$?
exit $rc
# The leg ran with the pinned database, and the core never went past it to GitHub (tests/geoip_used.py wrote what it did).
- name: The leg ran with the pinned GeoIP database
if: always()
@@ -267,6 +298,7 @@ jobs:
# already filters on two markers - one more, or a typo in one, silently
# turns 726 tests into 0 and reports success.
- name: Refuse a run in which the suite deselected itself
if: matrix.python != '3.11'
shell: bash
run: |
python - <<'PY'
@@ -293,6 +325,22 @@ jobs:
print(f"{passed} tests ran")
PY
# The judge of the engine series' gate on the junit of the step above: the exact count of the row (not one test more, not one less), no skip, every
# file of the row passed, and the list only grows against main. The judge and the list it compares with are read from main, never from the branch under
# judgment (a branch that edits its own judge or its own list cannot pass itself): a PR that adds a test and does not raise min_tests is red here.
# The suite launches no browser, so --binary names the interpreter that ran it (the judge wants a file to hash; nothing reads that hash: no --out).
- name: Judge the suite wrapper.unit.all (the exact count, with the judge and the list of main)
if: always() && matrix.python == '3.11'
shell: bash
env:
SUITE_OS: ${{ startsWith(matrix.os, 'windows') && 'windows' || 'linux' }}
run: |
mkdir -p "$RUNNER_TEMP/main"
git show origin/main:scripts/ci_verdict.py > "$RUNNER_TEMP/main/ci_verdict.py"
git show origin/main:ci/required-suites.json > "$RUNNER_TEMP/main/required-suites.json"
if git cat-file -e origin/main:ci/retired-tests.json; then git show origin/main:ci/retired-tests.json > "$RUNNER_TEMP/main/retired-tests.json"; fi
python "$RUNNER_TEMP/main/ci_verdict.py" judge --required ci/required-suites.json --suite "wrapper.unit.all.$SUITE_OS" --os "$SUITE_OS" --junit "$RUNNER_TEMP/unit-junit.xml" --binary "$(python -c 'import sys; print(sys.executable)')" --main-required "$RUNNER_TEMP/main/required-suites.json"
# ONE SINGLE CONTEXT FOR BRANCH PROTECTION. Measured 2026-08-13: this
# repo's protection required `pytest (windows-latest, py3.11)`, which the
# matrix explicitly EXCLUDES a few lines up - a context no job can ever
@@ -327,8 +375,8 @@ jobs:
if: needs.core-on-index.outputs.available == 'true'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 (v4.4.0)
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5 (v5.6.0)
with:
python-version: "3.12"
cache: pip
@@ -424,12 +472,12 @@ jobs:
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 (v4.4.0)
with:
# The gate diffs the tree against the tag of the published
# version; a shallow clone has no tags and cannot tell.
fetch-depth: 0
- uses: actions/setup-python@v5
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5 (v5.6.0)
with:
python-version: "3.12"
- name: the version this change proposes is still free
+40 -8
View File
@@ -79,9 +79,23 @@ concurrency:
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
# The Ubuntu packages of the Linux leg, from Ubuntu's archive once per runner image and list (linux-deps.yml), never by the leg.
linux-deps-user-install:
name: linux-deps-user-install
uses: ./.github/workflows/linux-deps.yml
with:
name: user-install
packages: xvfb libgtk-3-0 libdbus-glib-1-2 libasound2t64
install:
needs: linux-deps-user-install
name: ${{ matrix.os }} - install from ${{ github.event.inputs.source || 'index' }} and launch
runs-on: ${{ matrix.os }}
# TEMP and TMP on D:\a\_temp (the runner's temp folder): the Firefox profiles land in TEMP and on C: they saturate the disk (queue up to 144,
# latencies up to 4 s, parent main thread still 40-60 s). On the job, not in a step: `runner.temp` is not readable in a job's `env`.
env:
TEMP: ${{ startsWith(matrix.os, 'windows') && 'D:\a\_temp' || '/tmp' }}
TMP: ${{ startsWith(matrix.os, 'windows') && 'D:\a\_temp' || '/tmp' }}
timeout-minutes: 45
strategy:
fail-fast: false # one OS failing must not hide the other's result
@@ -89,17 +103,20 @@ jobs:
os: [ubuntu-24.04, windows-latest]
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4 (v4.4.0)
- uses: actions/setup-python@v5
- uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5 (v5.6.0)
with: { python-version: '3.11' }
# Only what the TEST needs (and `uv`, for the wait below to ask uv, which the release test installs the package with). The package under test is installed by the
# Only what the TEST needs, from the wrapper's hashed lock (ci/py-lock/gate.txt), the one the other test jobs read: never a hand list, which is how
# `psutil` (imported by the OS-cursor helper of the tests since #609) was missing here and ledger #618 was red. The lock holds `uv` (the wait below asks it, and the
# release test installs the package with it) and holds neither invisible-playwright nor invisible-core: the package under test is installed by the
# test itself, into a venv it creates, from the index - installing it
# here as well would put a second copy on the path and the assertions
# would be reading the wrong one.
# would be reading the wrong one. The runner's own pip, nothing unhashed.
# A rule test of the unit suite (the install job has every module its tests import) holds every third-party module the tests import to that lock.
- name: Test harness only
run: python -m pip install --upgrade pip pytest packaging uv
run: python -m pip install --require-hashes -r ci/py-lock/gate.txt
# ⛔ THE VERSION OF A LEDGER PULL REQUEST IS THE ONE IT ADDS TO PUBLISHED.json, NOT THE ONE THE TREE DECLARES.
# The ledger PR of a release is merged after this job is green, and the next release's tree can already be on main: ledger #534 recorded
@@ -197,11 +214,26 @@ jobs:
time.sleep(poll)
PY
- name: Linux runtime libraries for the browser
- name: The Linux packages (the run's linux-deps-user-install job, no mirror)
if: runner.os == 'Linux'
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
with:
name: ${{ needs.linux-deps-user-install.outputs.artifact }}
path: /tmp/linux-deps
- name: Linux runtime libraries for the browser (the repository of the linux-deps-user-install job)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y xvfb libgtk-3-0 libdbus-glib-1-2 libasound2t64
set -euo pipefail
# The run's linux-deps repository and nothing else: apt reads only its sources list and lists folder, the files are already in apt's archives,
# and the roots are installed by name with --no-download: a package the repository does not hold is named here and red, never fetched.
read -r OS VER < /tmp/linux-deps/image.txt
echo "the repository was read on $OS $VER; this runner is $ImageOS $ImageVersion"
sudo mkdir -p /tmp/linux-deps-apt/lists/partial /tmp/linux-deps-apt/parts
echo "deb [trusted=yes] file:/tmp/linux-deps ./" | sudo tee /tmp/linux-deps-apt/sources.list >/dev/null
APT="-o Dir::Etc::SourceList=/tmp/linux-deps-apt/sources.list -o Dir::Etc::SourceParts=/tmp/linux-deps-apt/parts -o Dir::State::Lists=/tmp/linux-deps-apt/lists -o Acquire::Languages=none"
sudo apt-get $APT update
sudo cp /tmp/linux-deps/*.deb /var/cache/apt/archives/
sudo apt-get $APT install -y --no-download --no-install-recommends $(cat /tmp/linux-deps/roots.txt)
- name: The user path, end to end
env:
+71
View File
@@ -4,6 +4,77 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [0.61.0] - 2026-11-30
### Changed
- Pins invisible-core 71.85.0 on the engine firefox-71 (Firefox 159.0).
- The window origin is declared by the core, and the screen coordinates a page reads go through it, in the top document and in an
out-of-process frame of another site: such a frame used to read the top document's origin without its own position.
- The end point of a drag is mapped through the window of the drag source, and tooltips and autoscroll open at the real pointer.
- A popup's position and outer size are set when it opens by Firefox's own rule, and a positioned popup is kept on the declared screen by
Firefox's own clamp; the core no longer declares a popup position.
- The height of the maximized browser chrome follows Firefox's toolbar density rule, and the window frame is computed from the system
metrics at the declared scale: at 125% the bar above the page is 106 device pixels, as in retail Firefox 159, where 0.60.0 declared 107.
- The core accepts exactly the display scales Windows offers (100% to 500%), and refuses a scale the declared screen does not offer.
### Fixed
- The load of a frame waits for the processes below it, a navigation that does not create a new document no longer releases a frame, and
the ready of a page is told once, after its document.
- Drag and drop driven by the client reaches a frame of another site: the drag has one session, owned by the browser process, as a real
drag does; `dragend` ends at the screen point of the declared window, the drag events carry the buttons held, and `drag` fires at the
source.
- A select dropdown opened by a click no longer closes on that click's own release: menus close on the next press or wheel, as with a
real mouse, never on a release or a move.
- `wait_for_selector(state="hidden")` returns at once when nothing matches and never returns a handle, as stock Playwright does.
- A font face that our text code used after it could be released (a dangling HarfBuzz face pointer) is now held by its own type.
- Through a UDP proxy, an IPv6 socket reaches its IPv4 relay after the association too.
## [0.60.0] - 2026-11-27
### Changed
- Pins invisible-core 70.83.0 on the engine firefox-70 (Firefox 159.0).
- The engine carries Firefox's fix for the race between the start and the shutdown of its telemetry (Glean): a browser closed while it was
still starting no longer leaves that work half done.
- ElementHandle pointer actions (`click`, `dblclick`, `hover`, `tap`, `check`, `uncheck`, `set_checked`) now use the same humanised pointer walk as selector actions (they used to jump to the exact centre of the element in one move).
- Screenshot parameters that Playwright honours by modifying the page (`mask`/`maskColor`, `style`, `animations="disabled"`,
`caret="initial"`) are now refused by name with a clear error instead of being silently ignored; `omitBackground` with PNG answers
Firefox's own `Not implemented`, as stock Playwright does. A refused screenshot of an element or a locator is refused before the page is
scrolled or measured.
## [0.59.0] - 2026-11-24
### Changed
- Pins invisible-core 69.82.0 on the engine firefox-69 (Firefox 159.0).
### Added
- An element handle serves the methods of Playwright's `ElementHandle` that it used to refuse as a gap: `query_selector`, `query_selector_all`,
`eval_on_selector`, `eval_on_selector_all` (rooted at the element), `evaluate_handle`, `is_visible`, `is_hidden`, `is_enabled`, `is_disabled`,
`is_checked`, `is_editable`, `wait_for_element_state`, `dblclick`, `select_text` and `dispatch_event`, with the answers and the errors
Playwright's own server gives. `wait_for_selector` on an element handle is still refused.
- `set_input_files` with a file path works from a client attached with `connect`: the file is streamed into the session, as a stock client does
over a remote connection, and a stream can be used only by the context that made it.
### Fixed
- The argument of `evaluate` and its kin (`page.evaluate(fn, element)`, `evaluate_handle`, `eval_on_selector`, `eval_on_selector_all` and the
frame and handle forms) reaches the page as Playwright sends it: element and JS handles, dates, URLs, errors, shared references, `undefined`,
`-0` and `ArrayBuffer` are decoded in the page instead of arriving as `null`.
- `screenshot(scale="css")` is a picture in CSS pixels, as in stock Playwright; the scale was ignored and the picture was in device pixels.
- `tap` on a context without `has_touch` is refused with Playwright's own message before anything is sent to the page.
- A read that waits for its element (`inner_text`, `text_content`, `get_attribute` and the others) and runs out of time now always fails with
Playwright's own `Timeout Nms exceeded`. On Windows it could fail with the engine connection's `no response in 0s` instead, when the last
probe ran out of the caller's time a moment before the clock said so.
### Engine firefox-69
- On Linux the engine no longer runs the host's GL probe when the machine is declared: whether WebGL is available comes from the declaration alone.
- A navigation that changes process is no longer ended by the document it left, and a page is reported ready only after its document.
- A request to a page process that went away is answered instead of being left waiting, and the end of a network request and the contexts of a
frame are reported as Playwright expects.
- The engine's security-state generation no longer ends in a crash now and then (the telemetry was starting during shutdown).
- On Windows, the port a WebRTC connection holds is its own.
### Known issues
- `tap` with `has_touch` fails with an engine error: the engine cannot send a touch event since Firefox 159. It will be fixed in the engine.
## [0.58.0] - 2026-11-21
### Changed
+2404
View File
File diff suppressed because it is too large. Load diff
+4
View File
@@ -0,0 +1,4 @@
{
"format": "ab-host-expected/1",
"differences": []
}
+38
View File
@@ -0,0 +1,38 @@
{
"format": "ab-network-volatile/1",
"about": "The leaves of the network transcript that differ between two runs of ONE engine (the A/A of scripts/ci_ab_network.py). Each entry: `pattern` (fnmatch over the leaf path seeds/<seed>/<category>/...), `reason` (why that leaf is noise), `aa_run` (the A/A run that proved it). Born from the evidence of the A/A, never written ahead of it. It may only shrink: an entry that matches no leaf of a run is red as stale.",
"entries": [
{
"pattern": "seeds/*/journey/connects/counts/*",
"reason": "How many TCP connections the browser opens to each destination of the journey (the DoH, the two origins) is the connection pool's: parallel and speculative connections, keep-alive connections that close and reopen, DoH connections. The CONNECTs of the launch stage are counted with the journey ones (the DoH connection at start-up lands in either). The set of destinations and the order they were first reached stay compared (journey/connects/order). Totals of the two runs: Linux DoH 226 and 225, origin A 14 and 13, origin O 20 and 12; Windows DoH 222 and 230, A 23 and 15, O 22 and 14.",
"aa_run": "44946411675 (linux, windows)"
},
{
"pattern": "seeds/*/webrtc/connects/counts/*",
"reason": "The connections to the DoH during the WebRTC page: 14 and 25 between the two Windows runs. Same pool; the destinations of the page (webrtc/connects/order) stay compared.",
"aa_run": "44946411675 (windows)"
},
{
"pattern": "seeds/*/https/*/wire/resumed_connections",
"optional": true,
"reason": "Whether a connection that resumes a session carried a request at all follows the ticket and the pool: an origin had one in a run and none in the other (seed 2 and seed 4 on Linux, h1: 108 leaves each), so what is under it is compared where both runs have a resumption and excused where only one has. The fresh connections (wire/connections) and the protocols stay compared always.",
"aa_run": "44982522362 (linux)"
},
{
"pattern": "seeds/*/h3/wire/resumed_connections",
"optional": true,
"reason": "The same for the HTTP/3 site's resumed connection.",
"aa_run": "44982522362 (linux)"
},
{
"pattern": "seeds/*/https/*/wire/*connections/*/tls/extensions/encrypted_client_hello/aead",
"reason": "The engine sends an ECH extension with no real configuration (GREASE) and picks its AEAD at random for each ClientHello it builds, whether the handshake is fresh or resumed: NSS security/nss/lib/ssl/tls13ech.c:2257, `aead = (rawData->data[0] & 1) ? HpkeAeadAes128Gcm : HpkeAeadChaCha20Poly1305;` where rawData is HKDF output of a freshly generated key (tls13_MaybeGreaseEch, called from ssl3con.c:5888 for every ClientHello that has no real ECH, with or without a pre_shared_key). 1 (AES-128-GCM) or 3 (ChaCha20-Poly1305): Windows h2 first connection 1 then 3, h1 3 then 1, both values inside one run; resumed h1 connections 3 and 1 (seeds 2 and 4 on Windows, seed 63 on Linux). The rest of the extension (type, kdf, enc and payload lengths) stays compared.",
"aa_run": "44946411675 and 44982522362 (linux, windows)"
},
{
"pattern": "seeds/*/h3/wire/*connections/*/tls/extensions/encrypted_client_hello/aead",
"reason": "The same ECH GREASE draw (tls13ech.c:2257) on the TLS connection of the HTTP/3 site (the HTTP/2 connection that opens before QUIC): 1 in one run and 3 in the other, on Linux and on Windows.",
"aa_run": "44946411675 and 44982522362 (linux, windows)"
}
]
}
+749
View File
@@ -0,0 +1,749 @@
{
"format": "ab-oracle-expected/1",
"differences": [
{
"id": "linux-seed6-state.after_fullscreen.events.mousemove",
"os": "linux",
"seed": 6,
"dpr": 1.25,
"leaf": "state.after_fullscreen.events.mousemove",
"published": [
[
0,
86
],
[
0,
85
]
],
"candidate": [
[
0,
85
],
[
0,
84
]
],
"reason": "Seed 6 is at 1.25. The bar of a main window, client top to content top, is 106 device px in retail Firefox 159 on Windows, measured by the core's retail window-geometry capture workflow (rounds 2 and 3, runs 45672953042 and 45679625406), not the 107 that the published engine's core declares; the candidate's core computes it with window_frame.chrome_height_device(1.25, 'normal'), which rounds the tab strip, the nav bar and the content border once, on the sum in app units (_offset_device), and the page gets 106 device px = 84.8 CSS px. This leaf: the distinct (screenY - clientY) that a mousemove event of the page was seen with, in CSS px: the bar above the content as the page reads it from a pointer event."
},
{
"id": "linux-seed6-state.after_fullscreen.innerHeight",
"os": "linux",
"seed": 6,
"dpr": 1.25,
"leaf": "state.after_fullscreen.innerHeight",
"published": 730,
"candidate": 731,
"reason": "Seed 6 is at 1.25. The bar of a main window, client top to content top, is 106 device px in retail Firefox 159 on Windows, measured by the core's retail window-geometry capture workflow (rounds 2 and 3, runs 45672953042 and 45679625406), not the 107 that the published engine's core declares; the candidate's core computes it with window_frame.chrome_height_device(1.25, 'normal'), which rounds the tab strip, the nav bar and the content border once, on the sum in app units (_offset_device), and the page gets 106 device px = 84.8 CSS px. This leaf: window.innerHeight, the viewport height in CSS px."
},
{
"id": "linux-seed6-state.after_fullscreen.mozInnerScreenY",
"os": "linux",
"seed": 6,
"dpr": 1.25,
"leaf": "state.after_fullscreen.mozInnerScreenY",
"published": 85.5999984741211,
"candidate": 84.80000305175781,
"reason": "Seed 6 is at 1.25. The bar of a main window, client top to content top, is 106 device px in retail Firefox 159 on Windows, measured by the core's retail window-geometry capture workflow (rounds 2 and 3, runs 45672953042 and 45679625406), not the 107 that the published engine's core declares; the candidate's core computes it with window_frame.chrome_height_device(1.25, 'normal'), which rounds the tab strip, the nav bar and the content border once, on the sum in app units (_offset_device), and the page gets 106 device px = 84.8 CSS px. This leaf: window.mozInnerScreenY, the screen Y of the content's top in CSS px (the bar above the content)."
},
{
"id": "linux-seed6-state.normal.events.mousemove",
"os": "linux",
"seed": 6,
"dpr": 1.25,
"leaf": "state.normal.events.mousemove",
"published": [
[
0,
86
],
[
0,
85
]
],
"candidate": [
[
0,
85
],
[
0,
84
]
],
"reason": "Seed 6 is at 1.25. The bar of a main window, client top to content top, is 106 device px in retail Firefox 159 on Windows, measured by the core's retail window-geometry capture workflow (rounds 2 and 3, runs 45672953042 and 45679625406), not the 107 that the published engine's core declares; the candidate's core computes it with window_frame.chrome_height_device(1.25, 'normal'), which rounds the tab strip, the nav bar and the content border once, on the sum in app units (_offset_device), and the page gets 106 device px = 84.8 CSS px. This leaf: the distinct (screenY - clientY) that a mousemove event of the page was seen with, in CSS px: the bar above the content as the page reads it from a pointer event."
},
{
"id": "linux-seed6-state.normal.innerHeight",
"os": "linux",
"seed": 6,
"dpr": 1.25,
"leaf": "state.normal.innerHeight",
"published": 730,
"candidate": 731,
"reason": "Seed 6 is at 1.25. The bar of a main window, client top to content top, is 106 device px in retail Firefox 159 on Windows, measured by the core's retail window-geometry capture workflow (rounds 2 and 3, runs 45672953042 and 45679625406), not the 107 that the published engine's core declares; the candidate's core computes it with window_frame.chrome_height_device(1.25, 'normal'), which rounds the tab strip, the nav bar and the content border once, on the sum in app units (_offset_device), and the page gets 106 device px = 84.8 CSS px. This leaf: window.innerHeight, the viewport height in CSS px."
},
{
"id": "linux-seed6-state.normal.mozInnerScreenY",
"os": "linux",
"seed": 6,
"dpr": 1.25,
"leaf": "state.normal.mozInnerScreenY",
"published": 85.5999984741211,
"candidate": 84.80000305175781,
"reason": "Seed 6 is at 1.25. The bar of a main window, client top to content top, is 106 device px in retail Firefox 159 on Windows, measured by the core's retail window-geometry capture workflow (rounds 2 and 3, runs 45672953042 and 45679625406), not the 107 that the published engine's core declares; the candidate's core computes it with window_frame.chrome_height_device(1.25, 'normal'), which rounds the tab strip, the nav bar and the content border once, on the sum in app units (_offset_device), and the page gets 106 device px = 84.8 CSS px. This leaf: window.mozInnerScreenY, the screen Y of the content's top in CSS px (the bar above the content)."
},
{
"id": "linux-seed6-surface.visualViewport.height",
"os": "linux",
"seed": 6,
"dpr": 1.25,
"leaf": "surface.visualViewport.height",
"published": 730.4000244140625,
"candidate": 731.2000122070312,
"reason": "Seed 6 is at 1.25. The bar of a main window, client top to content top, is 106 device px in retail Firefox 159 on Windows, measured by the core's retail window-geometry capture workflow (rounds 2 and 3, runs 45672953042 and 45679625406), not the 107 that the published engine's core declares; the candidate's core computes it with window_frame.chrome_height_device(1.25, 'normal'), which rounds the tab strip, the nav bar and the content border once, on the sum in app units (_offset_device), and the page gets 106 device px = 84.8 CSS px. This leaf: visualViewport.height, the viewport height in CSS px."
},
{
"id": "linux-seed6-surface.window.innerHeight",
"os": "linux",
"seed": 6,
"dpr": 1.25,
"leaf": "surface.window.innerHeight",
"published": 730,
"candidate": 731,
"reason": "Seed 6 is at 1.25. The bar of a main window, client top to content top, is 106 device px in retail Firefox 159 on Windows, measured by the core's retail window-geometry capture workflow (rounds 2 and 3, runs 45672953042 and 45679625406), not the 107 that the published engine's core declares; the candidate's core computes it with window_frame.chrome_height_device(1.25, 'normal'), which rounds the tab strip, the nav bar and the content border once, on the sum in app units (_offset_device), and the page gets 106 device px = 84.8 CSS px. This leaf: window.innerHeight, the viewport height in CSS px."
},
{
"id": "linux-seed6-surface.window.mozInnerScreenY",
"os": "linux",
"seed": 6,
"dpr": 1.25,
"leaf": "surface.window.mozInnerScreenY",
"published": 85.5999984741211,
"candidate": 84.80000305175781,
"reason": "Seed 6 is at 1.25. The bar of a main window, client top to content top, is 106 device px in retail Firefox 159 on Windows, measured by the core's retail window-geometry capture workflow (rounds 2 and 3, runs 45672953042 and 45679625406), not the 107 that the published engine's core declares; the candidate's core computes it with window_frame.chrome_height_device(1.25, 'normal'), which rounds the tab strip, the nav bar and the content border once, on the sum in app units (_offset_device), and the page gets 106 device px = 84.8 CSS px. This leaf: window.mozInnerScreenY, the screen Y of the content's top in CSS px (the bar above the content)."
},
{
"id": "linux-seed63-state.after_fullscreen.events.click",
"os": "linux",
"seed": 63,
"dpr": 1.5,
"leaf": "state.after_fullscreen.events.click",
"published": [
[
0,
85
]
],
"candidate": [
[
0,
73
]
],
"reason": "Seed 63 is at 1.5, and the work area of its screen is under 720 CSS px high (about 693 on a 1920x1080 panel), so retail Firefox 159 chooses the compact density by itself (browser.js gUIDensity: compact while 36 CSS px over the reference height is more than browser.compactmode.auto.threshold 0.05, that is below 720 CSS px; RetailCaptures analysis/window-geometry/chrome-density; retail Firefox 159 on Windows, measured by the core's retail window-geometry capture workflow (rounds 2 and 3, runs 45672953042 and 45679625406)). The bar is the compact 109 device px = 73 CSS px, not the normal 127 device px = 85 CSS px that the published engine's core declares: the core's constants.ui_density and declared_maximized_ui pick the density, window_frame.chrome_height_device(1.5, 'compact') gives the bar. This leaf: the distinct (screenY - clientY) that a click event of the page was seen with, in CSS px: the bar above the content as the page reads it from a pointer event."
},
{
"id": "linux-seed63-state.after_fullscreen.events.mousedown",
"os": "linux",
"seed": 63,
"dpr": 1.5,
"leaf": "state.after_fullscreen.events.mousedown",
"published": [
[
0,
85
]
],
"candidate": [
[
0,
73
]
],
"reason": "Seed 63 is at 1.5, and the work area of its screen is under 720 CSS px high (about 693 on a 1920x1080 panel), so retail Firefox 159 chooses the compact density by itself (browser.js gUIDensity: compact while 36 CSS px over the reference height is more than browser.compactmode.auto.threshold 0.05, that is below 720 CSS px; RetailCaptures analysis/window-geometry/chrome-density; retail Firefox 159 on Windows, measured by the core's retail window-geometry capture workflow (rounds 2 and 3, runs 45672953042 and 45679625406)). The bar is the compact 109 device px = 73 CSS px, not the normal 127 device px = 85 CSS px that the published engine's core declares: the core's constants.ui_density and declared_maximized_ui pick the density, window_frame.chrome_height_device(1.5, 'compact') gives the bar. This leaf: the distinct (screenY - clientY) that a mousedown event of the page was seen with, in CSS px: the bar above the content as the page reads it from a pointer event."
},
{
"id": "linux-seed63-state.after_fullscreen.events.mousemove",
"os": "linux",
"seed": 63,
"dpr": 1.5,
"leaf": "state.after_fullscreen.events.mousemove",
"published": [
[
0,
85
],
[
0,
84
]
],
"candidate": [
[
0,
73
],
[
0,
72
]
],
"reason": "Seed 63 is at 1.5, and the work area of its screen is under 720 CSS px high (about 693 on a 1920x1080 panel), so retail Firefox 159 chooses the compact density by itself (browser.js gUIDensity: compact while 36 CSS px over the reference height is more than browser.compactmode.auto.threshold 0.05, that is below 720 CSS px; RetailCaptures analysis/window-geometry/chrome-density; retail Firefox 159 on Windows, measured by the core's retail window-geometry capture workflow (rounds 2 and 3, runs 45672953042 and 45679625406)). The bar is the compact 109 device px = 73 CSS px, not the normal 127 device px = 85 CSS px that the published engine's core declares: the core's constants.ui_density and declared_maximized_ui pick the density, window_frame.chrome_height_device(1.5, 'compact') gives the bar. This leaf: the distinct (screenY - clientY) that a mousemove event of the page was seen with, in CSS px: the bar above the content as the page reads it from a pointer event."
},
{
"id": "linux-seed63-state.after_fullscreen.events.mouseup",
"os": "linux",
"seed": 63,
"dpr": 1.5,
"leaf": "state.after_fullscreen.events.mouseup",
"published": [
[
0,
85
]
],
"candidate": [
[
0,
73
]
],
"reason": "Seed 63 is at 1.5, and the work area of its screen is under 720 CSS px high (about 693 on a 1920x1080 panel), so retail Firefox 159 chooses the compact density by itself (browser.js gUIDensity: compact while 36 CSS px over the reference height is more than browser.compactmode.auto.threshold 0.05, that is below 720 CSS px; RetailCaptures analysis/window-geometry/chrome-density; retail Firefox 159 on Windows, measured by the core's retail window-geometry capture workflow (rounds 2 and 3, runs 45672953042 and 45679625406)). The bar is the compact 109 device px = 73 CSS px, not the normal 127 device px = 85 CSS px that the published engine's core declares: the core's constants.ui_density and declared_maximized_ui pick the density, window_frame.chrome_height_device(1.5, 'compact') gives the bar. This leaf: the distinct (screenY - clientY) that a mouseup event of the page was seen with, in CSS px: the bar above the content as the page reads it from a pointer event."
},
{
"id": "linux-seed63-state.after_fullscreen.innerHeight",
"os": "linux",
"seed": 63,
"dpr": 1.5,
"leaf": "state.after_fullscreen.innerHeight",
"published": 587,
"candidate": 599,
"reason": "Seed 63 is at 1.5, and the work area of its screen is under 720 CSS px high (about 693 on a 1920x1080 panel), so retail Firefox 159 chooses the compact density by itself (browser.js gUIDensity: compact while 36 CSS px over the reference height is more than browser.compactmode.auto.threshold 0.05, that is below 720 CSS px; RetailCaptures analysis/window-geometry/chrome-density; retail Firefox 159 on Windows, measured by the core's retail window-geometry capture workflow (rounds 2 and 3, runs 45672953042 and 45679625406)). The bar is the compact 109 device px = 73 CSS px, not the normal 127 device px = 85 CSS px that the published engine's core declares: the core's constants.ui_density and declared_maximized_ui pick the density, window_frame.chrome_height_device(1.5, 'compact') gives the bar. This leaf: window.innerHeight, the viewport height in CSS px."
},
{
"id": "linux-seed63-state.after_fullscreen.mozInnerScreenY",
"os": "linux",
"seed": 63,
"dpr": 1.5,
"leaf": "state.after_fullscreen.mozInnerScreenY",
"published": 84.66666412353516,
"candidate": 72.66666412353516,
"reason": "Seed 63 is at 1.5, and the work area of its screen is under 720 CSS px high (about 693 on a 1920x1080 panel), so retail Firefox 159 chooses the compact density by itself (browser.js gUIDensity: compact while 36 CSS px over the reference height is more than browser.compactmode.auto.threshold 0.05, that is below 720 CSS px; RetailCaptures analysis/window-geometry/chrome-density; retail Firefox 159 on Windows, measured by the core's retail window-geometry capture workflow (rounds 2 and 3, runs 45672953042 and 45679625406)). The bar is the compact 109 device px = 73 CSS px, not the normal 127 device px = 85 CSS px that the published engine's core declares: the core's constants.ui_density and declared_maximized_ui pick the density, window_frame.chrome_height_device(1.5, 'compact') gives the bar. This leaf: window.mozInnerScreenY, the screen Y of the content's top in CSS px (the bar above the content)."
},
{
"id": "linux-seed63-state.normal.events.click",
"os": "linux",
"seed": 63,
"dpr": 1.5,
"leaf": "state.normal.events.click",
"published": [
[
0,
85
]
],
"candidate": [
[
0,
73
]
],
"reason": "Seed 63 is at 1.5, and the work area of its screen is under 720 CSS px high (about 693 on a 1920x1080 panel), so retail Firefox 159 chooses the compact density by itself (browser.js gUIDensity: compact while 36 CSS px over the reference height is more than browser.compactmode.auto.threshold 0.05, that is below 720 CSS px; RetailCaptures analysis/window-geometry/chrome-density; retail Firefox 159 on Windows, measured by the core's retail window-geometry capture workflow (rounds 2 and 3, runs 45672953042 and 45679625406)). The bar is the compact 109 device px = 73 CSS px, not the normal 127 device px = 85 CSS px that the published engine's core declares: the core's constants.ui_density and declared_maximized_ui pick the density, window_frame.chrome_height_device(1.5, 'compact') gives the bar. This leaf: the distinct (screenY - clientY) that a click event of the page was seen with, in CSS px: the bar above the content as the page reads it from a pointer event."
},
{
"id": "linux-seed63-state.normal.events.mousedown",
"os": "linux",
"seed": 63,
"dpr": 1.5,
"leaf": "state.normal.events.mousedown",
"published": [
[
0,
85
]
],
"candidate": [
[
0,
73
]
],
"reason": "Seed 63 is at 1.5, and the work area of its screen is under 720 CSS px high (about 693 on a 1920x1080 panel), so retail Firefox 159 chooses the compact density by itself (browser.js gUIDensity: compact while 36 CSS px over the reference height is more than browser.compactmode.auto.threshold 0.05, that is below 720 CSS px; RetailCaptures analysis/window-geometry/chrome-density; retail Firefox 159 on Windows, measured by the core's retail window-geometry capture workflow (rounds 2 and 3, runs 45672953042 and 45679625406)). The bar is the compact 109 device px = 73 CSS px, not the normal 127 device px = 85 CSS px that the published engine's core declares: the core's constants.ui_density and declared_maximized_ui pick the density, window_frame.chrome_height_device(1.5, 'compact') gives the bar. This leaf: the distinct (screenY - clientY) that a mousedown event of the page was seen with, in CSS px: the bar above the content as the page reads it from a pointer event."
},
{
"id": "linux-seed63-state.normal.events.mousemove",
"os": "linux",
"seed": 63,
"dpr": 1.5,
"leaf": "state.normal.events.mousemove",
"published": [
[
0,
85
],
[
0,
84
]
],
"candidate": [
[
0,
72
],
[
0,
73
]
],
"reason": "Seed 63 is at 1.5, and the work area of its screen is under 720 CSS px high (about 693 on a 1920x1080 panel), so retail Firefox 159 chooses the compact density by itself (browser.js gUIDensity: compact while 36 CSS px over the reference height is more than browser.compactmode.auto.threshold 0.05, that is below 720 CSS px; RetailCaptures analysis/window-geometry/chrome-density; retail Firefox 159 on Windows, measured by the core's retail window-geometry capture workflow (rounds 2 and 3, runs 45672953042 and 45679625406)). The bar is the compact 109 device px = 73 CSS px, not the normal 127 device px = 85 CSS px that the published engine's core declares: the core's constants.ui_density and declared_maximized_ui pick the density, window_frame.chrome_height_device(1.5, 'compact') gives the bar. This leaf: the distinct (screenY - clientY) that a mousemove event of the page was seen with, in CSS px: the bar above the content as the page reads it from a pointer event."
},
{
"id": "linux-seed63-state.normal.events.mouseup",
"os": "linux",
"seed": 63,
"dpr": 1.5,
"leaf": "state.normal.events.mouseup",
"published": [
[
0,
85
]
],
"candidate": [
[
0,
73
]
],
"reason": "Seed 63 is at 1.5, and the work area of its screen is under 720 CSS px high (about 693 on a 1920x1080 panel), so retail Firefox 159 chooses the compact density by itself (browser.js gUIDensity: compact while 36 CSS px over the reference height is more than browser.compactmode.auto.threshold 0.05, that is below 720 CSS px; RetailCaptures analysis/window-geometry/chrome-density; retail Firefox 159 on Windows, measured by the core's retail window-geometry capture workflow (rounds 2 and 3, runs 45672953042 and 45679625406)). The bar is the compact 109 device px = 73 CSS px, not the normal 127 device px = 85 CSS px that the published engine's core declares: the core's constants.ui_density and declared_maximized_ui pick the density, window_frame.chrome_height_device(1.5, 'compact') gives the bar. This leaf: the distinct (screenY - clientY) that a mouseup event of the page was seen with, in CSS px: the bar above the content as the page reads it from a pointer event."
},
{
"id": "linux-seed63-state.normal.innerHeight",
"os": "linux",
"seed": 63,
"dpr": 1.5,
"leaf": "state.normal.innerHeight",
"published": 587,
"candidate": 599,
"reason": "Seed 63 is at 1.5, and the work area of its screen is under 720 CSS px high (about 693 on a 1920x1080 panel), so retail Firefox 159 chooses the compact density by itself (browser.js gUIDensity: compact while 36 CSS px over the reference height is more than browser.compactmode.auto.threshold 0.05, that is below 720 CSS px; RetailCaptures analysis/window-geometry/chrome-density; retail Firefox 159 on Windows, measured by the core's retail window-geometry capture workflow (rounds 2 and 3, runs 45672953042 and 45679625406)). The bar is the compact 109 device px = 73 CSS px, not the normal 127 device px = 85 CSS px that the published engine's core declares: the core's constants.ui_density and declared_maximized_ui pick the density, window_frame.chrome_height_device(1.5, 'compact') gives the bar. This leaf: window.innerHeight, the viewport height in CSS px."
},
{
"id": "linux-seed63-state.normal.mozInnerScreenY",
"os": "linux",
"seed": 63,
"dpr": 1.5,
"leaf": "state.normal.mozInnerScreenY",
"published": 84.66666412353516,
"candidate": 72.66666412353516,
"reason": "Seed 63 is at 1.5, and the work area of its screen is under 720 CSS px high (about 693 on a 1920x1080 panel), so retail Firefox 159 chooses the compact density by itself (browser.js gUIDensity: compact while 36 CSS px over the reference height is more than browser.compactmode.auto.threshold 0.05, that is below 720 CSS px; RetailCaptures analysis/window-geometry/chrome-density; retail Firefox 159 on Windows, measured by the core's retail window-geometry capture workflow (rounds 2 and 3, runs 45672953042 and 45679625406)). The bar is the compact 109 device px = 73 CSS px, not the normal 127 device px = 85 CSS px that the published engine's core declares: the core's constants.ui_density and declared_maximized_ui pick the density, window_frame.chrome_height_device(1.5, 'compact') gives the bar. This leaf: window.mozInnerScreenY, the screen Y of the content's top in CSS px (the bar above the content)."
},
{
"id": "linux-seed63-surface.visualViewport.height",
"os": "linux",
"seed": 63,
"dpr": 1.5,
"leaf": "surface.visualViewport.height",
"published": 587.3333129882812,
"candidate": 599.3333129882812,
"reason": "Seed 63 is at 1.5, and the work area of its screen is under 720 CSS px high (about 693 on a 1920x1080 panel), so retail Firefox 159 chooses the compact density by itself (browser.js gUIDensity: compact while 36 CSS px over the reference height is more than browser.compactmode.auto.threshold 0.05, that is below 720 CSS px; RetailCaptures analysis/window-geometry/chrome-density; retail Firefox 159 on Windows, measured by the core's retail window-geometry capture workflow (rounds 2 and 3, runs 45672953042 and 45679625406)). The bar is the compact 109 device px = 73 CSS px, not the normal 127 device px = 85 CSS px that the published engine's core declares: the core's constants.ui_density and declared_maximized_ui pick the density, window_frame.chrome_height_device(1.5, 'compact') gives the bar. This leaf: visualViewport.height, the viewport height in CSS px."
},
{
"id": "linux-seed63-surface.window.innerHeight",
"os": "linux",
"seed": 63,
"dpr": 1.5,
"leaf": "surface.window.innerHeight",
"published": 587,
"candidate": 599,
"reason": "Seed 63 is at 1.5, and the work area of its screen is under 720 CSS px high (about 693 on a 1920x1080 panel), so retail Firefox 159 chooses the compact density by itself (browser.js gUIDensity: compact while 36 CSS px over the reference height is more than browser.compactmode.auto.threshold 0.05, that is below 720 CSS px; RetailCaptures analysis/window-geometry/chrome-density; retail Firefox 159 on Windows, measured by the core's retail window-geometry capture workflow (rounds 2 and 3, runs 45672953042 and 45679625406)). The bar is the compact 109 device px = 73 CSS px, not the normal 127 device px = 85 CSS px that the published engine's core declares: the core's constants.ui_density and declared_maximized_ui pick the density, window_frame.chrome_height_device(1.5, 'compact') gives the bar. This leaf: window.innerHeight, the viewport height in CSS px."
},
{
"id": "linux-seed63-surface.window.mozInnerScreenY",
"os": "linux",
"seed": 63,
"dpr": 1.5,
"leaf": "surface.window.mozInnerScreenY",
"published": 84.66666412353516,
"candidate": 72.66666412353516,
"reason": "Seed 63 is at 1.5, and the work area of its screen is under 720 CSS px high (about 693 on a 1920x1080 panel), so retail Firefox 159 chooses the compact density by itself (browser.js gUIDensity: compact while 36 CSS px over the reference height is more than browser.compactmode.auto.threshold 0.05, that is below 720 CSS px; RetailCaptures analysis/window-geometry/chrome-density; retail Firefox 159 on Windows, measured by the core's retail window-geometry capture workflow (rounds 2 and 3, runs 45672953042 and 45679625406)). The bar is the compact 109 device px = 73 CSS px, not the normal 127 device px = 85 CSS px that the published engine's core declares: the core's constants.ui_density and declared_maximized_ui pick the density, window_frame.chrome_height_device(1.5, 'compact') gives the bar. This leaf: window.mozInnerScreenY, the screen Y of the content's top in CSS px (the bar above the content)."
},
{
"id": "windows-seed6-state.after_fullscreen.events.mousemove",
"os": "windows",
"seed": 6,
"dpr": 1.25,
"leaf": "state.after_fullscreen.events.mousemove",
"published": [
[
0,
86
],
[
0,
85
]
],
"candidate": [
[
0,
85
],
[
0,
84
]
],
"reason": "Seed 6 is at 1.25. The bar of a main window, client top to content top, is 106 device px in retail Firefox 159 on Windows, measured by the core's retail window-geometry capture workflow (rounds 2 and 3, runs 45672953042 and 45679625406), not the 107 that the published engine's core declares; the candidate's core computes it with window_frame.chrome_height_device(1.25, 'normal'), which rounds the tab strip, the nav bar and the content border once, on the sum in app units (_offset_device), and the page gets 106 device px = 84.8 CSS px. This leaf: the distinct (screenY - clientY) that a mousemove event of the page was seen with, in CSS px: the bar above the content as the page reads it from a pointer event."
},
{
"id": "windows-seed6-state.after_fullscreen.innerHeight",
"os": "windows",
"seed": 6,
"dpr": 1.25,
"leaf": "state.after_fullscreen.innerHeight",
"published": 730,
"candidate": 731,
"reason": "Seed 6 is at 1.25. The bar of a main window, client top to content top, is 106 device px in retail Firefox 159 on Windows, measured by the core's retail window-geometry capture workflow (rounds 2 and 3, runs 45672953042 and 45679625406), not the 107 that the published engine's core declares; the candidate's core computes it with window_frame.chrome_height_device(1.25, 'normal'), which rounds the tab strip, the nav bar and the content border once, on the sum in app units (_offset_device), and the page gets 106 device px = 84.8 CSS px. This leaf: window.innerHeight, the viewport height in CSS px."
},
{
"id": "windows-seed6-state.after_fullscreen.mozInnerScreenY",
"os": "windows",
"seed": 6,
"dpr": 1.25,
"leaf": "state.after_fullscreen.mozInnerScreenY",
"published": 85.5999984741211,
"candidate": 84.80000305175781,
"reason": "Seed 6 is at 1.25. The bar of a main window, client top to content top, is 106 device px in retail Firefox 159 on Windows, measured by the core's retail window-geometry capture workflow (rounds 2 and 3, runs 45672953042 and 45679625406), not the 107 that the published engine's core declares; the candidate's core computes it with window_frame.chrome_height_device(1.25, 'normal'), which rounds the tab strip, the nav bar and the content border once, on the sum in app units (_offset_device), and the page gets 106 device px = 84.8 CSS px. This leaf: window.mozInnerScreenY, the screen Y of the content's top in CSS px (the bar above the content)."
},
{
"id": "windows-seed6-state.normal.events.mousemove",
"os": "windows",
"seed": 6,
"dpr": 1.25,
"leaf": "state.normal.events.mousemove",
"published": [
[
0,
86
],
[
0,
85
]
],
"candidate": [
[
0,
85
],
[
0,
84
]
],
"reason": "Seed 6 is at 1.25. The bar of a main window, client top to content top, is 106 device px in retail Firefox 159 on Windows, measured by the core's retail window-geometry capture workflow (rounds 2 and 3, runs 45672953042 and 45679625406), not the 107 that the published engine's core declares; the candidate's core computes it with window_frame.chrome_height_device(1.25, 'normal'), which rounds the tab strip, the nav bar and the content border once, on the sum in app units (_offset_device), and the page gets 106 device px = 84.8 CSS px. This leaf: the distinct (screenY - clientY) that a mousemove event of the page was seen with, in CSS px: the bar above the content as the page reads it from a pointer event."
},
{
"id": "windows-seed6-state.normal.innerHeight",
"os": "windows",
"seed": 6,
"dpr": 1.25,
"leaf": "state.normal.innerHeight",
"published": 730,
"candidate": 731,
"reason": "Seed 6 is at 1.25. The bar of a main window, client top to content top, is 106 device px in retail Firefox 159 on Windows, measured by the core's retail window-geometry capture workflow (rounds 2 and 3, runs 45672953042 and 45679625406), not the 107 that the published engine's core declares; the candidate's core computes it with window_frame.chrome_height_device(1.25, 'normal'), which rounds the tab strip, the nav bar and the content border once, on the sum in app units (_offset_device), and the page gets 106 device px = 84.8 CSS px. This leaf: window.innerHeight, the viewport height in CSS px."
},
{
"id": "windows-seed6-state.normal.mozInnerScreenY",
"os": "windows",
"seed": 6,
"dpr": 1.25,
"leaf": "state.normal.mozInnerScreenY",
"published": 85.5999984741211,
"candidate": 84.80000305175781,
"reason": "Seed 6 is at 1.25. The bar of a main window, client top to content top, is 106 device px in retail Firefox 159 on Windows, measured by the core's retail window-geometry capture workflow (rounds 2 and 3, runs 45672953042 and 45679625406), not the 107 that the published engine's core declares; the candidate's core computes it with window_frame.chrome_height_device(1.25, 'normal'), which rounds the tab strip, the nav bar and the content border once, on the sum in app units (_offset_device), and the page gets 106 device px = 84.8 CSS px. This leaf: window.mozInnerScreenY, the screen Y of the content's top in CSS px (the bar above the content)."
},
{
"id": "windows-seed6-surface.visualViewport.height",
"os": "windows",
"seed": 6,
"dpr": 1.25,
"leaf": "surface.visualViewport.height",
"published": 730.4000244140625,
"candidate": 731.2000122070312,
"reason": "Seed 6 is at 1.25. The bar of a main window, client top to content top, is 106 device px in retail Firefox 159 on Windows, measured by the core's retail window-geometry capture workflow (rounds 2 and 3, runs 45672953042 and 45679625406), not the 107 that the published engine's core declares; the candidate's core computes it with window_frame.chrome_height_device(1.25, 'normal'), which rounds the tab strip, the nav bar and the content border once, on the sum in app units (_offset_device), and the page gets 106 device px = 84.8 CSS px. This leaf: visualViewport.height, the viewport height in CSS px."
},
{
"id": "windows-seed6-surface.window.innerHeight",
"os": "windows",
"seed": 6,
"dpr": 1.25,
"leaf": "surface.window.innerHeight",
"published": 730,
"candidate": 731,
"reason": "Seed 6 is at 1.25. The bar of a main window, client top to content top, is 106 device px in retail Firefox 159 on Windows, measured by the core's retail window-geometry capture workflow (rounds 2 and 3, runs 45672953042 and 45679625406), not the 107 that the published engine's core declares; the candidate's core computes it with window_frame.chrome_height_device(1.25, 'normal'), which rounds the tab strip, the nav bar and the content border once, on the sum in app units (_offset_device), and the page gets 106 device px = 84.8 CSS px. This leaf: window.innerHeight, the viewport height in CSS px."
},
{
"id": "windows-seed6-surface.window.mozInnerScreenY",
"os": "windows",
"seed": 6,
"dpr": 1.25,
"leaf": "surface.window.mozInnerScreenY",
"published": 85.5999984741211,
"candidate": 84.80000305175781,
"reason": "Seed 6 is at 1.25. The bar of a main window, client top to content top, is 106 device px in retail Firefox 159 on Windows, measured by the core's retail window-geometry capture workflow (rounds 2 and 3, runs 45672953042 and 45679625406), not the 107 that the published engine's core declares; the candidate's core computes it with window_frame.chrome_height_device(1.25, 'normal'), which rounds the tab strip, the nav bar and the content border once, on the sum in app units (_offset_device), and the page gets 106 device px = 84.8 CSS px. This leaf: window.mozInnerScreenY, the screen Y of the content's top in CSS px (the bar above the content)."
},
{
"id": "windows-seed63-state.after_fullscreen.events.click",
"os": "windows",
"seed": 63,
"dpr": 1.5,
"leaf": "state.after_fullscreen.events.click",
"published": [
[
0,
85
]
],
"candidate": [
[
0,
73
]
],
"reason": "Seed 63 is at 1.5, and the work area of its screen is under 720 CSS px high (about 693 on a 1920x1080 panel), so retail Firefox 159 chooses the compact density by itself (browser.js gUIDensity: compact while 36 CSS px over the reference height is more than browser.compactmode.auto.threshold 0.05, that is below 720 CSS px; RetailCaptures analysis/window-geometry/chrome-density; retail Firefox 159 on Windows, measured by the core's retail window-geometry capture workflow (rounds 2 and 3, runs 45672953042 and 45679625406)). The bar is the compact 109 device px = 73 CSS px, not the normal 127 device px = 85 CSS px that the published engine's core declares: the core's constants.ui_density and declared_maximized_ui pick the density, window_frame.chrome_height_device(1.5, 'compact') gives the bar. This leaf: the distinct (screenY - clientY) that a click event of the page was seen with, in CSS px: the bar above the content as the page reads it from a pointer event."
},
{
"id": "windows-seed63-state.after_fullscreen.events.mousedown",
"os": "windows",
"seed": 63,
"dpr": 1.5,
"leaf": "state.after_fullscreen.events.mousedown",
"published": [
[
0,
85
]
],
"candidate": [
[
0,
73
]
],
"reason": "Seed 63 is at 1.5, and the work area of its screen is under 720 CSS px high (about 693 on a 1920x1080 panel), so retail Firefox 159 chooses the compact density by itself (browser.js gUIDensity: compact while 36 CSS px over the reference height is more than browser.compactmode.auto.threshold 0.05, that is below 720 CSS px; RetailCaptures analysis/window-geometry/chrome-density; retail Firefox 159 on Windows, measured by the core's retail window-geometry capture workflow (rounds 2 and 3, runs 45672953042 and 45679625406)). The bar is the compact 109 device px = 73 CSS px, not the normal 127 device px = 85 CSS px that the published engine's core declares: the core's constants.ui_density and declared_maximized_ui pick the density, window_frame.chrome_height_device(1.5, 'compact') gives the bar. This leaf: the distinct (screenY - clientY) that a mousedown event of the page was seen with, in CSS px: the bar above the content as the page reads it from a pointer event."
},
{
"id": "windows-seed63-state.after_fullscreen.events.mousemove",
"os": "windows",
"seed": 63,
"dpr": 1.5,
"leaf": "state.after_fullscreen.events.mousemove",
"published": [
[
0,
85
],
[
0,
84
]
],
"candidate": [
[
0,
73
],
[
0,
72
]
],
"reason": "Seed 63 is at 1.5, and the work area of its screen is under 720 CSS px high (about 693 on a 1920x1080 panel), so retail Firefox 159 chooses the compact density by itself (browser.js gUIDensity: compact while 36 CSS px over the reference height is more than browser.compactmode.auto.threshold 0.05, that is below 720 CSS px; RetailCaptures analysis/window-geometry/chrome-density; retail Firefox 159 on Windows, measured by the core's retail window-geometry capture workflow (rounds 2 and 3, runs 45672953042 and 45679625406)). The bar is the compact 109 device px = 73 CSS px, not the normal 127 device px = 85 CSS px that the published engine's core declares: the core's constants.ui_density and declared_maximized_ui pick the density, window_frame.chrome_height_device(1.5, 'compact') gives the bar. This leaf: the distinct (screenY - clientY) that a mousemove event of the page was seen with, in CSS px: the bar above the content as the page reads it from a pointer event."
},
{
"id": "windows-seed63-state.after_fullscreen.events.mouseup",
"os": "windows",
"seed": 63,
"dpr": 1.5,
"leaf": "state.after_fullscreen.events.mouseup",
"published": [
[
0,
85
]
],
"candidate": [
[
0,
73
]
],
"reason": "Seed 63 is at 1.5, and the work area of its screen is under 720 CSS px high (about 693 on a 1920x1080 panel), so retail Firefox 159 chooses the compact density by itself (browser.js gUIDensity: compact while 36 CSS px over the reference height is more than browser.compactmode.auto.threshold 0.05, that is below 720 CSS px; RetailCaptures analysis/window-geometry/chrome-density; retail Firefox 159 on Windows, measured by the core's retail window-geometry capture workflow (rounds 2 and 3, runs 45672953042 and 45679625406)). The bar is the compact 109 device px = 73 CSS px, not the normal 127 device px = 85 CSS px that the published engine's core declares: the core's constants.ui_density and declared_maximized_ui pick the density, window_frame.chrome_height_device(1.5, 'compact') gives the bar. This leaf: the distinct (screenY - clientY) that a mouseup event of the page was seen with, in CSS px: the bar above the content as the page reads it from a pointer event."
},
{
"id": "windows-seed63-state.after_fullscreen.innerHeight",
"os": "windows",
"seed": 63,
"dpr": 1.5,
"leaf": "state.after_fullscreen.innerHeight",
"published": 587,
"candidate": 599,
"reason": "Seed 63 is at 1.5, and the work area of its screen is under 720 CSS px high (about 693 on a 1920x1080 panel), so retail Firefox 159 chooses the compact density by itself (browser.js gUIDensity: compact while 36 CSS px over the reference height is more than browser.compactmode.auto.threshold 0.05, that is below 720 CSS px; RetailCaptures analysis/window-geometry/chrome-density; retail Firefox 159 on Windows, measured by the core's retail window-geometry capture workflow (rounds 2 and 3, runs 45672953042 and 45679625406)). The bar is the compact 109 device px = 73 CSS px, not the normal 127 device px = 85 CSS px that the published engine's core declares: the core's constants.ui_density and declared_maximized_ui pick the density, window_frame.chrome_height_device(1.5, 'compact') gives the bar. This leaf: window.innerHeight, the viewport height in CSS px."
},
{
"id": "windows-seed63-state.after_fullscreen.mozInnerScreenY",
"os": "windows",
"seed": 63,
"dpr": 1.5,
"leaf": "state.after_fullscreen.mozInnerScreenY",
"published": 84.66666412353516,
"candidate": 72.66666412353516,
"reason": "Seed 63 is at 1.5, and the work area of its screen is under 720 CSS px high (about 693 on a 1920x1080 panel), so retail Firefox 159 chooses the compact density by itself (browser.js gUIDensity: compact while 36 CSS px over the reference height is more than browser.compactmode.auto.threshold 0.05, that is below 720 CSS px; RetailCaptures analysis/window-geometry/chrome-density; retail Firefox 159 on Windows, measured by the core's retail window-geometry capture workflow (rounds 2 and 3, runs 45672953042 and 45679625406)). The bar is the compact 109 device px = 73 CSS px, not the normal 127 device px = 85 CSS px that the published engine's core declares: the core's constants.ui_density and declared_maximized_ui pick the density, window_frame.chrome_height_device(1.5, 'compact') gives the bar. This leaf: window.mozInnerScreenY, the screen Y of the content's top in CSS px (the bar above the content)."
},
{
"id": "windows-seed63-state.normal.events.click",
"os": "windows",
"seed": 63,
"dpr": 1.5,
"leaf": "state.normal.events.click",
"published": [
[
0,
85
]
],
"candidate": [
[
0,
73
]
],
"reason": "Seed 63 is at 1.5, and the work area of its screen is under 720 CSS px high (about 693 on a 1920x1080 panel), so retail Firefox 159 chooses the compact density by itself (browser.js gUIDensity: compact while 36 CSS px over the reference height is more than browser.compactmode.auto.threshold 0.05, that is below 720 CSS px; RetailCaptures analysis/window-geometry/chrome-density; retail Firefox 159 on Windows, measured by the core's retail window-geometry capture workflow (rounds 2 and 3, runs 45672953042 and 45679625406)). The bar is the compact 109 device px = 73 CSS px, not the normal 127 device px = 85 CSS px that the published engine's core declares: the core's constants.ui_density and declared_maximized_ui pick the density, window_frame.chrome_height_device(1.5, 'compact') gives the bar. This leaf: the distinct (screenY - clientY) that a click event of the page was seen with, in CSS px: the bar above the content as the page reads it from a pointer event."
},
{
"id": "windows-seed63-state.normal.events.mousedown",
"os": "windows",
"seed": 63,
"dpr": 1.5,
"leaf": "state.normal.events.mousedown",
"published": [
[
0,
85
]
],
"candidate": [
[
0,
73
]
],
"reason": "Seed 63 is at 1.5, and the work area of its screen is under 720 CSS px high (about 693 on a 1920x1080 panel), so retail Firefox 159 chooses the compact density by itself (browser.js gUIDensity: compact while 36 CSS px over the reference height is more than browser.compactmode.auto.threshold 0.05, that is below 720 CSS px; RetailCaptures analysis/window-geometry/chrome-density; retail Firefox 159 on Windows, measured by the core's retail window-geometry capture workflow (rounds 2 and 3, runs 45672953042 and 45679625406)). The bar is the compact 109 device px = 73 CSS px, not the normal 127 device px = 85 CSS px that the published engine's core declares: the core's constants.ui_density and declared_maximized_ui pick the density, window_frame.chrome_height_device(1.5, 'compact') gives the bar. This leaf: the distinct (screenY - clientY) that a mousedown event of the page was seen with, in CSS px: the bar above the content as the page reads it from a pointer event."
},
{
"id": "windows-seed63-state.normal.events.mousemove",
"os": "windows",
"seed": 63,
"dpr": 1.5,
"leaf": "state.normal.events.mousemove",
"published": [
[
0,
85
],
[
0,
84
]
],
"candidate": [
[
0,
72
],
[
0,
73
]
],
"reason": "Seed 63 is at 1.5, and the work area of its screen is under 720 CSS px high (about 693 on a 1920x1080 panel), so retail Firefox 159 chooses the compact density by itself (browser.js gUIDensity: compact while 36 CSS px over the reference height is more than browser.compactmode.auto.threshold 0.05, that is below 720 CSS px; RetailCaptures analysis/window-geometry/chrome-density; retail Firefox 159 on Windows, measured by the core's retail window-geometry capture workflow (rounds 2 and 3, runs 45672953042 and 45679625406)). The bar is the compact 109 device px = 73 CSS px, not the normal 127 device px = 85 CSS px that the published engine's core declares: the core's constants.ui_density and declared_maximized_ui pick the density, window_frame.chrome_height_device(1.5, 'compact') gives the bar. This leaf: the distinct (screenY - clientY) that a mousemove event of the page was seen with, in CSS px: the bar above the content as the page reads it from a pointer event."
},
{
"id": "windows-seed63-state.normal.events.mouseup",
"os": "windows",
"seed": 63,
"dpr": 1.5,
"leaf": "state.normal.events.mouseup",
"published": [
[
0,
85
]
],
"candidate": [
[
0,
73
]
],
"reason": "Seed 63 is at 1.5, and the work area of its screen is under 720 CSS px high (about 693 on a 1920x1080 panel), so retail Firefox 159 chooses the compact density by itself (browser.js gUIDensity: compact while 36 CSS px over the reference height is more than browser.compactmode.auto.threshold 0.05, that is below 720 CSS px; RetailCaptures analysis/window-geometry/chrome-density; retail Firefox 159 on Windows, measured by the core's retail window-geometry capture workflow (rounds 2 and 3, runs 45672953042 and 45679625406)). The bar is the compact 109 device px = 73 CSS px, not the normal 127 device px = 85 CSS px that the published engine's core declares: the core's constants.ui_density and declared_maximized_ui pick the density, window_frame.chrome_height_device(1.5, 'compact') gives the bar. This leaf: the distinct (screenY - clientY) that a mouseup event of the page was seen with, in CSS px: the bar above the content as the page reads it from a pointer event."
},
{
"id": "windows-seed63-state.normal.innerHeight",
"os": "windows",
"seed": 63,
"dpr": 1.5,
"leaf": "state.normal.innerHeight",
"published": 587,
"candidate": 599,
"reason": "Seed 63 is at 1.5, and the work area of its screen is under 720 CSS px high (about 693 on a 1920x1080 panel), so retail Firefox 159 chooses the compact density by itself (browser.js gUIDensity: compact while 36 CSS px over the reference height is more than browser.compactmode.auto.threshold 0.05, that is below 720 CSS px; RetailCaptures analysis/window-geometry/chrome-density; retail Firefox 159 on Windows, measured by the core's retail window-geometry capture workflow (rounds 2 and 3, runs 45672953042 and 45679625406)). The bar is the compact 109 device px = 73 CSS px, not the normal 127 device px = 85 CSS px that the published engine's core declares: the core's constants.ui_density and declared_maximized_ui pick the density, window_frame.chrome_height_device(1.5, 'compact') gives the bar. This leaf: window.innerHeight, the viewport height in CSS px."
},
{
"id": "windows-seed63-state.normal.mozInnerScreenY",
"os": "windows",
"seed": 63,
"dpr": 1.5,
"leaf": "state.normal.mozInnerScreenY",
"published": 84.66666412353516,
"candidate": 72.66666412353516,
"reason": "Seed 63 is at 1.5, and the work area of its screen is under 720 CSS px high (about 693 on a 1920x1080 panel), so retail Firefox 159 chooses the compact density by itself (browser.js gUIDensity: compact while 36 CSS px over the reference height is more than browser.compactmode.auto.threshold 0.05, that is below 720 CSS px; RetailCaptures analysis/window-geometry/chrome-density; retail Firefox 159 on Windows, measured by the core's retail window-geometry capture workflow (rounds 2 and 3, runs 45672953042 and 45679625406)). The bar is the compact 109 device px = 73 CSS px, not the normal 127 device px = 85 CSS px that the published engine's core declares: the core's constants.ui_density and declared_maximized_ui pick the density, window_frame.chrome_height_device(1.5, 'compact') gives the bar. This leaf: window.mozInnerScreenY, the screen Y of the content's top in CSS px (the bar above the content)."
},
{
"id": "windows-seed63-surface.visualViewport.height",
"os": "windows",
"seed": 63,
"dpr": 1.5,
"leaf": "surface.visualViewport.height",
"published": 587.3333129882812,
"candidate": 599.3333129882812,
"reason": "Seed 63 is at 1.5, and the work area of its screen is under 720 CSS px high (about 693 on a 1920x1080 panel), so retail Firefox 159 chooses the compact density by itself (browser.js gUIDensity: compact while 36 CSS px over the reference height is more than browser.compactmode.auto.threshold 0.05, that is below 720 CSS px; RetailCaptures analysis/window-geometry/chrome-density; retail Firefox 159 on Windows, measured by the core's retail window-geometry capture workflow (rounds 2 and 3, runs 45672953042 and 45679625406)). The bar is the compact 109 device px = 73 CSS px, not the normal 127 device px = 85 CSS px that the published engine's core declares: the core's constants.ui_density and declared_maximized_ui pick the density, window_frame.chrome_height_device(1.5, 'compact') gives the bar. This leaf: visualViewport.height, the viewport height in CSS px."
},
{
"id": "windows-seed63-surface.window.innerHeight",
"os": "windows",
"seed": 63,
"dpr": 1.5,
"leaf": "surface.window.innerHeight",
"published": 587,
"candidate": 599,
"reason": "Seed 63 is at 1.5, and the work area of its screen is under 720 CSS px high (about 693 on a 1920x1080 panel), so retail Firefox 159 chooses the compact density by itself (browser.js gUIDensity: compact while 36 CSS px over the reference height is more than browser.compactmode.auto.threshold 0.05, that is below 720 CSS px; RetailCaptures analysis/window-geometry/chrome-density; retail Firefox 159 on Windows, measured by the core's retail window-geometry capture workflow (rounds 2 and 3, runs 45672953042 and 45679625406)). The bar is the compact 109 device px = 73 CSS px, not the normal 127 device px = 85 CSS px that the published engine's core declares: the core's constants.ui_density and declared_maximized_ui pick the density, window_frame.chrome_height_device(1.5, 'compact') gives the bar. This leaf: window.innerHeight, the viewport height in CSS px."
},
{
"id": "windows-seed63-surface.window.mozInnerScreenY",
"os": "windows",
"seed": 63,
"dpr": 1.5,
"leaf": "surface.window.mozInnerScreenY",
"published": 84.66666412353516,
"candidate": 72.66666412353516,
"reason": "Seed 63 is at 1.5, and the work area of its screen is under 720 CSS px high (about 693 on a 1920x1080 panel), so retail Firefox 159 chooses the compact density by itself (browser.js gUIDensity: compact while 36 CSS px over the reference height is more than browser.compactmode.auto.threshold 0.05, that is below 720 CSS px; RetailCaptures analysis/window-geometry/chrome-density; retail Firefox 159 on Windows, measured by the core's retail window-geometry capture workflow (rounds 2 and 3, runs 45672953042 and 45679625406)). The bar is the compact 109 device px = 73 CSS px, not the normal 127 device px = 85 CSS px that the published engine's core declares: the core's constants.ui_density and declared_maximized_ui pick the density, window_frame.chrome_height_device(1.5, 'compact') gives the bar. This leaf: window.mozInnerScreenY, the screen Y of the content's top in CSS px (the bar above the content)."
}
]
}
File diff suppressed because it is too large. Load diff
+566
View File
@@ -0,0 +1,566 @@
{
"candidate": [
0,
2,
4,
6,
63
],
"core_version": "71.85.0",
"counts": {
"audio": {
"audio.sample_rate=44100|audio.output_latency_ms=20|audio.max_channel_count=2": 4315,
"audio.sample_rate=44100|audio.output_latency_ms=40|audio.max_channel_count=2": 14437,
"audio.sample_rate=44100|audio.output_latency_ms=50|audio.max_channel_count=2": 8614,
"audio.sample_rate=48000|audio.output_latency_ms=20|audio.max_channel_count=2": 21542,
"audio.sample_rate=48000|audio.output_latency_ms=20|audio.max_channel_count=6": 7783,
"audio.sample_rate=48000|audio.output_latency_ms=25|audio.max_channel_count=2": 5091,
"audio.sample_rate=48000|audio.output_latency_ms=30|audio.max_channel_count=2": 19799,
"audio.sample_rate=48000|audio.output_latency_ms=40|audio.max_channel_count=2": 18419
},
"codecs": {
"media.av1.enabled=false|media.encoder.webm.enabled=false|media.mp4.enabled=true|media.webm.enabled=true|media.decode_support=sha:9c24a8728f": 4264,
"media.av1.enabled=false|media.encoder.webm.enabled=true|media.mp4.enabled=true|media.webm.enabled=true|media.decode_support=sha:9c24a8728f": 18331,
"media.av1.enabled=true|media.encoder.webm.enabled=false|media.mp4.enabled=true|media.webm.enabled=true|media.decode_support=sha:960968735a": 12026,
"media.av1.enabled=true|media.encoder.webm.enabled=true|media.mp4.enabled=false|media.webm.enabled=true|media.decode_support=sha:960968735a": 4065,
"media.av1.enabled=true|media.encoder.webm.enabled=true|media.mp4.enabled=true|media.webm.enabled=false|media.decode_support=sha:960968735a": 4500,
"media.av1.enabled=true|media.encoder.webm.enabled=true|media.mp4.enabled=true|media.webm.enabled=true|media.decode_support=sha:960968735a": 56814
},
"cores": {
"hw_concurrency=10": 591,
"hw_concurrency=12": 21879,
"hw_concurrency=14": 1593,
"hw_concurrency=16": 13914,
"hw_concurrency=2": 2532,
"hw_concurrency=20": 3999,
"hw_concurrency=22": 1038,
"hw_concurrency=24": 2270,
"hw_concurrency=28": 1047,
"hw_concurrency=3": 1215,
"hw_concurrency=32": 2317,
"hw_concurrency=4": 16106,
"hw_concurrency=5": 800,
"hw_concurrency=6": 2189,
"hw_concurrency=7": 572,
"hw_concurrency=8": 27517,
"hw_concurrency=9": 421
},
"dark_theme": {
"ui.systemUsesDarkTheme=0|layout.css.prefers-color-scheme.content-override=1": 59856,
"ui.systemUsesDarkTheme=1|layout.css.prefers-color-scheme.content-override=0": 40144
},
"dpr": {
"layout.css.devPixelsPerPx=\"1.0\"|screen.frame_border=8|screen.popup_ui=72|screen.popup_client_top=31": 70210,
"layout.css.devPixelsPerPx=\"1.25\"|screen.frame_border=9|screen.popup_ui=89|screen.popup_client_top=38": 18299,
"layout.css.devPixelsPerPx=\"1.5\"|screen.frame_border=11|screen.popup_ui=106|screen.popup_client_top=45": 11491
},
"gfx_device": {
"adliris_7085": 7197,
"arl_6629": 2281,
"gtx1650_62101": 5882,
"gtx980_58278": 6133,
"icl_2145": 2398,
"irisxe_7085": 9685,
"renoir_21925": 8650,
"rpl770_7092": 3631,
"rtx3060_62101": 6058,
"rtx4060_62101": 6044,
"rtx5060_62101": 6044,
"rtx5060ti_62101": 5881,
"rtx5070_62101": 6289,
"rtx5080l_61742": 5891,
"rx580_21925": 1855,
"rx6600_32015": 1817,
"rx7600_32015": 1865,
"uhd620_2145": 2680,
"uhd630_2145": 7419,
"uhd770_7092": 2300
},
"gfx_feature_status": {
"gfx.feature_status=sha:05ce56d3c0": 22813,
"gfx.feature_status=sha:098c0bf836": 2281,
"gfx.feature_status=sha:2f5fe3776b": 14187,
"gfx.feature_status=sha:80c00ab015": 9817,
"gfx.feature_status=sha:b153aef69f": 48222,
"gfx.feature_status=sha:d1db3983c9": 2680
},
"render_noise": {
"fpp.hw_seed=11": 11111,
"fpp.hw_seed=16": 11111,
"fpp.hw_seed=19": 11111,
"fpp.hw_seed=20": 11111,
"fpp.hw_seed=28": 11111,
"fpp.hw_seed=5": 22223,
"fpp.hw_seed=6": 11111,
"fpp.hw_seed=9": 11111
},
"screen_panel": {
"screen.width=1280|screen.height=720|screen.avail_device_width=1920|screen.avail_device_height=1008|layout.css.devPixelsPerPx=\"1.5\"": 9276,
"screen.width=1536|screen.height=864|screen.avail_device_width=1920|screen.avail_device_height=1020|layout.css.devPixelsPerPx=\"1.25\"": 15893,
"screen.width=1920|screen.height=1080|screen.avail_device_width=1920|screen.avail_device_height=1032|layout.css.devPixelsPerPx=\"1.0\"": 41031,
"screen.width=1920|screen.height=1200|screen.avail_device_width=1920|screen.avail_device_height=1152|layout.css.devPixelsPerPx=\"1.0\"": 5228,
"screen.width=2048|screen.height=1152|screen.avail_device_width=2560|screen.avail_device_height=1380|layout.css.devPixelsPerPx=\"1.25\"": 2406,
"screen.width=2560|screen.height=1080|screen.avail_device_width=2560|screen.avail_device_height=1032|layout.css.devPixelsPerPx=\"1.0\"": 1918,
"screen.width=2560|screen.height=1440|screen.avail_device_width=2560|screen.avail_device_height=1392|layout.css.devPixelsPerPx=\"1.0\"": 19886,
"screen.width=2560|screen.height=1440|screen.avail_device_width=3840|screen.avail_device_height=2088|layout.css.devPixelsPerPx=\"1.5\"": 2215,
"screen.width=3840|screen.height=2160|screen.avail_device_width=3840|screen.avail_device_height=2112|layout.css.devPixelsPerPx=\"1.0\"": 2147
},
"webgl_renderer": {
"ANGLE (AMD, Radeon HD 3200 Graphics Direct3D11 vs_5_0 ps_5_0, D3D11)": 8650,
"ANGLE (AMD, Radeon R9 200 Series Direct3D11 vs_5_0 ps_5_0, D3D11)": 5537,
"ANGLE (Intel, Intel(R) HD Graphics 400 Direct3D11 vs_5_0 ps_5_0, D3D11)": 16030,
"ANGLE (Intel, Intel(R) HD Graphics Direct3D11 vs_5_0 ps_5_0, D3D11)": 21561,
"ANGLE (NVIDIA, NVIDIA GeForce GTX 980 Direct3D11 vs_5_0 ps_5_0, D3D11)": 48222
}
},
"dimensions": {
"audio": [
"audio.sample_rate=44100|audio.output_latency_ms=20|audio.max_channel_count=2",
"audio.sample_rate=44100|audio.output_latency_ms=40|audio.max_channel_count=2",
"audio.sample_rate=44100|audio.output_latency_ms=50|audio.max_channel_count=2",
"audio.sample_rate=48000|audio.output_latency_ms=20|audio.max_channel_count=2",
"audio.sample_rate=48000|audio.output_latency_ms=20|audio.max_channel_count=6",
"audio.sample_rate=48000|audio.output_latency_ms=25|audio.max_channel_count=2",
"audio.sample_rate=48000|audio.output_latency_ms=30|audio.max_channel_count=2",
"audio.sample_rate=48000|audio.output_latency_ms=40|audio.max_channel_count=2"
],
"codecs": [
"media.av1.enabled=false|media.encoder.webm.enabled=false|media.mp4.enabled=true|media.webm.enabled=true|media.decode_support=sha:9c24a8728f",
"media.av1.enabled=false|media.encoder.webm.enabled=true|media.mp4.enabled=true|media.webm.enabled=true|media.decode_support=sha:9c24a8728f",
"media.av1.enabled=true|media.encoder.webm.enabled=false|media.mp4.enabled=true|media.webm.enabled=true|media.decode_support=sha:960968735a",
"media.av1.enabled=true|media.encoder.webm.enabled=true|media.mp4.enabled=false|media.webm.enabled=true|media.decode_support=sha:960968735a",
"media.av1.enabled=true|media.encoder.webm.enabled=true|media.mp4.enabled=true|media.webm.enabled=false|media.decode_support=sha:960968735a",
"media.av1.enabled=true|media.encoder.webm.enabled=true|media.mp4.enabled=true|media.webm.enabled=true|media.decode_support=sha:960968735a"
],
"cores": [
"hw_concurrency=10",
"hw_concurrency=12",
"hw_concurrency=14",
"hw_concurrency=16",
"hw_concurrency=2",
"hw_concurrency=20",
"hw_concurrency=22",
"hw_concurrency=24",
"hw_concurrency=28",
"hw_concurrency=3",
"hw_concurrency=32",
"hw_concurrency=4",
"hw_concurrency=5",
"hw_concurrency=6",
"hw_concurrency=7",
"hw_concurrency=8",
"hw_concurrency=9"
],
"dark_theme": [
"ui.systemUsesDarkTheme=0|layout.css.prefers-color-scheme.content-override=1",
"ui.systemUsesDarkTheme=1|layout.css.prefers-color-scheme.content-override=0"
],
"dpr": [
"layout.css.devPixelsPerPx=\"1.0\"|screen.frame_border=8|screen.popup_ui=72|screen.popup_client_top=31",
"layout.css.devPixelsPerPx=\"1.25\"|screen.frame_border=9|screen.popup_ui=89|screen.popup_client_top=38",
"layout.css.devPixelsPerPx=\"1.5\"|screen.frame_border=11|screen.popup_ui=106|screen.popup_client_top=45"
],
"gfx_device": [
"adliris_7085",
"arl_6629",
"gtx1650_62101",
"gtx980_58278",
"icl_2145",
"irisxe_7085",
"renoir_21925",
"rpl770_7092",
"rtx3060_62101",
"rtx4060_62101",
"rtx5060_62101",
"rtx5060ti_62101",
"rtx5070_62101",
"rtx5080l_61742",
"rx580_21925",
"rx6600_32015",
"rx7600_32015",
"uhd620_2145",
"uhd630_2145",
"uhd770_7092"
],
"gfx_feature_status": [
"gfx.feature_status=sha:05ce56d3c0",
"gfx.feature_status=sha:098c0bf836",
"gfx.feature_status=sha:2f5fe3776b",
"gfx.feature_status=sha:80c00ab015",
"gfx.feature_status=sha:b153aef69f",
"gfx.feature_status=sha:d1db3983c9"
],
"render_noise": [
"fpp.hw_seed=11",
"fpp.hw_seed=16",
"fpp.hw_seed=19",
"fpp.hw_seed=20",
"fpp.hw_seed=28",
"fpp.hw_seed=5",
"fpp.hw_seed=6",
"fpp.hw_seed=9"
],
"screen_panel": [
"screen.width=1280|screen.height=720|screen.avail_device_width=1920|screen.avail_device_height=1008|layout.css.devPixelsPerPx=\"1.5\"",
"screen.width=1536|screen.height=864|screen.avail_device_width=1920|screen.avail_device_height=1020|layout.css.devPixelsPerPx=\"1.25\"",
"screen.width=1920|screen.height=1080|screen.avail_device_width=1920|screen.avail_device_height=1032|layout.css.devPixelsPerPx=\"1.0\"",
"screen.width=1920|screen.height=1200|screen.avail_device_width=1920|screen.avail_device_height=1152|layout.css.devPixelsPerPx=\"1.0\"",
"screen.width=2048|screen.height=1152|screen.avail_device_width=2560|screen.avail_device_height=1380|layout.css.devPixelsPerPx=\"1.25\"",
"screen.width=2560|screen.height=1080|screen.avail_device_width=2560|screen.avail_device_height=1032|layout.css.devPixelsPerPx=\"1.0\"",
"screen.width=2560|screen.height=1440|screen.avail_device_width=2560|screen.avail_device_height=1392|layout.css.devPixelsPerPx=\"1.0\"",
"screen.width=2560|screen.height=1440|screen.avail_device_width=3840|screen.avail_device_height=2088|layout.css.devPixelsPerPx=\"1.5\"",
"screen.width=3840|screen.height=2160|screen.avail_device_width=3840|screen.avail_device_height=2112|layout.css.devPixelsPerPx=\"1.0\""
],
"webgl_renderer": [
"ANGLE (AMD, Radeon HD 3200 Graphics Direct3D11 vs_5_0 ps_5_0, D3D11)",
"ANGLE (AMD, Radeon R9 200 Series Direct3D11 vs_5_0 ps_5_0, D3D11)",
"ANGLE (Intel, Intel(R) HD Graphics 400 Direct3D11 vs_5_0 ps_5_0, D3D11)",
"ANGLE (Intel, Intel(R) HD Graphics Direct3D11 vs_5_0 ps_5_0, D3D11)",
"ANGLE (NVIDIA, NVIDIA GeForce GTX 980 Direct3D11 vs_5_0 ps_5_0, D3D11)"
]
},
"dpr": {
"0": 1.0,
"107": 1.0,
"11": 1.5,
"134": 1.0,
"1633": 1.25,
"190": 1.0,
"19013": 1.0,
"2": 1.0,
"258": 1.0,
"271": 1.25,
"29735": 1.0,
"3580": 1.0,
"4": 1.0,
"49": 1.0,
"50": 1.0,
"5469": 1.5,
"59": 1.0,
"6": 1.25,
"610": 1.25,
"63": 1.5,
"7": 1.0,
"72": 1.0,
"89": 1.0,
"9219": 1.0
},
"excluded": {
"zoom.stealth.media.enumeration_ms": "the time of the first enumerateDevices(): a draw from its own stream, hundreds of values, no class of seeds to cover"
},
"features": {
"0": {
"audio": "audio.sample_rate=48000|audio.output_latency_ms=40|audio.max_channel_count=2",
"codecs": "media.av1.enabled=false|media.encoder.webm.enabled=true|media.mp4.enabled=true|media.webm.enabled=true|media.decode_support=sha:9c24a8728f",
"cores": "hw_concurrency=12",
"dark_theme": "ui.systemUsesDarkTheme=0|layout.css.prefers-color-scheme.content-override=1",
"dpr": "layout.css.devPixelsPerPx=\"1.0\"|screen.frame_border=8|screen.popup_ui=72|screen.popup_client_top=31",
"gfx_device": "rtx5070_62101",
"gfx_feature_status": "gfx.feature_status=sha:b153aef69f",
"render_noise": "fpp.hw_seed=5",
"screen_panel": "screen.width=1920|screen.height=1080|screen.avail_device_width=1920|screen.avail_device_height=1032|layout.css.devPixelsPerPx=\"1.0\"",
"webgl_renderer": "ANGLE (NVIDIA, NVIDIA GeForce GTX 980 Direct3D11 vs_5_0 ps_5_0, D3D11)"
},
"107": {
"audio": "audio.sample_rate=48000|audio.output_latency_ms=40|audio.max_channel_count=2",
"codecs": "media.av1.enabled=true|media.encoder.webm.enabled=true|media.mp4.enabled=true|media.webm.enabled=true|media.decode_support=sha:960968735a",
"cores": "hw_concurrency=22",
"dark_theme": "ui.systemUsesDarkTheme=1|layout.css.prefers-color-scheme.content-override=0",
"dpr": "layout.css.devPixelsPerPx=\"1.0\"|screen.frame_border=8|screen.popup_ui=72|screen.popup_client_top=31",
"gfx_device": "uhd630_2145",
"gfx_feature_status": "gfx.feature_status=sha:80c00ab015",
"render_noise": "fpp.hw_seed=6",
"screen_panel": "screen.width=2560|screen.height=1440|screen.avail_device_width=2560|screen.avail_device_height=1392|layout.css.devPixelsPerPx=\"1.0\"",
"webgl_renderer": "ANGLE (Intel, Intel(R) HD Graphics 400 Direct3D11 vs_5_0 ps_5_0, D3D11)"
},
"11": {
"audio": "audio.sample_rate=48000|audio.output_latency_ms=20|audio.max_channel_count=6",
"codecs": "media.av1.enabled=true|media.encoder.webm.enabled=true|media.mp4.enabled=true|media.webm.enabled=true|media.decode_support=sha:960968735a",
"cores": "hw_concurrency=32",
"dark_theme": "ui.systemUsesDarkTheme=1|layout.css.prefers-color-scheme.content-override=0",
"dpr": "layout.css.devPixelsPerPx=\"1.5\"|screen.frame_border=11|screen.popup_ui=106|screen.popup_client_top=45",
"gfx_device": "rpl770_7092",
"gfx_feature_status": "gfx.feature_status=sha:05ce56d3c0",
"render_noise": "fpp.hw_seed=16",
"screen_panel": "screen.width=1280|screen.height=720|screen.avail_device_width=1920|screen.avail_device_height=1008|layout.css.devPixelsPerPx=\"1.5\"",
"webgl_renderer": "ANGLE (Intel, Intel(R) HD Graphics 400 Direct3D11 vs_5_0 ps_5_0, D3D11)"
},
"134": {
"audio": "audio.sample_rate=48000|audio.output_latency_ms=20|audio.max_channel_count=2",
"codecs": "media.av1.enabled=false|media.encoder.webm.enabled=false|media.mp4.enabled=true|media.webm.enabled=true|media.decode_support=sha:9c24a8728f",
"cores": "hw_concurrency=5",
"dark_theme": "ui.systemUsesDarkTheme=0|layout.css.prefers-color-scheme.content-override=1",
"dpr": "layout.css.devPixelsPerPx=\"1.0\"|screen.frame_border=8|screen.popup_ui=72|screen.popup_client_top=31",
"gfx_device": "gtx980_58278",
"gfx_feature_status": "gfx.feature_status=sha:b153aef69f",
"render_noise": "fpp.hw_seed=6",
"screen_panel": "screen.width=1920|screen.height=1200|screen.avail_device_width=1920|screen.avail_device_height=1152|layout.css.devPixelsPerPx=\"1.0\"",
"webgl_renderer": "ANGLE (NVIDIA, NVIDIA GeForce GTX 980 Direct3D11 vs_5_0 ps_5_0, D3D11)"
},
"1633": {
"audio": "audio.sample_rate=48000|audio.output_latency_ms=20|audio.max_channel_count=6",
"codecs": "media.av1.enabled=true|media.encoder.webm.enabled=true|media.mp4.enabled=true|media.webm.enabled=true|media.decode_support=sha:960968735a",
"cores": "hw_concurrency=24",
"dark_theme": "ui.systemUsesDarkTheme=1|layout.css.prefers-color-scheme.content-override=0",
"dpr": "layout.css.devPixelsPerPx=\"1.25\"|screen.frame_border=9|screen.popup_ui=89|screen.popup_client_top=38",
"gfx_device": "adliris_7085",
"gfx_feature_status": "gfx.feature_status=sha:05ce56d3c0",
"render_noise": "fpp.hw_seed=5",
"screen_panel": "screen.width=2048|screen.height=1152|screen.avail_device_width=2560|screen.avail_device_height=1380|layout.css.devPixelsPerPx=\"1.25\"",
"webgl_renderer": "ANGLE (Intel, Intel(R) HD Graphics Direct3D11 vs_5_0 ps_5_0, D3D11)"
},
"190": {
"audio": "audio.sample_rate=44100|audio.output_latency_ms=50|audio.max_channel_count=2",
"codecs": "media.av1.enabled=true|media.encoder.webm.enabled=true|media.mp4.enabled=false|media.webm.enabled=true|media.decode_support=sha:960968735a",
"cores": "hw_concurrency=6",
"dark_theme": "ui.systemUsesDarkTheme=1|layout.css.prefers-color-scheme.content-override=0",
"dpr": "layout.css.devPixelsPerPx=\"1.0\"|screen.frame_border=8|screen.popup_ui=72|screen.popup_client_top=31",
"gfx_device": "gtx1650_62101",
"gfx_feature_status": "gfx.feature_status=sha:b153aef69f",
"render_noise": "fpp.hw_seed=20",
"screen_panel": "screen.width=1920|screen.height=1080|screen.avail_device_width=1920|screen.avail_device_height=1032|layout.css.devPixelsPerPx=\"1.0\"",
"webgl_renderer": "ANGLE (NVIDIA, NVIDIA GeForce GTX 980 Direct3D11 vs_5_0 ps_5_0, D3D11)"
},
"19013": {
"audio": "audio.sample_rate=48000|audio.output_latency_ms=25|audio.max_channel_count=2",
"codecs": "media.av1.enabled=true|media.encoder.webm.enabled=true|media.mp4.enabled=true|media.webm.enabled=true|media.decode_support=sha:960968735a",
"cores": "hw_concurrency=20",
"dark_theme": "ui.systemUsesDarkTheme=1|layout.css.prefers-color-scheme.content-override=0",
"dpr": "layout.css.devPixelsPerPx=\"1.0\"|screen.frame_border=8|screen.popup_ui=72|screen.popup_client_top=31",
"gfx_device": "uhd620_2145",
"gfx_feature_status": "gfx.feature_status=sha:d1db3983c9",
"render_noise": "fpp.hw_seed=28",
"screen_panel": "screen.width=3840|screen.height=2160|screen.avail_device_width=3840|screen.avail_device_height=2112|layout.css.devPixelsPerPx=\"1.0\"",
"webgl_renderer": "ANGLE (Intel, Intel(R) HD Graphics 400 Direct3D11 vs_5_0 ps_5_0, D3D11)"
},
"2": {
"audio": "audio.sample_rate=48000|audio.output_latency_ms=40|audio.max_channel_count=2",
"codecs": "media.av1.enabled=true|media.encoder.webm.enabled=false|media.mp4.enabled=true|media.webm.enabled=true|media.decode_support=sha:960968735a",
"cores": "hw_concurrency=8",
"dark_theme": "ui.systemUsesDarkTheme=1|layout.css.prefers-color-scheme.content-override=0",
"dpr": "layout.css.devPixelsPerPx=\"1.0\"|screen.frame_border=8|screen.popup_ui=72|screen.popup_client_top=31",
"gfx_device": "renoir_21925",
"gfx_feature_status": "gfx.feature_status=sha:2f5fe3776b",
"render_noise": "fpp.hw_seed=16",
"screen_panel": "screen.width=1920|screen.height=1080|screen.avail_device_width=1920|screen.avail_device_height=1032|layout.css.devPixelsPerPx=\"1.0\"",
"webgl_renderer": "ANGLE (AMD, Radeon HD 3200 Graphics Direct3D11 vs_5_0 ps_5_0, D3D11)"
},
"258": {
"audio": "audio.sample_rate=48000|audio.output_latency_ms=40|audio.max_channel_count=2",
"codecs": "media.av1.enabled=true|media.encoder.webm.enabled=true|media.mp4.enabled=true|media.webm.enabled=true|media.decode_support=sha:960968735a",
"cores": "hw_concurrency=14",
"dark_theme": "ui.systemUsesDarkTheme=0|layout.css.prefers-color-scheme.content-override=1",
"dpr": "layout.css.devPixelsPerPx=\"1.0\"|screen.frame_border=8|screen.popup_ui=72|screen.popup_client_top=31",
"gfx_device": "rtx3060_62101",
"gfx_feature_status": "gfx.feature_status=sha:b153aef69f",
"render_noise": "fpp.hw_seed=19",
"screen_panel": "screen.width=1920|screen.height=1080|screen.avail_device_width=1920|screen.avail_device_height=1032|layout.css.devPixelsPerPx=\"1.0\"",
"webgl_renderer": "ANGLE (NVIDIA, NVIDIA GeForce GTX 980 Direct3D11 vs_5_0 ps_5_0, D3D11)"
},
"271": {
"audio": "audio.sample_rate=48000|audio.output_latency_ms=20|audio.max_channel_count=2",
"codecs": "media.av1.enabled=true|media.encoder.webm.enabled=false|media.mp4.enabled=true|media.webm.enabled=true|media.decode_support=sha:960968735a",
"cores": "hw_concurrency=16",
"dark_theme": "ui.systemUsesDarkTheme=1|layout.css.prefers-color-scheme.content-override=0",
"dpr": "layout.css.devPixelsPerPx=\"1.25\"|screen.frame_border=9|screen.popup_ui=89|screen.popup_client_top=38",
"gfx_device": "rx580_21925",
"gfx_feature_status": "gfx.feature_status=sha:2f5fe3776b",
"render_noise": "fpp.hw_seed=20",
"screen_panel": "screen.width=1536|screen.height=864|screen.avail_device_width=1920|screen.avail_device_height=1020|layout.css.devPixelsPerPx=\"1.25\"",
"webgl_renderer": "ANGLE (AMD, Radeon R9 200 Series Direct3D11 vs_5_0 ps_5_0, D3D11)"
},
"29735": {
"audio": "audio.sample_rate=48000|audio.output_latency_ms=20|audio.max_channel_count=2",
"codecs": "media.av1.enabled=false|media.encoder.webm.enabled=false|media.mp4.enabled=true|media.webm.enabled=true|media.decode_support=sha:9c24a8728f",
"cores": "hw_concurrency=28",
"dark_theme": "ui.systemUsesDarkTheme=0|layout.css.prefers-color-scheme.content-override=1",
"dpr": "layout.css.devPixelsPerPx=\"1.0\"|screen.frame_border=8|screen.popup_ui=72|screen.popup_client_top=31",
"gfx_device": "irisxe_7085",
"gfx_feature_status": "gfx.feature_status=sha:05ce56d3c0",
"render_noise": "fpp.hw_seed=6",
"screen_panel": "screen.width=2560|screen.height=1080|screen.avail_device_width=2560|screen.avail_device_height=1032|layout.css.devPixelsPerPx=\"1.0\"",
"webgl_renderer": "ANGLE (Intel, Intel(R) HD Graphics Direct3D11 vs_5_0 ps_5_0, D3D11)"
},
"3580": {
"audio": "audio.sample_rate=48000|audio.output_latency_ms=30|audio.max_channel_count=2",
"codecs": "media.av1.enabled=true|media.encoder.webm.enabled=true|media.mp4.enabled=false|media.webm.enabled=true|media.decode_support=sha:960968735a",
"cores": "hw_concurrency=4",
"dark_theme": "ui.systemUsesDarkTheme=0|layout.css.prefers-color-scheme.content-override=1",
"dpr": "layout.css.devPixelsPerPx=\"1.0\"|screen.frame_border=8|screen.popup_ui=72|screen.popup_client_top=31",
"gfx_device": "icl_2145",
"gfx_feature_status": "gfx.feature_status=sha:80c00ab015",
"render_noise": "fpp.hw_seed=11",
"screen_panel": "screen.width=2560|screen.height=1440|screen.avail_device_width=2560|screen.avail_device_height=1392|layout.css.devPixelsPerPx=\"1.0\"",
"webgl_renderer": "ANGLE (Intel, Intel(R) HD Graphics Direct3D11 vs_5_0 ps_5_0, D3D11)"
},
"4": {
"audio": "audio.sample_rate=44100|audio.output_latency_ms=20|audio.max_channel_count=2",
"codecs": "media.av1.enabled=true|media.encoder.webm.enabled=true|media.mp4.enabled=true|media.webm.enabled=true|media.decode_support=sha:960968735a",
"cores": "hw_concurrency=12",
"dark_theme": "ui.systemUsesDarkTheme=1|layout.css.prefers-color-scheme.content-override=0",
"dpr": "layout.css.devPixelsPerPx=\"1.0\"|screen.frame_border=8|screen.popup_ui=72|screen.popup_client_top=31",
"gfx_device": "uhd630_2145",
"gfx_feature_status": "gfx.feature_status=sha:80c00ab015",
"render_noise": "fpp.hw_seed=5",
"screen_panel": "screen.width=1920|screen.height=1080|screen.avail_device_width=1920|screen.avail_device_height=1032|layout.css.devPixelsPerPx=\"1.0\"",
"webgl_renderer": "ANGLE (Intel, Intel(R) HD Graphics 400 Direct3D11 vs_5_0 ps_5_0, D3D11)"
},
"49": {
"audio": "audio.sample_rate=48000|audio.output_latency_ms=25|audio.max_channel_count=2",
"codecs": "media.av1.enabled=true|media.encoder.webm.enabled=true|media.mp4.enabled=true|media.webm.enabled=true|media.decode_support=sha:960968735a",
"cores": "hw_concurrency=8",
"dark_theme": "ui.systemUsesDarkTheme=0|layout.css.prefers-color-scheme.content-override=1",
"dpr": "layout.css.devPixelsPerPx=\"1.0\"|screen.frame_border=8|screen.popup_ui=72|screen.popup_client_top=31",
"gfx_device": "rx6600_32015",
"gfx_feature_status": "gfx.feature_status=sha:2f5fe3776b",
"render_noise": "fpp.hw_seed=5",
"screen_panel": "screen.width=2560|screen.height=1440|screen.avail_device_width=2560|screen.avail_device_height=1392|layout.css.devPixelsPerPx=\"1.0\"",
"webgl_renderer": "ANGLE (AMD, Radeon R9 200 Series Direct3D11 vs_5_0 ps_5_0, D3D11)"
},
"50": {
"audio": "audio.sample_rate=48000|audio.output_latency_ms=40|audio.max_channel_count=2",
"codecs": "media.av1.enabled=false|media.encoder.webm.enabled=true|media.mp4.enabled=true|media.webm.enabled=true|media.decode_support=sha:9c24a8728f",
"cores": "hw_concurrency=4",
"dark_theme": "ui.systemUsesDarkTheme=1|layout.css.prefers-color-scheme.content-override=0",
"dpr": "layout.css.devPixelsPerPx=\"1.0\"|screen.frame_border=8|screen.popup_ui=72|screen.popup_client_top=31",
"gfx_device": "rtx5060_62101",
"gfx_feature_status": "gfx.feature_status=sha:b153aef69f",
"render_noise": "fpp.hw_seed=28",
"screen_panel": "screen.width=1920|screen.height=1080|screen.avail_device_width=1920|screen.avail_device_height=1032|layout.css.devPixelsPerPx=\"1.0\"",
"webgl_renderer": "ANGLE (NVIDIA, NVIDIA GeForce GTX 980 Direct3D11 vs_5_0 ps_5_0, D3D11)"
},
"5469": {
"audio": "audio.sample_rate=44100|audio.output_latency_ms=20|audio.max_channel_count=2",
"codecs": "media.av1.enabled=true|media.encoder.webm.enabled=true|media.mp4.enabled=true|media.webm.enabled=true|media.decode_support=sha:960968735a",
"cores": "hw_concurrency=8",
"dark_theme": "ui.systemUsesDarkTheme=0|layout.css.prefers-color-scheme.content-override=1",
"dpr": "layout.css.devPixelsPerPx=\"1.5\"|screen.frame_border=11|screen.popup_ui=106|screen.popup_client_top=45",
"gfx_device": "arl_6629",
"gfx_feature_status": "gfx.feature_status=sha:098c0bf836",
"render_noise": "fpp.hw_seed=19",
"screen_panel": "screen.width=2560|screen.height=1440|screen.avail_device_width=3840|screen.avail_device_height=2088|layout.css.devPixelsPerPx=\"1.5\"",
"webgl_renderer": "ANGLE (Intel, Intel(R) HD Graphics Direct3D11 vs_5_0 ps_5_0, D3D11)"
},
"59": {
"audio": "audio.sample_rate=44100|audio.output_latency_ms=40|audio.max_channel_count=2",
"codecs": "media.av1.enabled=true|media.encoder.webm.enabled=false|media.mp4.enabled=true|media.webm.enabled=true|media.decode_support=sha:960968735a",
"cores": "hw_concurrency=3",
"dark_theme": "ui.systemUsesDarkTheme=1|layout.css.prefers-color-scheme.content-override=0",
"dpr": "layout.css.devPixelsPerPx=\"1.0\"|screen.frame_border=8|screen.popup_ui=72|screen.popup_client_top=31",
"gfx_device": "rtx5080l_61742",
"gfx_feature_status": "gfx.feature_status=sha:b153aef69f",
"render_noise": "fpp.hw_seed=28",
"screen_panel": "screen.width=1920|screen.height=1080|screen.avail_device_width=1920|screen.avail_device_height=1032|layout.css.devPixelsPerPx=\"1.0\"",
"webgl_renderer": "ANGLE (NVIDIA, NVIDIA GeForce GTX 980 Direct3D11 vs_5_0 ps_5_0, D3D11)"
},
"6": {
"audio": "audio.sample_rate=48000|audio.output_latency_ms=25|audio.max_channel_count=2",
"codecs": "media.av1.enabled=true|media.encoder.webm.enabled=false|media.mp4.enabled=true|media.webm.enabled=true|media.decode_support=sha:960968735a",
"cores": "hw_concurrency=12",
"dark_theme": "ui.systemUsesDarkTheme=0|layout.css.prefers-color-scheme.content-override=1",
"dpr": "layout.css.devPixelsPerPx=\"1.25\"|screen.frame_border=9|screen.popup_ui=89|screen.popup_client_top=38",
"gfx_device": "adliris_7085",
"gfx_feature_status": "gfx.feature_status=sha:05ce56d3c0",
"render_noise": "fpp.hw_seed=19",
"screen_panel": "screen.width=1536|screen.height=864|screen.avail_device_width=1920|screen.avail_device_height=1020|layout.css.devPixelsPerPx=\"1.25\"",
"webgl_renderer": "ANGLE (Intel, Intel(R) HD Graphics Direct3D11 vs_5_0 ps_5_0, D3D11)"
},
"610": {
"audio": "audio.sample_rate=44100|audio.output_latency_ms=20|audio.max_channel_count=2",
"codecs": "media.av1.enabled=true|media.encoder.webm.enabled=false|media.mp4.enabled=true|media.webm.enabled=true|media.decode_support=sha:960968735a",
"cores": "hw_concurrency=7",
"dark_theme": "ui.systemUsesDarkTheme=0|layout.css.prefers-color-scheme.content-override=1",
"dpr": "layout.css.devPixelsPerPx=\"1.25\"|screen.frame_border=9|screen.popup_ui=89|screen.popup_client_top=38",
"gfx_device": "rx7600_32015",
"gfx_feature_status": "gfx.feature_status=sha:2f5fe3776b",
"render_noise": "fpp.hw_seed=11",
"screen_panel": "screen.width=1536|screen.height=864|screen.avail_device_width=1920|screen.avail_device_height=1020|layout.css.devPixelsPerPx=\"1.25\"",
"webgl_renderer": "ANGLE (AMD, Radeon R9 200 Series Direct3D11 vs_5_0 ps_5_0, D3D11)"
},
"63": {
"audio": "audio.sample_rate=48000|audio.output_latency_ms=20|audio.max_channel_count=2",
"codecs": "media.av1.enabled=false|media.encoder.webm.enabled=true|media.mp4.enabled=true|media.webm.enabled=true|media.decode_support=sha:9c24a8728f",
"cores": "hw_concurrency=32",
"dark_theme": "ui.systemUsesDarkTheme=0|layout.css.prefers-color-scheme.content-override=1",
"dpr": "layout.css.devPixelsPerPx=\"1.5\"|screen.frame_border=11|screen.popup_ui=106|screen.popup_client_top=45",
"gfx_device": "rx7600_32015",
"gfx_feature_status": "gfx.feature_status=sha:2f5fe3776b",
"render_noise": "fpp.hw_seed=5",
"screen_panel": "screen.width=1280|screen.height=720|screen.avail_device_width=1920|screen.avail_device_height=1008|layout.css.devPixelsPerPx=\"1.5\"",
"webgl_renderer": "ANGLE (AMD, Radeon R9 200 Series Direct3D11 vs_5_0 ps_5_0, D3D11)"
},
"7": {
"audio": "audio.sample_rate=48000|audio.output_latency_ms=30|audio.max_channel_count=2",
"codecs": "media.av1.enabled=true|media.encoder.webm.enabled=true|media.mp4.enabled=true|media.webm.enabled=true|media.decode_support=sha:960968735a",
"cores": "hw_concurrency=4",
"dark_theme": "ui.systemUsesDarkTheme=0|layout.css.prefers-color-scheme.content-override=1",
"dpr": "layout.css.devPixelsPerPx=\"1.0\"|screen.frame_border=8|screen.popup_ui=72|screen.popup_client_top=31",
"gfx_device": "rtx5060ti_62101",
"gfx_feature_status": "gfx.feature_status=sha:b153aef69f",
"render_noise": "fpp.hw_seed=11",
"screen_panel": "screen.width=1920|screen.height=1080|screen.avail_device_width=1920|screen.avail_device_height=1032|layout.css.devPixelsPerPx=\"1.0\"",
"webgl_renderer": "ANGLE (NVIDIA, NVIDIA GeForce GTX 980 Direct3D11 vs_5_0 ps_5_0, D3D11)"
},
"72": {
"audio": "audio.sample_rate=48000|audio.output_latency_ms=25|audio.max_channel_count=2",
"codecs": "media.av1.enabled=true|media.encoder.webm.enabled=true|media.mp4.enabled=true|media.webm.enabled=true|media.decode_support=sha:960968735a",
"cores": "hw_concurrency=10",
"dark_theme": "ui.systemUsesDarkTheme=0|layout.css.prefers-color-scheme.content-override=1",
"dpr": "layout.css.devPixelsPerPx=\"1.0\"|screen.frame_border=8|screen.popup_ui=72|screen.popup_client_top=31",
"gfx_device": "uhd770_7092",
"gfx_feature_status": "gfx.feature_status=sha:05ce56d3c0",
"render_noise": "fpp.hw_seed=5",
"screen_panel": "screen.width=1920|screen.height=1080|screen.avail_device_width=1920|screen.avail_device_height=1032|layout.css.devPixelsPerPx=\"1.0\"",
"webgl_renderer": "ANGLE (Intel, Intel(R) HD Graphics 400 Direct3D11 vs_5_0 ps_5_0, D3D11)"
},
"89": {
"audio": "audio.sample_rate=44100|audio.output_latency_ms=50|audio.max_channel_count=2",
"codecs": "media.av1.enabled=true|media.encoder.webm.enabled=true|media.mp4.enabled=true|media.webm.enabled=true|media.decode_support=sha:960968735a",
"cores": "hw_concurrency=9",
"dark_theme": "ui.systemUsesDarkTheme=0|layout.css.prefers-color-scheme.content-override=1",
"dpr": "layout.css.devPixelsPerPx=\"1.0\"|screen.frame_border=8|screen.popup_ui=72|screen.popup_client_top=31",
"gfx_device": "rtx4060_62101",
"gfx_feature_status": "gfx.feature_status=sha:b153aef69f",
"render_noise": "fpp.hw_seed=6",
"screen_panel": "screen.width=1920|screen.height=1080|screen.avail_device_width=1920|screen.avail_device_height=1032|layout.css.devPixelsPerPx=\"1.0\"",
"webgl_renderer": "ANGLE (NVIDIA, NVIDIA GeForce GTX 980 Direct3D11 vs_5_0 ps_5_0, D3D11)"
},
"9219": {
"audio": "audio.sample_rate=44100|audio.output_latency_ms=40|audio.max_channel_count=2",
"codecs": "media.av1.enabled=true|media.encoder.webm.enabled=true|media.mp4.enabled=true|media.webm.enabled=false|media.decode_support=sha:960968735a",
"cores": "hw_concurrency=2",
"dark_theme": "ui.systemUsesDarkTheme=1|layout.css.prefers-color-scheme.content-override=0",
"dpr": "layout.css.devPixelsPerPx=\"1.0\"|screen.frame_border=8|screen.popup_ui=72|screen.popup_client_top=31",
"gfx_device": "renoir_21925",
"gfx_feature_status": "gfx.feature_status=sha:2f5fe3776b",
"render_noise": "fpp.hw_seed=9",
"screen_panel": "screen.width=1920|screen.height=1200|screen.avail_device_width=1920|screen.avail_device_height=1152|layout.css.devPixelsPerPx=\"1.0\"",
"webgl_renderer": "ANGLE (AMD, Radeon HD 3200 Graphics Direct3D11 vs_5_0 ps_5_0, D3D11)"
}
},
"final": [
0,
7,
11,
49,
50,
59,
72,
89,
107,
134,
190,
258,
271,
610,
1633,
3580,
5469,
9219,
19013,
29735
],
"format": "persona-seeds/1",
"max_seed": 100000,
"sha256": "82547e9f34ece0c17075d812dcc009c7e8e6f348eb33fb4cc5cdbff6253cc4f0"
}
+28
View File
@@ -0,0 +1,28 @@
# Input of the gate lock; `python scripts/ci_py_lock.py` writes it and gate.txt from the sources below. Wrapper-owned (ci-03), read at the wrapper_ref.
# python-version: 3.11
# exclude-newer: 2026-11-25T00:00:00Z
# wrapper: pyproject.toml sha256 93d8d0940284352ad53e189e17b9ad6e3109ce52e54ab138ecdfa01d8571b193 (at generation); its dependencies without invisible_core, and its `dev` extra
# core: invisible_core==71.85.0, tag v71.85.0, pyproject.toml sha256 c0d14a4d26d3650005076ab72347eb24fba4b89e643f514e7f7334bd0a2ac174 (at generation); the core is a wheel of ours, only what it depends on is locked
# core-requires: platformdirs>=4 | psutil>=5.9 | requests[socks]>=2.31 | maxminddb>=2.2 | tzdata>=2024.1
# playwright: 1.61.0 from scripts/playwright_pin.txt (the stock client the gate drives the engine with)
# cryptography: 44.0.3 (the lab's PKI)
# harness: uv>=0.5 (the installers of the install-from-index job)
aioquic>=1.2
build>=1
cryptography==44.0.3
cryptography>=41
greenlet>=3.1.1,<4.0.0
h2>=4,<5
maxminddb>=2.2
platformdirs>=4
playwright==1.61.0
psutil>=5.9
pyee>=13,<14
pytest>=7
pytest-timeout>=2
pytest-xdist>=3
requests[socks]>=2.31
ruff>=0.6
tzdata>=2024.1
uv>=0.5
websockets>=13
+845
View File
@@ -0,0 +1,845 @@
# Generated by `python scripts/ci_py_lock.py`: do not edit. Wrapper-owned (ci-03).
# input: ci/py-lock/gate.in sha256 7de18cd95f842ff5df52b931d6fb2f318936f54b0ff1be1c8d66df1d6706d9df
# resolver: uv pip compile --universal --generate-hashes --no-build --python-version 3.11 --exclude-newer 2026-11-25T00:00:00Z
# Every file of each version is hashed (Linux and Windows wheels of every Python from 3.11, and the sdist): one lock for every OS.
# A consumer installs it with: pip install --no-index --find-links <wheelhouse> --require-hashes -r <this file>
aioquic==1.8.0 \
--hash=sha256:12333f99f7493af4bc6b9af24f5ac45ae993a2780b9c469c38bdf4461189d5db \
--hash=sha256:14c8f0e4d7a74ee6ba3ade9434601f21ab8d6f9948f602efddbfc082d2bbb385 \
--hash=sha256:3da2c9609cd7299ee2965ff4b0df7a5d50ebe4eacd0cf50f8243686612c2d801 \
--hash=sha256:6fd3cd612aa739be38ab15005e596087cfc0ecbbe935a0343dc82f8b60532669 \
--hash=sha256:78616046a99831c55ca3aac3405b6353e79a923c67a6e5b1dd134585cfcc8e66 \
--hash=sha256:90d1a379ff0057a84863ba7d886af7f49eedfd1a14def5ba5a3ba719ab99c37f \
--hash=sha256:a17bf2347cb9f92c5ccb93fd88be65550e47db2a76e086602b226259f814b111 \
--hash=sha256:a4b57b3235014074fd7316dae5f4ee08cf46fa9b9c7bdf8718c3f310aaff9155 \
--hash=sha256:ac365806f09cba9127fe716f570219bf1fb7d733e847eef7535ade5c08aed721 \
--hash=sha256:b2acf9f4b7214502792d3430a341907f872cedd25042430f2c4138f9b7092d87 \
--hash=sha256:d9de93041c7749f1a93dbc0367408572ed76d710566fd7d74241ce7f69388350 \
--hash=sha256:eb44d2276ad670e8608bc2f2a926afc8e06f62de87275afb56d7ed8aa8a4f298
attrs==26.1.0 \
--hash=sha256:c647aa4a12dfbad9333ca4e71fe62ddc36f4e63b2d260a37a8b83d2f043ac309 \
--hash=sha256:d03ceb89cb322a8fd706d4fb91940737b6642aa36998fe130a9bc96c985eff32
build==1.6.1 \
--hash=sha256:51cc11666391ab6f092070437ac747002ff46f3e4113a3622177ee6b488bfc53 \
--hash=sha256:ecd351a4be9d35a9eaaba244a7687143c9c7d4aea6ac964e7e7ddab20cbcf4e7
certifi==2026.11.20 \
--hash=sha256:7422df25243767b9877031a2248cb14d09ddac9beee846f4cef3d5c9191d488f \
--hash=sha256:af1cb240a8133f105aa52684a3a3258339d7f2fd0bd4e2812698ff5cf5588c4e
cffi==2.1.1 ; platform_python_implementation != 'PyPy' \
--hash=sha256:046bfc24911b37851ee1b51aab8bffe713d89c68c6a057b09484ce9fd5f69b4e \
--hash=sha256:06c72bb76605a4b0cd0aad6930b69d4baf7dd5d806cfc409b824191099700e66 \
--hash=sha256:0beceaabe56af686895136a2de78db54ecd8e4046b236b8fd6d6cb61389e9bf2 \
--hash=sha256:154852545011f779917b11c78db2358d095da62a9a172b78ad0a583ee5adc0d0 \
--hash=sha256:194cffa889098ced9976c3fc6340305e43f6303657d298da55366907c05c22d6 \
--hash=sha256:19ee6127ee34de7d83ce3d371ebc5ed91addbdcc39f9ab15ce4eb35a4e534971 \
--hash=sha256:1a18a57b58cfb21fc28d72e876acf10eaed67a1ed96226f92af4df681d571c4c \
--hash=sha256:1aa5645c30469b09530c4ebca77ebf8f17618293c58f8549cb1a543a50236e7d \
--hash=sha256:1dea0e4d7d4f11f619fe8c1d76caf49e24405b4b5743c0e3be16a500ecd930c9 \
--hash=sha256:208f941bb9d18e768138677f0a6d2ce01f590df56043dda1df1535ac57c88517 \
--hash=sha256:210019b6c7cf07f081b4c54635c8cf744377001350e29cc0f81c4377b4797735 \
--hash=sha256:246fa40ce8645a614ff682e0b70f37134e460eaf93a775e0cbe3cca585a67a80 \
--hash=sha256:25792eac27877609e7bb06d42ff88278a6624fff2ba9bbb523c09616b117e80f \
--hash=sha256:27350daa11d4f10c540e6e89dada4c54feb7256ad03e9a4dc075ebad7ba360d1 \
--hash=sha256:28907ab9bfb6aa13184cfc17c6b8e1023c5ab6fd7076d8c20a35e59fe04f8f29 \
--hash=sha256:2ae64be792b8966f2c69538199728b290e34726562896df1e5dc8ffd8d8188e8 \
--hash=sha256:31348097ff5bbe827ccc41795d4dd099d9f0625e7def00ee653c137a490c2a6c \
--hash=sha256:3143d81e29e1e20a9ce10901ec369012947876596f75a222235965f2b7ae832e \
--hash=sha256:3222ba5d678f80a030e6afbcc33dc1ae5cb45facabb61cee2c7016b8432fde48 \
--hash=sha256:3311ed60d36f83378794e1009ac6258bafbf81f7888b4caa7b35a521e3f95813 \
--hash=sha256:334644fbac4eff73d985a17a91226df55d0f394160c4cfb880e084c8f7161cac \
--hash=sha256:34e261f78cb6ceaaa36f42f2613f4380d94d9c759a9c73c769ee6e0247364632 \
--hash=sha256:363e05fa78e15116c3c32c210ee36884fd6b9afa6d440e47112c3bd511d64cb6 \
--hash=sha256:398aff33cee2767e3e781d2554c54bd0dff386bb437581e0d8011fde1a942ec1 \
--hash=sha256:3d22a20b1fb1632cc72c22f95f7b0d2961c3e1c235f245ba4c606c4771035659 \
--hash=sha256:42a494cee34437f05546455144f2b5d9ac09b1face62bcfce597d2e521066688 \
--hash=sha256:42e2f76b9455f5a9a844f770bf3e200ed3da0e15f5df3db9c31fe80b04b3d004 \
--hash=sha256:42f6930c31dc7f50732c9ae793c2786c7b6b044195967bbdde40bb9be81c4cc0 \
--hash=sha256:456a61fa52d579ebf9df2e9552ead5129855dbaff6c1e5a9b1bc408809bdc062 \
--hash=sha256:471cee653ae88de62096552e6d24ccb4a5adb8c8c9f10b5054d0122c15bf2779 \
--hash=sha256:49cbc70e6542d4ccccb936558d1064a8012541e78f821f955cff24e357776c94 \
--hash=sha256:4a7c934f7360e8cd64fe9efadcbd10c7c6364f531e432b9a4bf5ccbc9e0e8b50 \
--hash=sha256:4be96343e422f2dfcd12ab5c9f5aebe03f82f737c6bffeca6830b3875cb44aab \
--hash=sha256:4f42141fc14250de6dde5ee7ea4432be017252d91f19c5ad043c084cea629cac \
--hash=sha256:507a24c282e0f42f8ed737cf048572cbf580468da5555764a8331735e9c736b6 \
--hash=sha256:51b31d1c98274844cfd7838ce00bfc27c7423a4dc00fc0772fc3331c2cc90676 \
--hash=sha256:58acb8ab8e295e6c5ea12f888cbb13cf21511ef2a3303a23f4325c29d17fe5c1 \
--hash=sha256:5a59cc1c4442bc3d5c703bf720b51138d0bfc173618807c9ee2490a7541dd3d9 \
--hash=sha256:5bb4e7ea95dcd6a014a6fef62e62467d67d8e582326443f3d68e71d6320a9fcf \
--hash=sha256:5c58fe613dc5e5336357eff555824a314d8e43282600435c8d1cb6a7a2fedd13 \
--hash=sha256:5e7cecbaadb83884793e05828cee59b210b24583b9c7425d0ba6a754fe22eb4e \
--hash=sha256:616f097f2fe415bc92a247f02e11f634e1f9e9a83d327e3c915c15089c87869e \
--hash=sha256:63bbfd5ded17c4840ac07cd8f1c21ba9d9708141f840b324f422f41b207e3973 \
--hash=sha256:64faea20f4e2613363a1a9b9c7dd73058f3ecd00133a511e72ad7c511658f527 \
--hash=sha256:661c298b4821edebead0c91edd2b00374d67ad7c5a1f7a91d4442633b79d6a72 \
--hash=sha256:68e62fe11f30d5ca8289242866f0a5291402d8529ca2178ab8afc5c9694ae890 \
--hash=sha256:6a8dddef476fab96d066d578fc88526767b836ab5ab21754e1d5bf3879c31c7c \
--hash=sha256:6e192623c49c94421616a5778fba35cf0d5a8d000650c1967ef4448ee5cdd990 \
--hash=sha256:7225e4514edb64eb6740324353e0da0711954fd8d7da4576755b1c6e09b697cd \
--hash=sha256:75f80557d1389eddbd0de2681f6a390a0c5338c31ddaa821381c203fc3fd50d9 \
--hash=sha256:770de9db11e84213beec501cfcaa013b019820ca881e03344dea5844f7876d94 \
--hash=sha256:7750c6449dff7864bb9bb27ddfb0267756189201a3afc911d82b3caacd70dfc3 \
--hash=sha256:7bde5e4cc5c10140859842b9d383af292b22639a4dffb725314baf45968cef80 \
--hash=sha256:7ce713ace7c0e4520535b42b77eaa742c16dab813978064913e5a3cf82973b41 \
--hash=sha256:7da0c5eff80f0197f3b3d1232ec5a682a9325f4ae9016a78f5f5ca35f9ced1f5 \
--hash=sha256:7dbb61fe3a7699468030f71bbe5f8a0e326a151daa91beb11a6fc1f980c55e1c \
--hash=sha256:811bd1e21d32de12efca32393a0ab3f5133b54fce9bd44b8bd77ab07da14bf6a \
--hash=sha256:8ef53b2de9bcb9197d31854256575d59dbac0cba72ac627bb291ef5eceb74be4 \
--hash=sha256:937c0052c05a31ca1daf18de3158eed4dbfcb9cc107adbea227728d647be701e \
--hash=sha256:9d2055050ea716bd38b7f7f1579c275386646b4894c155a3e2f3cd62ed41b7c6 \
--hash=sha256:9f8d177621de5cb38ee3e731eda45d421db093ec0739f46a5594babda7987a98 \
--hash=sha256:a2d7755bef5a12ed488f4ef1f1b69ee9191d7396083b755a5d2295f6edb4768b \
--hash=sha256:a48d62ab9d6f4f98c983223a547af44be6ca3691074c31cecced6facd3ba2dc1 \
--hash=sha256:a4f00aa42f75d6e4595e8866e748cc1705adc0cddfeb2ca86d0d03993d63ba03 \
--hash=sha256:a6e721d4b0e45d5b65e87534470e67b18dcd092c83f68fba09f152b9cbc061af \
--hash=sha256:a730a083190634c65cca36ba5f489531576ebd79bcd5c8e172130f6453127231 \
--hash=sha256:a931079504ecc49efed7744c476a5c343a92fabf66dec2db95edb1b2fdc770e2 \
--hash=sha256:aa9511c62d14da7aacc9b4bf51f3f697a621e83b2d6919008243c3aad168eea3 \
--hash=sha256:ab36d55f9ed2d067327667c2fea18dda018eb628dd6347aa01dda6cf1f5d3836 \
--hash=sha256:ad2c86c495b899d862ea0f4b42891b8713a3bd45dd4105c7fd51c2a72f39f3a5 \
--hash=sha256:aeae0e330c9f6acd681f647d46cefd30c29f93e3392882e792e82080c9691399 \
--hash=sha256:b0431303acaea1089ad4b3e9ce4e6518193def1118d4073ca848635ee4ea2e96 \
--hash=sha256:b5bdfd1c873d4e093aabc0ca84c4ca6dbc4f752afb5c86f146d9742580c9da2e \
--hash=sha256:baed1e86cc735622097354b9d1281406caf42ff42a886d29faa8e8d1630333be \
--hash=sha256:c1453022f490d2459a11819d83ad1d586e9ff65a12ac3e705ffebd46d3685dcf \
--hash=sha256:c26608d2222fb1e94487e4a387d85f13eb55d5ed725cb25a0c589ac4ee60e7bc \
--hash=sha256:c7659f22557c5a0bc4855cd635f55edec690cc008a40768527762cb9fb263455 \
--hash=sha256:c8c69575568085ba0b1b10c0249d779a214aea6f6522e949a0fc9fb0fcb449d0 \
--hash=sha256:c8d2c9fd1f2d16f780d15127abb050d13d1a76c03a4bd87d7e4980e45e511e12 \
--hash=sha256:ca82be1a1d406ecfe1d25dc16cb33488e5a16bf4438c9fb590484ea29d92478b \
--hash=sha256:cc572dace3f60ef98d7b12ff411d20f5362feb31a0439eab0085bbfd349982d7 \
--hash=sha256:d18e5ac0f2f03f4f518d3e23db0f0cad7faa1da8620e9c09461d443bbf6e6692 \
--hash=sha256:d28630f5854ab07ab1fd4aba756de52326c82e6be15d414b12793f1975048b54 \
--hash=sha256:d9c275eaacd24aa73f94ffd6de08fc3f932424d8b6c376f4bed7cde376fe7bc3 \
--hash=sha256:da0e573f9f97159390c89d9f1a9e41908b66d408cc5b58d08cf3847d844c531b \
--hash=sha256:dd31f52ea1086513bb9df30f8fcee9b8918323ae067a3d5b78bc826a000712be \
--hash=sha256:dddad92b554513a31f272570678ba307fb9f618f05e3d4a5eacafff9eae03e1d \
--hash=sha256:df423d40ee8654634421812bc3b196da3f9bd7d32929da813f8394c4348a5358 \
--hash=sha256:df913725b79db7bcf03448f36b7bf8815363417d5b58deecf9305e3e30f0f21a \
--hash=sha256:e0bcb7e0f677f543555d2adff3bf19c05f66cdb4796e5ff602442ab2fe3c4ef7 \
--hash=sha256:e2d65b31f36619cda3999b78b2aa9632e76b78448e7a56fc4240824200e7c4fc \
--hash=sha256:e6e8cff14d6fb0be70a09c0bdc58096f501952d04624ebf867e0e56da2df8960 \
--hash=sha256:f16c709686a78c727bbbf059f92b0bf41c6fc60deec706d2dc19f529175a6125 \
--hash=sha256:f24fb43132a4c6b4cb4eb029492919b2db645be6808d738f244fd146c03c32cb \
--hash=sha256:f53e442b08449d42821fa4a4fba000095af9f62742a500f978a9f557ec44339a \
--hash=sha256:f5cfbc5fe74540d335175b656c725d74d90e3730c626d92575eea35029d9afaa \
--hash=sha256:f81b3b8f3d4e343550fa4baa0e479bba9f2d29ce9c2e9b51d1ce1718d7442fcf \
--hash=sha256:f8ec5e643a9a937f64e1999eb9f75d072263751912dc5cd06d3c85f8f44be7c3 \
--hash=sha256:fb92203a88b3d3053034db775110081c49d28be6551923805e039924093761e4 \
--hash=sha256:fcd22650c908d7b7da162bbfaab594a1227a15d1643a98c68b122ac642fa2264
charset-normalizer==3.5.3 \
--hash=sha256:00edb7682962c596f774bfa126e6b6f885b7af2319f448d327591c284a482de8 \
--hash=sha256:01b35bec964b92b89bdf94adf931d2e80a15f1c7b93bf850b4430cca23f7a2a2 \
--hash=sha256:020cabbb90926b2d8b022a5e057ab349f28844b61f34117323fc08c2971915e3 \
--hash=sha256:02b1abf64742b2d0782172cd2542616e462c201c829c23aff833390babe2967f \
--hash=sha256:06d07272f70d9880fba32d4876e966ae4dc9961134bc989066a0901509dfd8cf \
--hash=sha256:0810592b80dc5a97f8103443460264b588f31c6baa8a20abae7c683435d8117a \
--hash=sha256:085a5d1f49eaf96596d79494fcab18d9a32db6e345da15d6debfc90110b20679 \
--hash=sha256:09833ba78c91f0d1fd06387c69dae9f079428b77ea05eaaf1553eecead31fb68 \
--hash=sha256:0b3fc6f7dd9db4a7782e65dc98eb80b2a91a854cf54a03dd93649be2f7ca638d \
--hash=sha256:0c0fe07631dce6dae788a59c20ed927adc6feeb2d9ed440747eb367d89822a45 \
--hash=sha256:0ca25f1b1167e9fb94d93d3708df0b631de241bf8440947b0cb9f8c4cb66fed0 \
--hash=sha256:0ca2da4a505fae7ef95922f8d48235b2e49ff8f10f4edcc0481e5f6526ba3841 \
--hash=sha256:0cf4cb8d75090a8da3bd30c0963b2c6c6114e791c6fc060c3cef8971497b1f04 \
--hash=sha256:106b9d0438e2ff0a0e8ebd869273fcb3640af28323bba8651c714c57efb38e51 \
--hash=sha256:11ad35a0b856ad8bbd0c9e900c069461a4661694714aa17b6e6e2e8621e1c373 \
--hash=sha256:139aeb8ca63946dc79364c37f2c9cfe5c1b7f3882f2c47484d0e54bf14b921b0 \
--hash=sha256:1714ff1ba001da5241a585fbd17a7742a61ad34efb4be8404aca5679f51e53ea \
--hash=sha256:183aee7e84789391e547ec1609f8269332b9b123d21e97f7ef79eaa474c47e08 \
--hash=sha256:1a34385837db59d5de814c9f1e0f4157b571f9ce0eabdaeace410aa93bf5df62 \
--hash=sha256:1b2704f4651539eab50ba104a975b96c3cd5246011aa0755d2dd71ac12546644 \
--hash=sha256:2246873913d7db43ed5a3d98ace398b989b2ae20b77c8d761a7bef5fdb9bed42 \
--hash=sha256:249bf0b6f43985c33c83adbbab0ca71246ec24c82d960fa00c4ddb2cfed25db9 \
--hash=sha256:256b434b2860ef9da1cb6a5fd4ebb5d600936668e50e2035858948b96b068ecd \
--hash=sha256:26c6ad87bb79628954b52f8f7b9e18ab5cd9667546712ded9689fb7677e630d6 \
--hash=sha256:277b72183b96879887f0c3aa0bdac1fee08a6c7e67bad53145c4fd416d99dfd3 \
--hash=sha256:28ba8e6361e0f319641707484994096ceb77e05c29eaad2919756218c0c89001 \
--hash=sha256:28d954a437bfa5fcdfe7ad8902cf4347a8486f34a86c5f39003bc1288eb67d72 \
--hash=sha256:2978c799237eb66619d8951d2ab7efd317414cb6682160e05614ce1c8b5c905f \
--hash=sha256:29ac44f5878142128ffe4fa7e041ddc4cc5fafe43983245b9a141908c40b515d \
--hash=sha256:2a6f937e0b70133d1f826d0a253331b6fe1a4c874808cc12e16f2fb8177042f4 \
--hash=sha256:2b7797a5b0cb197f118fd13b41c14c5a3c38dd625a87c1da58a3066cf53254fd \
--hash=sha256:2c4e0050b732ee3dca3676a5f5cf7fbd0c131761c194f1bb1d24c055fad071cf \
--hash=sha256:2e7fbd98443f28a5ed8004f0b058edcc4720a3d344adf007c0b7f1adbff2f59f \
--hash=sha256:2f2d973d3c79fbd1066d63d1bafb2ade66934c0840ed149f6fac13c3fdf80793 \
--hash=sha256:323d5cf6df3ea724afcc3bfb07c73be06d2e8200a8b6b37979a300ae1e7836d0 \
--hash=sha256:326a7a0e3715c3ac24c21e7a3b831d6799cc795bff260aa49c23b69025852f99 \
--hash=sha256:34054580168b04e90e6c7c0f6c80173fa2d4f72c4db91c9095598454f96d6389 \
--hash=sha256:366f5efe95a6149ecbcebf779c2594a6a4ff6fc116402826c72ed0eccd6aabe9 \
--hash=sha256:390ef7c7e018c0abb8c0ec2d28ee137567ff50c3706facf6d115cac832ac993b \
--hash=sha256:39229c222445415db07a0be4dff8ad1addc3126644d7aa72d73f1575b637d69e \
--hash=sha256:396fdf2d4367674531a7c8d54ecabbc8e5131e3a1a06270285eb99f3140143df \
--hash=sha256:39e019884c8f857393df954d35f42bf99c5ab85af226fe74d1410188c6fec31f \
--hash=sha256:3ce4e4587e451ebc7d9899a7a1f539ea30a3c712d7bc8e0d256923c697fd5dcc \
--hash=sha256:3e8da696ef1935a019c10ec16555a062183ddf6d5901e296edeca4b2a8f84e1d \
--hash=sha256:40b2ba91f0851aa864994b3c7022e4d96d09026717e6a72e44410d6fb3a74a13 \
--hash=sha256:45aa4ccf5a6caba138dd0f8bf36fa3e26654585d534881b62ce5e4fea2487772 \
--hash=sha256:4831fb33e98e92140fa17d4d673a9f49f9c0ddd056115b722858793e4b86b0c5 \
--hash=sha256:48f7c7f537246bb3af2b3139f44716a30b21e78c2fd1cff0f3e392fbd55d8044 \
--hash=sha256:499e4bbeb1e79b14756311a1d12cb88112f244423e152d80981d9bcaff3279fa \
--hash=sha256:4a991dbd7aec868fe10802b02bddbf898173a47ba236f2d6afb4ab1f98243534 \
--hash=sha256:4ff5e27478681ef1b13b036baaf9beaf9b4c6990e903c752ad3b8764692c6d6c \
--hash=sha256:56405211fa124c393eea14b3aeacf5b90de72b1f69b0a60c9bc40b01dfe71a42 \
--hash=sha256:581d6e7df9b58d34147e21efde42a480b5087fe54f31e42550c26321566ba1e4 \
--hash=sha256:5970d148182b6b7c22b8290a81f02fb521c4e7aee6747743b3e645db58d5001a \
--hash=sha256:5f86753952f7de3abc7ce871f8239ce4e0d32a91c84d22f3a667e669907c3897 \
--hash=sha256:6118055f4ad0d94e016eadbb86caed9caf2c9033631ed70964ba631c1336984f \
--hash=sha256:61e32fdbf56f4cd25a1efa451c8b5fe886fc5e00143ccaacafdf21f301fad059 \
--hash=sha256:61f3258f700412c68fde407e7c749ed6930e795ea8f5ead9a40afddefbec12c4 \
--hash=sha256:6423accb6ecd1456bf824bbac98ba919398523a69ee5f1680dd1da88769de866 \
--hash=sha256:643724071b01cc0369026e259850791212cc187c6031d0e930abcd253f128e0c \
--hash=sha256:656b9744bac4493561d28b56d7d646afd7a8471254ef7004d849aa8368020037 \
--hash=sha256:6651fecdac146ecfa52700e02a5fa3b3677bddf5fced4983b43e904244de3f6a \
--hash=sha256:67bb767a8de7a2b1164c74fdbe5cdc32b9c15d7142efd9a6dc77ff63da94e846 \
--hash=sha256:6b702d36c565f6c650f4b479488f475b2982132ab8d0840d42b1442462c21056 \
--hash=sha256:6bfbbb9414dd0f5b81c259deb7e50b4b44e65e05879eee482351bdabed49d7f4 \
--hash=sha256:6c80b4e83e2fbddd25fe27804cdfc45ef71bb387522caa575af42118d72dc970 \
--hash=sha256:6c8abe7d59bbc891e5080b8b142c36db93154f840c4baf7c83ad6273a1a15397 \
--hash=sha256:6dde7edd9ba5005389bc7c0ab461411f281dbacb2b06e52bd23592eba42bb503 \
--hash=sha256:6eea31136fd924ecbb4e7c4f3df4b18230409629a22b3896f38a6754d5857794 \
--hash=sha256:70f65dd0c2ed79ea2d9776096e9c7d25e398c2c03eb31877753598d201d91784 \
--hash=sha256:73b4ddf1230df56c9e7017a16e3f5171b6ef0e4ff554a418a370d7ac7245bd84 \
--hash=sha256:747e83d415939612284afdc99f15295382639c0d3fc69a73aeb84b380d1f4af3 \
--hash=sha256:7a7e5bb8974842ad747d4a2b9fb928f84c3cdbe2c2fd7e405197fc1a1badaeaa \
--hash=sha256:7c313b46730b4a68bb31450973467313b2c496fefa42ae316b86c186cba74613 \
--hash=sha256:7fd816f466883dcaac196ac77271d0292eee4a81f4db1191b95d15328f335937 \
--hash=sha256:7fdd11094a0b07bce306b359fa7311c71d93466d967b3b345f2e9f03d8b2c959 \
--hash=sha256:806e72ebaeef54d7faa03414be9e8409eb3dcae49fba089d62063a60c0b5a4e5 \
--hash=sha256:81132eaffa984f0a399233df4cd383caad18e8cadc6c24c568cf9324732a9768 \
--hash=sha256:8231365b03b702b516aad35c9515694177ac31c9dc6240326f07308a4c45c708 \
--hash=sha256:826d82356907350f345cf0aa744d43a69ac7948bd60f460f997cde86928beadf \
--hash=sha256:84356c7b7ddf090e3e4692cb99fc820e6189b5f6662ca7e8589f41095cc8efca \
--hash=sha256:87d5a237d6531c654e7b9b319be9ba7e368665c466e02a03cfd4d3d77730782e \
--hash=sha256:87f7d6c595465a25d33fa3d5215a571a98c4cad00ead3ad18ebfb62adb3d3e6e \
--hash=sha256:885f202d6e4e2298bea9802ffc6d8c7dc45394199a8dd9e1492f05fe32dce311 \
--hash=sha256:8b969f0309de905101bc3d2471c112e9ccbba711a7590b12d51f372b4163688a \
--hash=sha256:8baddc6349faf49edae4d1322f12b681b9e86acacd01874457c997437ef4ccaa \
--hash=sha256:8c4dfcd3269f13dff7f29f9c332d54a4a21f17be818b49e769e111befd4d39e6 \
--hash=sha256:90b1ff6cb9c7a204a3b79b1b0ed6ac8a1d8fed3b6dc69e50ae5de0f358ee81d4 \
--hash=sha256:92bf85ecec3ad6374ae50d870bd1deb34de12bc1158b5fd09036d4c435c6f58c \
--hash=sha256:92ddc32b6a1508ea145f4f7995e00666db454b8fd3e2cae6c2ecbde4f4d44616 \
--hash=sha256:948fb3649416a70bcdbb267d79c7048e8aa16e989ab9da09f416e67cdd3d6b8c \
--hash=sha256:94b595e64bc2927f679774de50df340b7828dc1c07c99149ba7c2d0828dd8bf3 \
--hash=sha256:94c9d5d91c16554f6397b823d9e47181ba100d830ab16b5d720adc229e17b2e2 \
--hash=sha256:9510da88bdebc903be7844f31523ac8d7b3f63e167db54b6045104a2354afa6a \
--hash=sha256:96387278c3b17bc1170f80693398d0babac7b41df128ced8e27588a7155d95b2 \
--hash=sha256:96e268b0cbda016ac519513294fcd17032264085b600abaac58b93049477e132 \
--hash=sha256:9902e80096a94cf70fb72d12ae40e3b187b40e96fa722873d4d62afcd0333c46 \
--hash=sha256:9a6b95b1737f9b5942c35676c52db0c302d60fa806efde3fc2d9f54247ecf4be \
--hash=sha256:9b887e8a7103ae2171dccbab00a4bb2bf1560f5c10c28227e5513bc90a608cad \
--hash=sha256:9c1bd8321a840729a6b2620774cf4000fafe66c54cac9064972a10c4f607794b \
--hash=sha256:9eba4613d45b49196af04a5cbadfc5e9379ba94aac85184b72cb1107ad31af0d \
--hash=sha256:a094178c51530c9ebd1775e72d160af0eac4be244fb06ff1b6f182128c71903c \
--hash=sha256:a09ca76391f6e17b12d55c1068b4b5f8f6c9b44b432d936075372fa12782292d \
--hash=sha256:a250888753faa289e2997962fbb17c4960cbdb58575533ca6fceee68c224bdff \
--hash=sha256:a312fedd182357f2c22f066d17dcd7413b6a205ee3d063d36950e94e3019d3de \
--hash=sha256:a36bba41dc7fd263417688c4daf95a1091f93e1f6957c0f71ad7798907c5a10c \
--hash=sha256:a3f4044dd5d2f7b958be6b9903cb432e6a0fd944d673707ca5cab68137d0592c \
--hash=sha256:a43831574e14423103d69fb1357e76e4f2347041c98e8357ab88ef21812e80d9 \
--hash=sha256:a491d4afb361aba32d55d7df7ccde766a3aa9a34c002d2c32c2743bf6e77c13c \
--hash=sha256:a5a7e0326566759f9a7bc44f4b9a179cc40a297e09e759b0bc7c848c06347527 \
--hash=sha256:a6eba94fc00d899f8d268712772c8dcafc40215aa9b51701a397afc9426e012b \
--hash=sha256:a8f92cc9080bff47555c79b88e7fb8655438ce3bcf29c5f01ed2ed5efdf174a4 \
--hash=sha256:aa2476abf8669be493689634bdb79f468a6fe57b005a5126db7e9f61d1954fe2 \
--hash=sha256:aa8be1f24fbc03a07cfe002b70ba0716effc6b3011fd9e5560ca399d3d0605ad \
--hash=sha256:aa9390d89822dd06f9920ae3038819cb121643a72f4753b2eee1a79b2f1215f8 \
--hash=sha256:acaa0e100f39287dc5d13de96e33ba0786f1cdfb5b4ca28918913ab0eec3af72 \
--hash=sha256:ad1becd776f5a41a4d91cb9ee51778f4fd687ef15e4919779e00a33c6cff6948 \
--hash=sha256:af217012cfdaf6ea5dc0c538aac29b7bd030eb865056cc60f1d973b982b7917b \
--hash=sha256:b013417037c931583578639cab2523d5a2efc35a584c192d07f4c909b133f6b0 \
--hash=sha256:b0aa6b81bc632af7cac7b270c933298cb5ee858506dcf344e0da006667e0c351 \
--hash=sha256:b30e5496e453ac971bb17f5e096b84fbaae16d09e2613f6148ff528c08a54a0c \
--hash=sha256:b66a0e045cf859d7418f26a554509b65f21ebb6d90a95152460781939e8264f4 \
--hash=sha256:b6dad86d938104f9d43404029e5fc8392f82762d171933be4f192a6008bffa53 \
--hash=sha256:b6ea5bf7e3c39f6e56957d82274ac7cfab469590085883fdbc86e754cde76b11 \
--hash=sha256:b8fc4fe56992b089d6177021fe6db641321bb2bc2fc7a1abf815c29a80ca2137 \
--hash=sha256:ba26e4d073a4f7f2594676f2ff20ab80a7f03332b81c3f9964e9e53bf2305329 \
--hash=sha256:bed05639ae1bc23df7996a4fd13ea5064ddf60dc7dabd754f8badf060daec63f \
--hash=sha256:c08e06fc69750827d7ccebba63ebc97a85e479cd5c9dbdb80f5e08a77b774fdb \
--hash=sha256:c39a4fe28a16e8fa667c55c154f62c6c3cd9ca2491cca9f16330dd7360d05b76 \
--hash=sha256:c437ed8775d201d37206f37d233f547506e3aef60b9711584c65444c686b4905 \
--hash=sha256:c43d9737c3b85ccd16b1862b1e7aa5c4bf30a6033068403713c0a2bba5bda979 \
--hash=sha256:c9d1f467d121b33b06865c94ed5ed8388a9ef76f5e1acc1c8a854ac653493f5d \
--hash=sha256:caefc441edff6070a9f9749ca880a22731a1715d9e74b24304a546eec44bfc16 \
--hash=sha256:cb18428af7399e0a6f7e3b45f110d57a1a47cf07fd4b3ce50e2366d99a38959a \
--hash=sha256:cb4c25a9d3410262216b5c7447e51bfd2de0efae0a7640772dc6d2a8741590de \
--hash=sha256:cbd09b22b340f846671e79e8d832167fac60c1884be4c71fd667211486a3b58e \
--hash=sha256:cd5422fd4f8a7859846c9289e310dd95c0d1890c31819667942753e510f88f69 \
--hash=sha256:d12571adb9ceeb9ba0640db46433430062f5f1dec89e39713a2a5a8ce3016c37 \
--hash=sha256:d1b7a3fe4cf679eb3870b91b86b8ce12cacd5cf4d74bc114864a5cd65319ddac \
--hash=sha256:d313494077f849d8199f36166947785da1eeb36335fda15fde2e8f801ef271b6 \
--hash=sha256:d3c9d5284d64f4c1015d95b751577b260fd6d14e3f8edf21710f4436e7ac4c49 \
--hash=sha256:d4e7ecaa25f0dae672ac783c2e5aa9054a62e011749d64ff47b887af360a3e82 \
--hash=sha256:d57f1b6affc3581fbf0bc6d783cc60e7c9957adfd9c7b89f8a9f3573ad1cd49a \
--hash=sha256:d8f85e019c9f08ec134648a378ddd3f6f073c1e4b5ce9bdacd9a9e7b60749cd2 \
--hash=sha256:d93403a13c8f6f2d027185d90ab695e81d95e3ebd000f0078e201a1c3159d4d1 \
--hash=sha256:da606e3015dbd4b9a31c0468898a0c4c998846197ddfda78308821dc8c9e9be3 \
--hash=sha256:db2eedef732424346f98d0aba5c6ad688b648bc79847f4cc70dfca830130b1e6 \
--hash=sha256:dbdd407104ebf2360464ce02c7933c6ffac58bd5b64cdf6ef7dc0e787e782aaf \
--hash=sha256:ddea089587432e3df6771a4a405ef249cc9727f7becb1de3f00ab571b2432002 \
--hash=sha256:dfbde696fb427301ec40cd82b8eec0b528e44c6af8239f33ede2b2552d9a085a \
--hash=sha256:e1cdbde56f9fa6d426b78941c381e2ba160c1214809baa47e02c1d0d8881d598 \
--hash=sha256:e282983b8def5ada758fa1f18bf9060bb8ce6cdd73be32f62a2de59820d3286d \
--hash=sha256:e34f591669498a03cd70993b0a79b9f0ef40c4e6f8232466bac33c42f0c15742 \
--hash=sha256:e405cce4170de1fe520d9a92de9d7ececc23dfcf6888c62ab608a21be50838eb \
--hash=sha256:e4a0f2adf29a69dd8fe58e42bb191f3c87067b05fcc63279983e8c9ce5092abd \
--hash=sha256:e4f85c34f9be32ec5568a0668fb8bc029d3e729285fb8fccc38695e185379a9b \
--hash=sha256:e5e4785d8a0adeadfbdf75f4efc357911842674651cbafd7e97f69b11ec3cbc6 \
--hash=sha256:e86a27ab632d2e888c22b79263864eaff8b7dea9e87328a9bb0ea04eff24786f \
--hash=sha256:ea880ae1a692ae694c11bca7be74864614ff1a58bdfff4605f36d1956b4b1588 \
--hash=sha256:ee9de080e8d6221bbe4ba2667367b1cee0f47a53f60ffc5e431b698cd2f2b214 \
--hash=sha256:ef8b925f2b331a1f17d6fb32625e09fd571cf41844f578379f934dab0067cf0d \
--hash=sha256:f06e257ee0cc85a7e4ec44f171ae2595fd901c34212f3c9e7ab8fd8621401e99 \
--hash=sha256:f1214052966421a88ed526ba93e4463b39346862fa4721be5306434b33dae795 \
--hash=sha256:f160f03e15bd1e3c35db9bfc20c42ff83155d37f9b0c79806cb10051ca725f13 \
--hash=sha256:f1b357340e4cd29011683bd81226175611ad835fec22e5b7df83b96701571226 \
--hash=sha256:f39290a0c2e3f4196563189bb45e6ef5d5badf50864e1bfaafa9003f0595573f \
--hash=sha256:f5a5c311e5de6954c36230a37863b5ca58ce232589bd637ad2881c4056897b12 \
--hash=sha256:f7a841170fde40b0e1345884bee09ceca7db49a9291fa340089bec66a366c243 \
--hash=sha256:f7fb9a3275f1a1528e542a0f5a3d2c89fcaf68e797fc5c6530434cbd92a852c4 \
--hash=sha256:fc540d1618c5638fcf5aea97060cf011467918b010bf682a84ecc0c9474e6cd0 \
--hash=sha256:fcb17f1d40c38912a2cdb56ea47aadac3527cd0b06fe24f3a0c4896febbea063 \
--hash=sha256:fd0341b9dea133d187d7c5a2cd7e21ae6449a7b68ea8c2454f9cf77def11ec1b
colorama==0.4.6 ; os_name == 'nt' or sys_platform == 'win32' \
--hash=sha256:08695f5cb7ed6e0531a20572697297273c47b8cae5a63ffc6d6ed5c201be6e44 \
--hash=sha256:4f1d9991f5acc0ca119f9d443620b77f9d6b33703e51011c16baf57afb285fc6
cryptography==44.0.3 \
--hash=sha256:02f55fb4f8b79c1221b0961488eaae21015b69b210e18c386b69de182ebb1259 \
--hash=sha256:157f1f3b8d941c2bd8f3ffee0af9b049c9665c39d3da9db2dc338feca5e98a43 \
--hash=sha256:192ed30fac1728f7587c6f4613c29c584abdc565d7417c13904708db10206645 \
--hash=sha256:21a83f6f35b9cc656d71b5de8d519f566df01e660ac2578805ab245ffd8523f8 \
--hash=sha256:25cd194c39fa5a0aa4169125ee27d1172097857b27109a45fadc59653ec06f44 \
--hash=sha256:3883076d5c4cc56dbef0b898a74eb6992fdac29a7b9013870b34efe4ddb39a0d \
--hash=sha256:3bb0847e6363c037df8f6ede57d88eaf3410ca2267fb12275370a76f85786a6f \
--hash=sha256:3be3f649d91cb182c3a6bd336de8b61a0a71965bd13d1a04a0e15b39c3d5809d \
--hash=sha256:3f07943aa4d7dad689e3bb1638ddc4944cc5e0921e3c227486daae0e31a05e54 \
--hash=sha256:479d92908277bed6e1a1c69b277734a7771c2b78633c224445b5c60a9f4bc1d9 \
--hash=sha256:4ffc61e8f3bf5b60346d89cd3d37231019c17a081208dfbbd6e1605ba03fa137 \
--hash=sha256:5639c2b16764c6f76eedf722dbad9a0914960d3489c0cc38694ddf9464f1bb2f \
--hash=sha256:58968d331425a6f9eedcee087f77fd3c927c88f55368f43ff7e0a19891f2642c \
--hash=sha256:5d186f32e52e66994dce4f766884bcb9c68b8da62d61d9d215bfe5fb56d21334 \
--hash=sha256:5d20cc348cca3a8aa7312f42ab953a56e15323800ca3ab0706b8cd452a3a056c \
--hash=sha256:6866df152b581f9429020320e5eb9794c8780e90f7ccb021940d7f50ee00ae0b \
--hash=sha256:7d5fe7195c27c32a64955740b949070f21cba664604291c298518d2e255931d2 \
--hash=sha256:896530bc9107b226f265effa7ef3f21270f18a2026bc09fed1ebd7b66ddf6375 \
--hash=sha256:962bc30480a08d133e631e8dfd4783ab71cc9e33d5d7c1e192f0b7c06397bb88 \
--hash=sha256:978631ec51a6bbc0b7e58f23b68a8ce9e5f09721940933e9c217068388789fe5 \
--hash=sha256:9b4d4a5dbee05a2c390bf212e78b99434efec37b17a4bff42f50285c5c8c9647 \
--hash=sha256:ab0b005721cc0039e885ac3503825661bd9810b15d4f374e473f8c89b7d5460c \
--hash=sha256:af653022a0c25ef2e3ffb2c673a50e5a0d02fecc41608f4954176f1933b12359 \
--hash=sha256:b0cc66c74c797e1db750aaa842ad5b8b78e14805a9b5d1348dc603612d3e3ff5 \
--hash=sha256:b424563394c369a804ecbee9b06dfb34997f19d00b3518e39f83a5642618397d \
--hash=sha256:c138abae3a12a94c75c10499f1cbae81294a6f983b3af066390adee73f433028 \
--hash=sha256:c6cd67722619e4d55fdb42ead64ed8843d64638e9c07f4011163e46bc512cf01 \
--hash=sha256:c91fc8e8fd78af553f98bc7f2a1d8db977334e4eea302a4bfd75b9461c2d8904 \
--hash=sha256:cad399780053fb383dc067475135e41c9fe7d901a97dd5d9c5dfb5611afc0d7d \
--hash=sha256:cb90f60e03d563ca2445099edf605c16ed1d5b15182d21831f58460c48bffb93 \
--hash=sha256:dad80b45c22e05b259e33ddd458e9e2ba099c86ccf4e88db7bbab4b747b18d06 \
--hash=sha256:dd3db61b8fe5be220eee484a17233287d0be6932d056cf5738225b9c05ef4fff \
--hash=sha256:e28d62e59a4dbd1d22e747f57d4f00c459af22181f0b2f787ea83f5a876d7c76 \
--hash=sha256:e909df4053064a97f1e6565153ff8bb389af12c5c8d29c343308760890560aff \
--hash=sha256:f3ffef566ac88f75967d7abd852ed5f182da252d23fac11b4766da3957766759 \
--hash=sha256:fc3c9babc1e1faefd62704bb46a69f359a9819eb0292e40df3fb6e3574715cd4 \
--hash=sha256:fe19d8bc5536a91a24a8133328880a41831b6c5df54599a8417b62fe015d3053
execnet==2.1.2 \
--hash=sha256:63d83bfdd9a23e35b9c6a3261412324f964c2ec8dcd8d3c6916ee9373e0befcd \
--hash=sha256:67fba928dd5a544b783f6056f449e5e3931a5c378b128bc18501f7ea79e296ec
greenlet==3.5.6 \
--hash=sha256:0616b8f878098c5681fd8f0dc92d887551717402342a70f0abcbfea5f5ad8a44 \
--hash=sha256:06c0e933290fba8ffe53ead4ae1b8044b0e9754b75cebf381aa2bc3e50d82fac \
--hash=sha256:128813fc29f2336a21b4d06eedd5e16bcc7ea46f59e9ff1cb30ea70e48195d88 \
--hash=sha256:188bf333769b7145e2b0b4a7f09615ec550ed44d3a2a8395fb7b36f0e9901e13 \
--hash=sha256:1c20ea32a73d17b9b60e3371240e17b0068120c98a5ec01a224a7dd8c89733ba \
--hash=sha256:2ab5f42ac6c238eb71770715e6e909ad9a1a92b6c681ccb64cd5a0f07edb953f \
--hash=sha256:301102a49120b095e72a7838792b41233975fc1c155daec6d98f81c00c9280e0 \
--hash=sha256:311018b46472fb26ee85870847fb89eb64cc8aaddb617400789d87076f7cfeec \
--hash=sha256:3ac3494c381dab876cad7d0b22f3a722f3e0c8deb3a65b9e7f35ad7f58b8fcb3 \
--hash=sha256:3c6dede9133e1da41d561bc3fb14e92b47e2ce39ae60edefaad145658ea7c5e2 \
--hash=sha256:3dbb4596a6a4e5d47121a33ff20533a81e60f302d9e67b69909a8bc21a43f0a7 \
--hash=sha256:3deccbb57a481e3a408fe61cdfd5c13e0678fc0a30fdd09597917ca87b4be877 \
--hash=sha256:45663c01a4de48b9a64a2ee1509d92d1dfd3afb02b2ccfc9333029d11aef996a \
--hash=sha256:45bfd2b51e38aaa5f9849f114d9c7c1d75f69187c849b3549cd64c465283abfa \
--hash=sha256:460e70b033aba8ed47e2ac9b5d0d2157b05a34fbfa30a241400aef4118902cdc \
--hash=sha256:4fb8e59f68845d56c23c031dcd79c329f345e4a9d2ffac91c3d1ab366bdc457b \
--hash=sha256:520648db8fb92eef7b3e6013f5a6f901cdf0d6685f639c2f7a245879f865bef7 \
--hash=sha256:5599b380c1f28efeb724e81569eac80cd92f99a85bd9775456caaf3225d40b11 \
--hash=sha256:59deccd347735a7774223b05a93773fddbb298aba3cea21be4337fb4752dbe32 \
--hash=sha256:5a0b2791239c99992a86c1b635b787fe2a877d9eaaa26f8891ce943832b585ae \
--hash=sha256:5adcbbfe78bdc242c71740a02e0991cc1b2f34d33c8bb15ca45eee8fd1140942 \
--hash=sha256:5b602b4201b965a8354d74e232364a66ff243dd142e350d035f46169bb36e13d \
--hash=sha256:5bbda3c70dd35d60671bc33b01916802707a052130d9e50cdb871d34594d35cb \
--hash=sha256:602024dae6d77e161f4b89491b62ca1d4f19949d79d47b2db057e476d21179d6 \
--hash=sha256:61a61b4a95a4f97922c3a6f5606d3e360851584bd47e500a5161373c53810e3d \
--hash=sha256:63aff70fe5aac59c72215f42ec39fcb59ff46774fa966e717f8ecb6ee2273577 \
--hash=sha256:71890d5247020c25c21a6b65202782bfc281d4e6e244842419d30e3492bb6dcc \
--hash=sha256:73a29b5ba642e35433166a03a3e02935e7238c4b3467fbd77523b99edea23e5b \
--hash=sha256:7969bffa322c097bd46ae595ada6a931cefda613f18ba64587e9cff4cb320756 \
--hash=sha256:7ac4abb3877c43af320392c664774eef6fa2cc063c79a55fc02d844a3cbe7395 \
--hash=sha256:7f731ebac68ea06d628658295cb2d217b10186329fcf9a3b6a149045059bf92e \
--hash=sha256:7f924a5a9d5890649566f2f6682e0d8ad8ca23028bacffbbac36dbd7fd680176 \
--hash=sha256:874cea8bb1ec1ddccbacbd027856f6bf496f6bc18aba97a918c20e067edab236 \
--hash=sha256:876077e7ebb8c84ed068e2b23d4c62ebb010d60df84b9591af1be2f39010ffb2 \
--hash=sha256:886bcf1870af74c32bc310fd00a6b803445e17e51b7d5a107c7b35c0f362cc16 \
--hash=sha256:8b27df301f56e3b3d2298095c8f7d6b68f2521f6b1693e901fa039bdbae34424 \
--hash=sha256:8b7c73d1cef3d9ae963e9ff03f6222df43efbb9054ffd2f1969c935b7fc84c02 \
--hash=sha256:8cda13494d86a4f12429641117cb6ac4bbbc9c30a33f711f7d3a2e5fbe4b0b7e \
--hash=sha256:8cddea1b8339451c2fb3388e138347b6126744f33b611bdb55b7357361cfef46 \
--hash=sha256:8dba0129b93e7091dfefaf4cf7000172741bff7f47bf6326fcf17f32fbb54d6b \
--hash=sha256:8e67c43bdfc88d5fee6db0d3e40175b362fc95fb85f0412d233b9b203c53a575 \
--hash=sha256:9133d68624b1f2e89ec2f554d56aea8a5b0d7168cd9320200ba58d4d794845a4 \
--hash=sha256:916f92f2a8db10508f739d0b5e00b83defe5d1115a997c54532a6d7cf8c95404 \
--hash=sha256:9297fb9c39b9a2c039dbcd306c410bd6906b95244dec3bba4318d36c718c164c \
--hash=sha256:95e7c44d072db623a1aab04ce488cf9533294a77ed9d072cd503a3596f4106ac \
--hash=sha256:975736b002ed080d124cf81a79cb7e05cb26d6b3f5c7a7b651c0fcce70353aa1 \
--hash=sha256:97c5a53e8c1754df58e73f047a99e287d4da1bdfe64b0072fb25c87000897951 \
--hash=sha256:9a09d59bef1db94f384b5bcc2d523694d338f3df6b757aeeaf7baca5d0c0be88 \
--hash=sha256:a364c1ea75dc51b83a17f52fe0c79cf8bc4ddf740403bebd4581c7666eea017d \
--hash=sha256:a3b4a01c6da07ef9f80d4fe8933b994bc99747bcea3eab0330a9c34d3c12655b \
--hash=sha256:a5876d0a60355af98d535c47f6cd6eb0f8a432396dab26845d380b92f8412422 \
--hash=sha256:a6a4b98a9132e0f45c9fc245a63894cfd8c45fb7a0d6bffc5eab3ec327cf7324 \
--hash=sha256:a6b4ff33f7e011bbaa148238d131c4fd4f8afbab3c104ddfbdb2b12b74ff7016 \
--hash=sha256:a93ee7c6e8fd0f8a83525a51bd777be57ee17787e91d805bd8d6faf9dcada18e \
--hash=sha256:b374e79ffa7511afc11773aef40a4ccea6191fba1c856ea2f9c56738dca69d7a \
--hash=sha256:b7d501d5eb5d4f67207df364752ad697465b834268744be7581c18d81d35d41d \
--hash=sha256:c59acfa8eb73a1e0d484392dc002bdf001fd4ce73394e0132df3d1ab6093d7cb \
--hash=sha256:c75116c9de79949de23006e2d9b35ee82874c594fcf5c0311b439acaa14b8441 \
--hash=sha256:ca80a49b53ed1d22f7282da7255f7bb2fd1935fd0f623d8613fda38745f18961 \
--hash=sha256:cad5782f93f7f738b62c6527b6f32a60694d924029f299a8b524758cfa53d815 \
--hash=sha256:ccadce0130fd813ec86ebfe969a6c58b42acc1d0fe55a47525375b740e07b605 \
--hash=sha256:d701eab36200c36224833d07dbdb709adb7fd4253429548ddb5e547b8ed40586 \
--hash=sha256:dad3d233d441a022c1f7155f0fb9d5aff7b97c1ea8c7dfa02cce586b16ab2d0b \
--hash=sha256:dd0b83bed3405b586a3133629f1d1a5bc7bfd64822a3b7ab342bdc68e6dbc61b \
--hash=sha256:de3de000d459402cda015068fd135aa50c0bf6f2477a80d4da1e646f123b4e78 \
--hash=sha256:de9923832f2d8c1a5ecd8d7260465a6ca5a86888a0d129e3bd5cf0406d2fc5bf \
--hash=sha256:df19e2d0b1620039af5102563fbd96e8938c7f5c3f5828528d641d9fc585525e \
--hash=sha256:e85880b538e59a59f55117b81f208a6660ad5ac328aad9305f812d9b8bc67a0f \
--hash=sha256:ee7d9da3bf493909cf811a3f038840cb34fab5ae2956b8a263919f6e289ab188 \
--hash=sha256:eed88b64a5e5da72d6a71cdc5aaeefaa5ced9b748f8d19f89800b339961dad39 \
--hash=sha256:f0ba7c2a329d650628f4c8572fd1db29f0a59dd70a3e3e0710dcf18a35cce9d8 \
--hash=sha256:f8e63209c3e1e828ee6a457529b4a6d8b05d050fe0ae03a7ae49e967c5d312e0 \
--hash=sha256:f8f0bd690e1a41294ac87905e8121c81a3761ec2583c768f13467428606c8c7a \
--hash=sha256:f96f0e30b5a95c7631b12bfe214cbc90ec8fe8cfa36920596c10514a65743519 \
--hash=sha256:f98e8215e172f567ce80eeaed9107fb4d32b6c44f26983d9b8334658136a205a \
--hash=sha256:f9fe868463ec7e1363733af77e38a5fda3e9b63940337048c945d69e0c80ff24 \
--hash=sha256:fdacf26402389bdd89857ad3c045a26fe8f3314f9a8b28226f82f88463a65b77 \
--hash=sha256:fe3170a69fe039b18ad18171e66faa9a75f6fe9d78f968fd9b54e09fbd714d81 \
--hash=sha256:fea4427d1ffdb3b523d7daa6712038428a4c16c450b9777bdd1221cfee0eab49
h2==4.4.1 \
--hash=sha256:0e25f1462b23c9cb82d9eb02e28bc706dac2a68cb457c6a0d74d63c8a2a5d0e6 \
--hash=sha256:4e866ffb1a869ae14dd9b5e6beb5c24a13da0495ad72b65925ded182521c1516
hpack==4.2.0 \
--hash=sha256:0895cfa3b5531fc65fe439c05eb65144f123bf7a394fcaa56aa423548d8e45c0 \
--hash=sha256:858ac0b02280fa582b5080d68db0899c62a80375e0e5413a74970c5e518b6986
hyperframe==6.1.0 \
--hash=sha256:b03380493a519fce58ea5af42e4a42317bf9bd425596f7a0835ffce80f1a42e5 \
--hash=sha256:f630908a00854a7adeabd6382b43923a4c4cd4b821fcb527e6ab9e15382a3b08
idna==3.20 \
--hash=sha256:a7db850025b95ded1eae8a46181a1a6c56c92c96f0e2b005d9ff8dc0210cab44 \
--hash=sha256:ab7ae7122974553370f0bdb919e1a960b2cd1bc1ef0276416d896db81c14582c
iniconfig==2.3.1 \
--hash=sha256:67f4b9c50da0dedf52af349e7749a80a9057a5031199791b906c3bb3ae878960 \
--hash=sha256:9121e2c1fdb355232495be3194c8dfe87ccc2d5dee45947b78e68f499790d7a7
maxminddb==3.3.0 \
--hash=sha256:02cc5c537c4114e28d016df20038782bb58ac8b2ff0c2b565c98b2d98b5f0fe5 \
--hash=sha256:07319eff57ffd7098e03134617ad5c7f914d142e480c8c94e03c1f6de5fac730 \
--hash=sha256:0bbe7c13bfbd2f31b07814af15aa3c00143f8ffb0d29395b9eea1be6455961e6 \
--hash=sha256:0ce3807a0152b15d3f21786df65b111a8125bbf6791116f8f7fc4bfa9400f1b3 \
--hash=sha256:0de3312ba04de27cadb94cb929a70e4e766e2c6ef2e03c7fe00d539aa37ac0f3 \
--hash=sha256:0e0ee21668fc19e363220f3ada0c711840d9a2113969196f72f839e693e04c71 \
--hash=sha256:0f5eb14e7aa94cd0a527d2204eec5300990dd625312ebc149fc3404dcaeeeb98 \
--hash=sha256:0faf21b6af26e16714c1a5a3bc25ed33fd54e36cc569a6d237fd933747c2bf88 \
--hash=sha256:1522beddd9469584592259adbeb7a8e9c245c711340e3d69ec119455122cc6d0 \
--hash=sha256:1ae6c42bb73a1d1fc49c444968226d7badc692da325bf7933fdd4914f3594f99 \
--hash=sha256:1d00629a61610b79049c58a038f2b153b753a3c49705feddddd5794e0fdb8ffe \
--hash=sha256:20f49792c0cbcc7ca471beb4fe2d672166f80214d995ca1904f7cdee9ec22a7f \
--hash=sha256:21f4f14eb7952be84ad8545c47b3dc6f74ec9c9376f558bfcc3010e8f39ab698 \
--hash=sha256:258dae2eaf1d41fd2cec24c35f4416db1fc5f229bf4e166e48b95ec63a56a14c \
--hash=sha256:27dcb821921058222f482a07e0197234acb20115f1d306ddc6a8366166119016 \
--hash=sha256:28dc9fdf062804d4f45f2a1db22a53bca4efb0a7819a91135e66f5a3128889f2 \
--hash=sha256:2c2ce11abe1e95024a89c94760363018117991c5beedabba31bdb8919233588b \
--hash=sha256:2c5b2e1d004bad06a5b69287b2f5e9dc62e627d53687add975fa2eb89e8935bc \
--hash=sha256:349efe73c27482bc2cf8102a54afbfb8d9edb354251f92f153f68ba37b337c90 \
--hash=sha256:365d4f1e278062669e67911c83a5e6cc0b6a7056eb809dab9510aaa2f3598039 \
--hash=sha256:3a04a057569c7a25f22bb09d2eb3642afdd68229f553d1fce45a5671ecb10933 \
--hash=sha256:3a9e909ea42c485f36827193a0c2e308b2507ec9f3dcc20a15007d9311da917a \
--hash=sha256:3e644605506108fc186b51cb4b8d0689a9b6e645e437d3a0d44aa9eaa703c929 \
--hash=sha256:3ff1a4df2f3bed1e59cc2e6d133b5958cc8ef0809099ea1832ef9254a512e704 \
--hash=sha256:40b3221611c5e7f4e2ea763f126750f0d07cd9008cf4dcbd2be556e2bcfef1df \
--hash=sha256:4116b442797b7abe627e0602a2bd18962f6334b6de9c8ac84975be1b1275cf57 \
--hash=sha256:41c76b7477242d750ba445cc546ba4f35b5e0c25697c5152394ada7a1e09201b \
--hash=sha256:467dbdc1057ef3654d67caf5786aefca06875601620d9b82b431863d95caf29b \
--hash=sha256:46bf4d61e7756c05eeaded62f1c4972937fd1f78565e2506a186819ba066b46c \
--hash=sha256:476f017ef7de4297c67e53e2f09797e467932192308e7076db5b1e92c875c3db \
--hash=sha256:49c265a28764299c80c42c571d61d04c636a2a2ba12cd9b03ef8ab7ba6da2405 \
--hash=sha256:4dcc5db21722eda1ef390da04ac07b404776f9883c04266ebfdeb0bda2d45173 \
--hash=sha256:509249b07366262792532ec08191eb342a50310001ce9a14ecb1750b82392f10 \
--hash=sha256:5a3a7921ab8c3d9ee885ece3111b91722fa5a376413de10caff61331108c6714 \
--hash=sha256:5c35330ff224d61c10a3d3b3d34eeb9b21cbb1639a8bfe7a7a8dc9eda745ca33 \
--hash=sha256:5cefe4162a1a61dc4a9e2b9dccfe24bc6e5e5f49f713f6d4fcb062bdba1bb326 \
--hash=sha256:5d07281b67c3db198073780657e452a7d75664bddc75b462246335569475b8d1 \
--hash=sha256:5ecacf5d13421d5222368874e98bec96b634aca4743f92384f0aead15fa16147 \
--hash=sha256:5efc65479e474059ae7f85aede693ad3a8e31c255437d39aa03528dc17d369cf \
--hash=sha256:5f82f74e1e15cd828a55ab392d0fd80d4fc6d51eb31b5262d3481b7027c18efc \
--hash=sha256:610fc2a2e62037e4b23b17391897b63be600fae99a92a7ae68169c73e7a4a4ae \
--hash=sha256:61acddb7247a405fe944368574d44e11bc0d1dcd6b61008abab75d0f5472e6bd \
--hash=sha256:6267226f6664c3f0260841295ef0c9af70a6ba05b70f2dc7475ac560aa3fbb90 \
--hash=sha256:64f2d3635d2cc9dc5271d84c4d05a4577b60e10abff5af52b2fd6b60959107b8 \
--hash=sha256:71aba1b8f867e62724beae2a23fa92cbf4276375067abfd225d0ac1f021ee500 \
--hash=sha256:7a9ad4ddddf7bc20798975a1171cbccf7c0f50cecb3e86be30659253d2d8bee7 \
--hash=sha256:7b81da613941cc7d9e82db57c1772f6bef5c100954cacc7d9876232aca59505e \
--hash=sha256:833121c30e701edf8ac2464b1c310607e51a3f54c0f26b2b9922344f363e596a \
--hash=sha256:8827cd2d85ef250460d9dd96a0e67c57ef8deaa14599caa3f06e290cc1838389 \
--hash=sha256:88d6c904009e5bec0e6a38ab5dfe421646a0d14f7084fa86a8b36142117418ce \
--hash=sha256:890bc8115b8750fa4af1cd548b1064e844f4804ec39527b11c794830bade51fd \
--hash=sha256:8ab285825e128d211f31d11a46517e44235bf5dca79cba9a2cb1f10bcf99ad27 \
--hash=sha256:8ab7572acf78e2ef8d630b667a0b85690278221cca76339803488fa6c1272786 \
--hash=sha256:8ac0f9fdd7e27f5b9815684616759bd6fb367bd37cd7f4217c5aa5c0541f0aed \
--hash=sha256:8cb0027692908d9c302ba8dd0dae0eb8a9955b7ccf72335b4651ef66778df284 \
--hash=sha256:8f12c30c765cd6181bcd91affc2f0138f5364daff567f4672a9ae7b77e631480 \
--hash=sha256:91c1cc2989d4e392a37c26de67505a79ba213c90eecc83740b7c81e2df3e60db \
--hash=sha256:9639ca7810411293c9c576ed9843d3e7a8666474a1371fd9982a6f62728e6c35 \
--hash=sha256:99620535d26c8da868bae2018affde754e59e5b43b8705902f0f4a6003356a13 \
--hash=sha256:9a1bebada95181fd1602ef554e9d5d36da00403691dc8520efb99751c52d9162 \
--hash=sha256:9a9c7ada72b6af6dc2920be812867ff17cb6168892f3cba87f052986d2125f2a \
--hash=sha256:9add6485ddb57071d919dcb8ee98617392d143ac39dad797d9786701d8397c7c \
--hash=sha256:9cc2c7c166f87080f1471f1c1b256fef57ff9f3db436d69f1659837b98793d98 \
--hash=sha256:a00220f8c1b5427eb541fed03329ed122b731de571f9379ce1c7b235ef43e75d \
--hash=sha256:a04d62ae564795a630e4e375b30ef2166933ba887862f825494b2ad40cfcf622 \
--hash=sha256:a2438674f20fa9a86961ef121d0e07baa27000e186356ebf29cebf1af3ea9db3 \
--hash=sha256:aae50ff65f1252476587c351af9b6509bef7931bafe2cb90bf76f14fc4a2c1af \
--hash=sha256:ac035833b9792e045eb425c887b95a2e31ef657edf7923c5e80989580c69c604 \
--hash=sha256:b0006b64890a98a88faf89cad185deb7b519c0bfbf405a8273ede74a521b64fb \
--hash=sha256:b4b808b90b6f7a360d7bd7a3c5093e072b8a7f5c8e58bad9747e7f072dec9434 \
--hash=sha256:b7ba63a56028e629205ecf09820a92247a43f2ec90177aebbc745a36d7504805 \
--hash=sha256:bb4bc63ec6599362f7d8dcef412b17d7231a828af4ae0961f570a99a13096f72 \
--hash=sha256:bda0e715d702b847ab2082be1ef298f2b4a6cdffb72435d9967b057e88e8d8ec \
--hash=sha256:bf0d031ae8536c3f255db2677712f32802a3075e19c5638fb39868e439fd8dfd \
--hash=sha256:c56dacc8b9a4c85c62e5363ba718f628c93ae542df9e2d4c806362ac823d99be \
--hash=sha256:c85a62953aece0e4ae5ae54bfef64bd6b5af5945febfb9d587cbca848b9e4bd9 \
--hash=sha256:c8d81122ae0c7433ff40b32ae15b033e092ab2d00a2dfdd14f1a281e5d34015c \
--hash=sha256:c928a8ec2bf02166fdb7ea2f7c34221a4cd7870efe9eb9880adb85c994e9d044 \
--hash=sha256:c9ac07bb579fe86b61eaf1afebacc814be9310735e57764b18ccdb4988ef18d8 \
--hash=sha256:c9caa99bc6c724d83b28ecb047ecf4025df3fca551dc55361277fa24fcb41294 \
--hash=sha256:caa27e2adfaf74e9543f7cab81c1ce7247ff6a916fa122aa5af9e2bf9ebfd074 \
--hash=sha256:d09e124045edeaa0d81f3682e58b7b7e4c661f7a4b5ca1fad51746ef3b88df60 \
--hash=sha256:d2c45dc64167e177241c875e43d6baef2c36add9e1494bbb695a802eb8958e1d \
--hash=sha256:d926424a2ab007733913698f85d229e3cc5063fc95fc425b9088ec565de35a84 \
--hash=sha256:db36ff8dad59bc58882ea3374f191557783203588cf9aa2f9c4542adce36eb63 \
--hash=sha256:de07a78680594a9b4c49bab13c7b3d280068ee4846a1580787ed3ca800e1604f \
--hash=sha256:df8121c8af59e9ec51810f54d47d3bf9b89ac20a8305a890d5b97133325d10c1 \
--hash=sha256:e0971046ef19aa64e77446e45d8a87a7aa4a7b867312253d0ae90f12dd53ab6c \
--hash=sha256:e1dc4c12292fc9629a95daa7c98ebf74cf59368e62b5eec79975a2598c91b5e5 \
--hash=sha256:e30ded32a953398b001a8856ddd2eae2ff79656cf25db62b26fdf8fc3e7597f5 \
--hash=sha256:e31dd47a404093a3b257285c70e230bcd76952ab11c1b326c21abe400a252a12 \
--hash=sha256:e4bf04ee9373307becc3e6cb70ae47b4c0dcf9e566d5f9bf59a97e569ef7d38e \
--hash=sha256:e621394915e565f671958e2453e5fb6cc7e34552c1e51a2768686d4b1501c2c3 \
--hash=sha256:e72ae1be344ee834ba6e9951b2a2b4866968f85443505078847b139549921884 \
--hash=sha256:ec86c26da32501ba0fa0ed47de784c61500614b1b2d9e2a78e6c621bdd17d2c1 \
--hash=sha256:ed94f267f0c5caaac4ab2430b11cad3af7b98a882498ea73101776ac881735eb \
--hash=sha256:eda4be57322b09230af7e3cbec89f8f3f90709835137902d5d741cfecda862fd \
--hash=sha256:edda68f4ea05a3ac537bc1505f916019d7a9eb47d88244904713aec5a2761421 \
--hash=sha256:f0fdc32d7b2e9890de5bf5c24d11f0740bbc7d137b97764a2e47374bbd581efb \
--hash=sha256:f198f726c515dac34a9a75fe663a475506f30b430631e10ea8f14dc15370154e \
--hash=sha256:f19a0a42d3c99a80edd14d0bd972cb83993989c714d54d41f5fe170031aca7b8 \
--hash=sha256:f21ff2e354e15b865af7cf393366c2c5b1169eacd5d5b1ca3660ac10a04706f1 \
--hash=sha256:f22a60827975d1ef37cfadf87cafda030e669c1b298deaee823e1f45cef7f886 \
--hash=sha256:f5a7a57ad94f2ac03cdd8f345c1d17f33a97f12fe75ff04c3a0d050fce91cad0 \
--hash=sha256:fc6bb1b23a4614377d6ca090e01da624d5141193abcc58be27b9bbe67ae86d02 \
--hash=sha256:fcaf3aa27b2872da169818c5f44bd55161ef509f83216cb9669499a0aa0f41cb \
--hash=sha256:fd7a6faa680a285f2747d22185401f09dbde094e40267201e743c91a8c6e2813 \
--hash=sha256:fff5ae9e651fb2098b8634e6a1bbec07077279d2fd0f20a1da529b9353515336
packaging==26.4 \
--hash=sha256:81383611a09c1bc0b08b76e0fd5829d7c6824c65b27a6aee339da133f4233ea2 \
--hash=sha256:c4b671c41ddb9bf26e543c37723610d28fb6bf7affc4da17cf048d419d2c062a
platformdirs==4.14.8 \
--hash=sha256:1e34af590de4d978631b751eb2202f2fee4497537a17c1720b12fcf57b331392 \
--hash=sha256:96893d686e84e9e6f358a9ea41a8de544df66dbf2ba6cda250e7dc73acf85b9b
playwright==1.61.0 \
--hash=sha256:009588c2a7e499bc5a8b425b61fa65490968bbda9cd69e0cf2cff10f8304659a \
--hash=sha256:35c6cc4589a5d00964a59d7b3e59641e0aac0c02f15479a7af77d20f6bc79597 \
--hash=sha256:372d55a6f1248fa1dd47599686980cb8fb5bbe6fcda59eab793eb657c11d8a9b \
--hash=sha256:54f3b39f6eab832e33458c1dd7da0b5682aedab3b09ae731b5c59fa12fd2024e \
--hash=sha256:93454322ade8c11d5d6c211bfd91bdfb9ffb4810e3e026371bcbc4bec1b7ee4c \
--hash=sha256:9f7de4536088d12037c13a52b7ea34b59270b78926bb56935070597ffac6b1af \
--hash=sha256:e9fcbffcf557a8620fdedd92491eb59a32d18e23d6f3b4f6214b952be324fe51 \
--hash=sha256:ff138c3a604f69911e9d42fd036e55c2a171e5616edf04c1e7f60a2a285540b0
pluggy==1.7.0 \
--hash=sha256:7dd7b0d8832ba3cb632c306926ded123429211b83641b35dc5c41ad2d34f9bec \
--hash=sha256:d1eaa46ebb595891b860ab086b4d09c8588af65ebd4361b8e8f4bb8920b90ba8
psutil==7.2.2 \
--hash=sha256:0746f5f8d406af344fd547f1c8daa5f5c33dbc293bb8d6a16d80b4bb88f59372 \
--hash=sha256:076a2d2f923fd4821644f5ba89f059523da90dc9014e85f8e45a5774ca5bc6f9 \
--hash=sha256:11fe5a4f613759764e79c65cf11ebdf26e33d6dd34336f8a337aa2996d71c841 \
--hash=sha256:1a571f2330c966c62aeda00dd24620425d4b0cc86881c89861fbc04549e5dc63 \
--hash=sha256:1a7b04c10f32cc88ab39cbf606e117fd74721c831c98a27dc04578deb0c16979 \
--hash=sha256:1fa4ecf83bcdf6e6c8f4449aff98eefb5d0604bf88cb883d7da3d8d2d909546a \
--hash=sha256:2edccc433cbfa046b980b0df0171cd25bcaeb3a68fe9022db0979e7aa74a826b \
--hash=sha256:7b6d09433a10592ce39b13d7be5a54fbac1d1228ed29abc880fb23df7cb694c9 \
--hash=sha256:8c233660f575a5a89e6d4cb65d9f938126312bca76d8fe087b947b3a1aaac9ee \
--hash=sha256:917e891983ca3c1887b4ef36447b1e0873e70c933afc831c6b6da078ba474312 \
--hash=sha256:ab486563df44c17f5173621c7b198955bd6b613fb87c71c161f827d3fb149a9b \
--hash=sha256:ae0aefdd8796a7737eccea863f80f81e468a1e4cf14d926bd9b6f5f2d5f90ca9 \
--hash=sha256:b0726cecd84f9474419d67252add4ac0cd9811b04d61123054b9fb6f57df6e9e \
--hash=sha256:b58fabe35e80b264a4e3bb23e6b96f9e45a3df7fb7eed419ac0e5947c61e47cc \
--hash=sha256:c7663d4e37f13e884d13994247449e9f8f574bc4655d509c3b95e9ec9e2b9dc1 \
--hash=sha256:e452c464a02e7dc7822a05d25db4cde564444a67e58539a00f929c51eddda0cf \
--hash=sha256:e78c8603dcd9a04c7364f1a3e670cea95d51ee865e4efb3556a3a63adef958ea \
--hash=sha256:eb7e81434c8d223ec4a219b5fc1c47d0417b12be7ea866e24fb5ad6e84b3d988 \
--hash=sha256:ed0cace939114f62738d808fdcecd4c869222507e266e574799e9c0faa17d486 \
--hash=sha256:eed63d3b4d62449571547b60578c5b2c4bcccc5387148db46e0c2313dad0ee00 \
--hash=sha256:fd04ef36b4a6d599bbdb225dd1d3f51e00105f6d48a28f006da7f9822f2606d8
pyasn1==0.6.5 \
--hash=sha256:4017b0fce125096b8573b39c989fdb1a4b19cf761e683398184550fea0e66587 \
--hash=sha256:6b11616a6bcf3a40e635f082bb232fa57b5e0dd7f517bd7ddd69ec3794508a47
pyasn1-modules==0.4.2 \
--hash=sha256:29253a9207ce32b64c3ac6600edc75368f98473906e8fd1043bd6b5b1de2c14a \
--hash=sha256:677091de870a80aae844b1ca6134f54652fa2c8c5a52aa396440ac3106e941e6
pycparser==3.12 ; implementation_name != 'PyPy' and platform_python_implementation != 'PyPy' \
--hash=sha256:a076f3f489b39b43ed13563a1dafe42447445bec2e294154ec5c57fcdda4c85e \
--hash=sha256:f03387877eab82ce01bbdfd0ba7252ee55a90b1c708d5129e2ce915475cf1db6
pyee==13.0.1 \
--hash=sha256:0b931f7c14535667ed4c7e0d531716368715e860b988770fc7eb8578d1f67fc8 \
--hash=sha256:af2f8fede4171ef667dfded53f96e2ed0d6e6bd7ee3bb46437f77e3b57689228
pygments==2.21.0 \
--hash=sha256:2363c69b61c4a97c838da3b130dcd6468f4848992b21a82f2a63ec34377137d9 \
--hash=sha256:610ca751c9bc2492b38eb9a38a7fbc93edbbb2d7182edaf34e66ae493dee5c8c
pylsqpack==1.1.3 \
--hash=sha256:11242dfb87124853c1af0931dc766c34f99e000ceca9cf1912883297b19509c5 \
--hash=sha256:20e870f903bfad70c3b65536049091d5d325367bcde6855dd6d2b7b419c45ae6 \
--hash=sha256:4cac49c32d9f455bea012223b8e2bc64e79d4b94eb8a8a7f60a239947b09df97 \
--hash=sha256:6ba422e788309d0564f80cde1704d8857ae288951b7707f9fee7ab660ae56109 \
--hash=sha256:8fdb02cb2d4c7e5b31ad6959398ccc2d6963f449f5776bf754a3425fbbb830f2 \
--hash=sha256:b220afff798cf59baf15489a4f1bd8d5f167d0f3224695380b767e8dffe8316b \
--hash=sha256:b733be9fc7ea9ac37945a3333a11c79838d8d9886fb9f6169376fc258333530b \
--hash=sha256:bc3967c423fbba759b4353d0b467753b8f510c6f769bf3f68317ac4b8dfef9db \
--hash=sha256:c1f1c495c161415a371535e524ab1a68753fe15c6534aaf87a3a50bfd804e85c \
--hash=sha256:cd4de1c914be239e99b6251f0c03ceeca5fe4d19dc67b727e921dcf3d3587d4d \
--hash=sha256:f25a63d645a3e3ad59c5d453048f91b2d9b0f3655b146d1491c18c783d584a56 \
--hash=sha256:ff53d63bf96a90973fbfceb7381c11bf1656bd9704f703259f9ba38f71c6040d
pyopenssl==25.1.0 \
--hash=sha256:2b11f239acc47ac2e5aca04fd7fa829800aeee22a2eb30d744572a157bd8a1ab \
--hash=sha256:8d031884482e0c67ee92bf9a4d8cceb08d92aba7136432ffb0703c5280fc205b
pyproject-hooks==1.3.3 \
--hash=sha256:5fc53fdac9f7bd63fbcdc868fb5f90b4784d78a53a3d3388cd738b807441a20b \
--hash=sha256:defda19b854fa0d3bd4f76ea4ddcba8abd7dcfcdd585a6690ade050744fc5f43
pysocks==1.7.1 \
--hash=sha256:08e69f092cc6dbe92a0fdd16eeb9b9ffbc13cadfe5ca4c7bd92ffb078b293299 \
--hash=sha256:2725bd0a9925919b9b51739eea5f9e2bae91e83288108a9ad338b2e3a4435ee5 \
--hash=sha256:3f8804571ebe159c380ac6de37643bb4685970655d3bba243530d6558b799aa0
pytest==9.2.0 \
--hash=sha256:07acdcf88ec174f907dc01af70bf52d49b014bbab03faeeade31c96b18c2e588 \
--hash=sha256:97c4f3b1f3c7414aa36465e09b8220f1d03627993bd51b1282e193753c80557b
pytest-timeout==2.4.0 \
--hash=sha256:7e68e90b01f9eff71332b25001f85c75495fc4e3a836701876183c4bcfd0540a \
--hash=sha256:c42667e5cdadb151aeb5b26d114aff6bdf5a907f176a007a30b940d3d865b5c2
pytest-xdist==3.8.0 \
--hash=sha256:202ca578cfeb7370784a8c33d6d05bc6e13b4f25b5053c30a152269fd10f0b88 \
--hash=sha256:7e578125ec9bc6050861aa93f2d59f1d8d085595d6551c2c90b6f4fad8d3a9f1
requests==2.34.2 \
--hash=sha256:2a0d60c172f83ac6ab31e4554906c0f3b3588d37b5cb939b1c061f4907e278e0 \
--hash=sha256:f288924cae4e29463698d6d60bc6a4da69c89185ad1e0bcc4104f584e960b9ed
ruff==0.17.6 \
--hash=sha256:0692088e6b33455572fb18465e891b443f196e98dc1986825685c77ff6f4c5ac \
--hash=sha256:084d9c8f5ec718e7eba007dba339e7cb4f7571d2f267558ae080bf428fb6a69b \
--hash=sha256:1939b3d701c7b6981b7cf93473de5bf88b129b9ba84efaed5154cc517c44634d \
--hash=sha256:1a0bea6aa1216e0ec4cd35d3dbccec0d772a7c2aad28ec9c6e82571dff2c20b0 \
--hash=sha256:2b04276561331300325040bdca21460770029ec574d4c479099e39e8ad1ed43c \
--hash=sha256:3db61f5015600543a581b07fa7f6f64afa0eeedefe16034cadd88c4074087582 \
--hash=sha256:435241c61af5909a022f76219d3d1bf24730dc1bf0acabb5ddf4b569ab3cbb30 \
--hash=sha256:6a12c50a33936dc00db2be21ba25fb168a8b95c55eda2a3ac85005af69885e4b \
--hash=sha256:9cd2fd9923e9806b8b6b67a3469e2258e84bd4d21e45d5a1a690afdfb9c8e57d \
--hash=sha256:9d44ef2140402043fd6f689ef541858b80883a8b0a02e38539ef0614ebe57d0c \
--hash=sha256:9fbddc08577592e283c265d865e0182de6e33db185494db7b06290d989d888e5 \
--hash=sha256:aa3b08254a732acba246891089a152c47c5733dc36b8ecb76ce8602f8326e5e4 \
--hash=sha256:b5aba93b3db4b70c5697e4fee6e0d5b9c8452a9a3a03679611cadc25915a2173 \
--hash=sha256:c2f4af6670b7a0501904e881bb3f1f24bd0d964dec1eedbd85f0eb73786e1128 \
--hash=sha256:d006bbb2945edb17b0ce6a0c1b5f5a8d81ba11dbac294a0a925effa22ce34feb \
--hash=sha256:d8b14e1473dc86ab9069cf7a2ba5041dc012f59110201844ed04cfddf07055a0 \
--hash=sha256:fb589e032806bb942e4fb526f30b80a1a64112147ed9f1d38cc3de2e255b6f45 \
--hash=sha256:fd661702202a89c00a4c9d0339008805fa5876bfa1c57e165495c2e62230dfbf
service-identity==24.2.0 \
--hash=sha256:6b047fbd8a84fd0bb0d55ebce4031e400562b9196e1e0d3e0fe2b8a59f6d4a85 \
--hash=sha256:b8683ba13f0d39c6cd5d625d2c5f65421d6d707b013b375c355751557cbe8e09
typing-extensions==4.16.0 \
--hash=sha256:481caa481374e813c1b176ada14e97f1f67a4539ce9cfeb3f350d78d6370c2e8 \
--hash=sha256:dc983d19a509c94dba722ee6abd33940f7c05a89e243c47e907eb4db6f1a43e5
tzdata==2026.6 \
--hash=sha256:0a10eec6e13ef16b627fabed9a5f2ba61a62b1c67f327305f4e7e412a70b4aec \
--hash=sha256:85d2cd9c09f81f0bb29db27759fc83af4f1e620efb814f8c5bf8b4cc4feece6d
urllib3==2.8.0 \
--hash=sha256:0cf3cae568d36aa9576b28dfb35f11328f1cb974ca7647d9475ebb86c75ac6e3 \
--hash=sha256:63bf2ead4c879426ebf22ef2a781eeb4aa3b4ae798a0435506f8687fd5bb9b63
uv==0.13.10 \
--hash=sha256:19a76fd50a6a2bba38ee088d8336566856569be08196865f98132a08806581fc \
--hash=sha256:2a9ff188b442419c7aadebc445fcc1f287b25f99af50fa6d563b90cc0047b7cf \
--hash=sha256:30e75714a9cff3aa56281c7bf533a4e93cb5bdfcc0325d3aae54b9106460bd63 \
--hash=sha256:3bf1c1b13cac2533a342ca16b1c5f41347cd399404c9477a04ff79c5f7cb4dea \
--hash=sha256:50bee2a59ea9422b493aabc0cde9288f58fbcf6e8d688c30c4ecd8309459cac1 \
--hash=sha256:5bcf77c50760146ff7b41022ab7aeb1954d42dd47b89fad36b43a1a8a43da994 \
--hash=sha256:771a749b34477501092c9fe6d5e52f45cef944d875b0f2e2c989047a2ee647ab \
--hash=sha256:7cc9c41b43d583e34c781fd3446405b06e9c5fa2db468ce2a534d353db6429e5 \
--hash=sha256:7fa025c4b0f33b9a5357252e1be058d94157e13bfb8ae45d7e27cfce3759c65d \
--hash=sha256:8b0a15613aae9a3e1c134bb5ee706583af0addced7eb1add992f8b1b3e3a92a0 \
--hash=sha256:a52ee170c00d4de1d42026c4dbb00c5d7f327edcf2b2bddeecd0cfb169868ac7 \
--hash=sha256:a9636b4430a9b8a37ecc4d85111d1fd2560ef616edf5301b84f474073bf89e2f \
--hash=sha256:bf7174b00c88879d4a1019b51256bbdb2dd61c55c7dc896031e16d090e380ce6 \
--hash=sha256:c85a2ecb62d09d61904f5405b525fcc51f971d081f8508a881fa2f9bae7543a7 \
--hash=sha256:d87b9cf8165f2b3cc596e856b5bf794da9cfad6d1b110ca9d87eed42a15b3684 \
--hash=sha256:e52a1af7f97b717572f9e2bd69e54eb253b2c88a705500e35811c21106c439d4 \
--hash=sha256:e89dd26ea831dde70639ba0a798fa04a4c7c0226fd2b241da86218bfa370e495 \
--hash=sha256:ee3bca6523ed93c3ae0d1a90c2733be307f5f7cc5287c746214e93a3bae0da13 \
--hash=sha256:ee403b6bbcfda1bc7db269be5c40c1624df27b3b838d3f8a416648e00e2de5d4
websockets==17.4 \
--hash=sha256:00ad98e4bb0df7a6711c645eec16d5a9fdf99f0692bd4f5b6cb85a68677ba8df \
--hash=sha256:0132e3cbd3f5cfc1ec77588961b302d72a02e2603b82c2c23fd5fb59dc4fa206 \
--hash=sha256:023dc13bdc42a55e152acc81c39c90ec6cc4159ed17d23c6d73460fa2a73ab16 \
--hash=sha256:02f380df26de14999ecace203fe1396ac14d1c6132afc7924eb6f8c8b646c69d \
--hash=sha256:03ddf4eb76ced8725dcbb000ff60b0fb8d7330ed011f6dc725a1925c5fe02051 \
--hash=sha256:043945a43873c7c11a3f75238d475c95f902e967de329eb8763704546cfaa6b6 \
--hash=sha256:046ed16d3d83d64594e4a40655fef061ccf36059d8c30a01feca8a9481fe13b8 \
--hash=sha256:06ea46717553cdd10f2682126cf7a66e91c8ed17b6969f4a95e94b4e01d06188 \
--hash=sha256:09d3939b70df0c8ad2da145ebd50978bccaee1d565e838b0e7921a34d38571eb \
--hash=sha256:0a57b99f2e28922b5a2434317580fd23fdf118caff4c5b752f5452836426205a \
--hash=sha256:0c22a9c6b2349204f56123dd0ca7779e989d68e336d0dc02ad823485d44925de \
--hash=sha256:0dcce83837328e6795225ead920d3aa8d867cc9d6922aa558b0e9111599fdbb9 \
--hash=sha256:0e51546a3bedadd80dfa5c2efaed840ac51b8632d8db7f9f502175f5349382a9 \
--hash=sha256:156221ad7638b5abccefd6f798916bf3f8ffd6ac51480eb4ba5b05df914ccbf3 \
--hash=sha256:16550e24ac22c27e0a728100d8de196b5f054bab6748ef9f0b168fb8b3c32e35 \
--hash=sha256:18d3710becc612ec6f0229425bd6495133dfcbf30f7b6569585acc8ed2f1b452 \
--hash=sha256:1962f3bfde085af18878f1bb1aafb300c9a6ac33da886d0b0d97e33c9ce7a222 \
--hash=sha256:203e42eb77e06f85778a908b34c5ad032f34e98a68ef33920d6685c1e65a9420 \
--hash=sha256:2103982762460a764a7ef0021443bb471f46d45ecc6858276e4fe699ebac6b94 \
--hash=sha256:25eb661d8ba7e2b85ebb4e7a1bb9f6a3280910ed10b84330a7abfb5ed32d2764 \
--hash=sha256:29b615c2d5dd883f89c107a782681b73a7aa8b2bd894130310e45eb09b143913 \
--hash=sha256:2a9cb5bbfc33b4ebd3c8d3714d6e09805437f60a14977774e4bd11b5ace46c23 \
--hash=sha256:2b23dacf7a8a88afe92f77bcdbf4cf043a84692bac2f2da02f4011c687e19b48 \
--hash=sha256:2fd562372d4afaf18d1c7f1c68e39bd32818bb16d5f57f778a4a4ed88eedcaae \
--hash=sha256:32110d954d9d0e51f36edb0396673bf4d35193a0a80ba7013bf7f7d58a33ca07 \
--hash=sha256:332b88022d0acd47c44158bcd43f47f14eaddcd979247f242b1a33291c45cdd1 \
--hash=sha256:361f9a21a33191d5287e7a75f508fc3b9bf47aaffb0241198d6b7be3384f294e \
--hash=sha256:37ed7782972545e67d97ef9a172e9499d25459b1e32cb99d1c2a30c572f2441b \
--hash=sha256:3acc45494c08a4d27375a2c28474537f68910219f42624a08011221b04623d04 \
--hash=sha256:3b76837cd051d8875913f3934b27205f7a592f78b8a4f4a1f3abc36a2420c5bc \
--hash=sha256:3b78b39377630a70aa2198e5f03be416e690364a046b1d8af80a9263733083d0 \
--hash=sha256:3d27153a0413696767b98b5d96173a2a7e27cbfca02000a6069cea7b977765a7 \
--hash=sha256:3d512e3a6c528c42ce220ed9c3caff83c6fdcd98a1b98249f08ccfc66ad111b1 \
--hash=sha256:4073ab7cefe5a2e7dc368c1f01eb27716dc8ea8f1c69e9b7725ebce05aa53cf7 \
--hash=sha256:42d7a6e818214336cf7af9a3aae5c6923f94f09fa07ac5aab98268ba2a98a6d5 \
--hash=sha256:4441d655a53185ef1b01b1d42ad9b3a96b905110a9219043e3fdaec855ba3b6e \
--hash=sha256:47beedf07a706140b50786457e082497ee6b5970c41e49bcd1572ee3f4c73f80 \
--hash=sha256:48c83103f82fce36191a9e3a8a80731d4340e2da544eae8c5aaaf6a45280e7d0 \
--hash=sha256:4b79ea31cf277c72d2307c6cb8bd32a2c151959e80a2f24fa85df620c5f2860c \
--hash=sha256:4c792e6cce24d08f92199d907785c9e64f74c357deeed3dbaf7d699ed5930b64 \
--hash=sha256:4d2636a5b61c69e32db0e74b57073dd4a66f1ad195e9398c5f01bba41090deea \
--hash=sha256:4fb2db1f649b6464711846b5bb9c1611bd906ce939d9460cbd1fa419552cd6c3 \
--hash=sha256:506623128d7a55b726a5a46e4c9a8eae4c9dd0f04ff60b041fe7df85b9d034fe \
--hash=sha256:51adfc30f467077293a6695d8149bcef501c0728386f3a491054f835dadb60b2 \
--hash=sha256:52c31d123f5adf14dec694c2a4036bf42c523df7cefc641d31cd05653de56e49 \
--hash=sha256:5830f94a7190a33e55d06d89242ea951ee2009c3a27fc31538f3ac9386b27edd \
--hash=sha256:5cec3e7fbc911ff4fcf43b24aaf1b96906381ad36030f42897def3ff4b78729e \
--hash=sha256:5da7f7f1ecf866186f195f7ecc374c915e1838496b86f2f3b41da27c798a25c3 \
--hash=sha256:5ec906bb21b35e66cfdcc2ea0133f249f52b7d89e3e45ec8d2bd2d84a0255d7d \
--hash=sha256:5f772007dfba8941873dbd276b6a6845428cc740888b5c6c37bf483b1ea34b42 \
--hash=sha256:648adde345cfd13335342e23cfe94871c7f7f55a43fb254f3b95acb071072968 \
--hash=sha256:6531540aa63e6864cb0615a3a5da70ae03191334507852a5385320bb7916df3f \
--hash=sha256:6597a1f7413189b4bc58437babcdf39b79da416e5c477ae98323a88ecc108188 \
--hash=sha256:6686d29eaafddeeab9e48af92103dc0d26161035faa4be083b8b488f1ab47219 \
--hash=sha256:679eef0123861ca381dd8fd9bdc1920e87636ac55eae6cff875c53dcb05fbcf8 \
--hash=sha256:6afc32a7a1a40b071070419537df3559d26907086556769683fa97b7b6e90fd5 \
--hash=sha256:6b061ea7ca94966af7cd7a87cb189ff15972c103244611a2b1e8408c04f1dbe6 \
--hash=sha256:6cf4c002268da5c11cae9083aec71ac943bce9d95e0f83c8bf9a95a3ce421fbb \
--hash=sha256:6e6558efbb256b532c9f06a21ba42bcac729718e365c505819f181f25e5c0eca \
--hash=sha256:6fd8cac4907fec8302726d49e6969acfffaf720bc39b1cee23f473b81f4dce01 \
--hash=sha256:70293c25d79d1f084fdd665894481547575e429d2a75e8d72caec2f6b6b07af8 \
--hash=sha256:71f76bb8e59be847330b8a8d3753f85397677e128f9f9692c215f8cf721cefc7 \
--hash=sha256:725be1aff55f1c873a79cea0f612df9dff21a9d2c2e05783665b824b8aa7c24e \
--hash=sha256:72d0a731eccf482d5661c6711abfcd5921f3dbfbbb0789061e1918ef4bc89c70 \
--hash=sha256:7390e060f830b3d132f484b21ac2783a2d227b682ef62bb8146e1c1b4ca0e45a \
--hash=sha256:73b00645316121105274fd266ed54a20e6514650126d399cdea39876ab1e7b04 \
--hash=sha256:74e46409666c358b93fce0d8c6f4cb107d8dd7cba1302a38d49adf6fa8193c7e \
--hash=sha256:75b32cf33ea40f945f226f97bc1d43151e1a5adff21f420b5e63c468b1a28114 \
--hash=sha256:769e4f7b090e10cae4c082e3e39b9458ec2444505df84953c16c0468b16539c4 \
--hash=sha256:7849a096d6fdba3f2bdf849eb89f2d233a24400c92faa3efb25fa8dc615b706c \
--hash=sha256:799c5a23126c9589cb10b6c6b54f9087246940dad20cd74bf3f06fc9ae3bbab5 \
--hash=sha256:7a7e9321822ca59ba56fa8744c3e3f01ef74d547aafe0d383d000d7a4d11eb79 \
--hash=sha256:7b23db4b469d9e051ac74d96db9bf61e27c9054de64f8263fefa32bf72867ba1 \
--hash=sha256:7b4ee34acefa9ba1333f02b817982f1e4127f6f9b975017a707c4e738d7f9fb9 \
--hash=sha256:829bcaa90be8737c132d9515d6a466e8528e3b3d050d3f3466f36ea94d3beb48 \
--hash=sha256:8588edf317fbe4f16a949bc5a6ccdd22b6e6fd5b4745d128bc40bccf31024ce5 \
--hash=sha256:868744c68e9342768888c7326604da2228c19bb6946aa46b5f9e1ac32ea8d40b \
--hash=sha256:88ba8a439b2bad97bb69c38db5bf0ec16a061ee834cf0f244089186ee803e899 \
--hash=sha256:8b45d40f07081b377f0b837ddbfba4a9ab4a89a7b569d3c095436564e767a27b \
--hash=sha256:8c00c5c49f80a588a2c4f99d519d2abed4ce26cdca11273041bc8b7e60af60de \
--hash=sha256:8c51ac7b31578a7275650f580aac985940985b6d2e57247ac6d5e07f2c936cd6 \
--hash=sha256:8d148b4b295224d3a19e7bd9f02ebe7344de254b3b2c4d0628ce42ade0bca119 \
--hash=sha256:8f32a6cb0b101170abc2d8053af1473a2a29ef2a06d7130994ee8455a50f5dbf \
--hash=sha256:8fd30d217a4275107667fe1d4f601e2d50c797d0727148cfbb384536d65f04d3 \
--hash=sha256:927d602fb8fb595a69e6b1ae998a6ec19851d0fb9391759456e6425090996647 \
--hash=sha256:94622cf24e80d03054ceb69a06a86c950e12fe993ed06b933f7895232cacbc3e \
--hash=sha256:954d43574f72be244b65f0fa61e2f814214b024f2ec849f487aa2f553f7c6e71 \
--hash=sha256:98f16db5e79f2605194c0f899d0532005bb12269e698bf96f62a5635bcf33010 \
--hash=sha256:9a4e95d56994a45ac76541853796720436ffe462957d0b1b89e87ff3d3b1627e \
--hash=sha256:9ae1429ee9e52b139167ed0169757806a27ed7307e942e8c62037a9184e9843b \
--hash=sha256:9e282f35ece8895b9fa5af406fc6a4cb42f01e1009525cf46641de584781c83b \
--hash=sha256:9ff89e36451a19775e7556d95ebfa4a0b24b84cc87565d6b5d0ec8ea82bf3f2c \
--hash=sha256:a0457561e8a87a6a3b509e21c35084d7d207ced262139de3f738e9676a476bbd \
--hash=sha256:a50bd9b44dd9b7b845802030b4d88610c01c7f95571b4cbd3a1aeec17a34c9fd \
--hash=sha256:a703f23ca15a51251fc94f1774683f5aa511588a7ad6bbb83960cdb2a4dcd978 \
--hash=sha256:a920e99155d75d1b1c08172da8aaa7200e7b30871fb628d1631d7891a333e30e \
--hash=sha256:a9b0026538719f7a532998d84640ab2e91ca1a051ce4b8d924fdcb607307e921 \
--hash=sha256:ab9e4bd60796866c578e3afa0a17c98636887827a39c2e238a61989c18fd8e7b \
--hash=sha256:accb5e9492b9bc9c9aeec5b72ea8f2ddcbefc6143d1c626fba960ecbdc89807e \
--hash=sha256:ad2e9e152bec6c4f7e4cdb4adcea6b708400090eec04bfe5ee5b30d368ffd721 \
--hash=sha256:adc30e5d064c9e33049e825408fa4e952f4e8a0cf4c329dc2ded72e1bb5bae08 \
--hash=sha256:b529ad6c81ad21db2f4e3d6e33db78ce3b9f272066b438b5d673361f9282898d \
--hash=sha256:b6c7f91520c29420639925fd1cecceac9ca07366b50c09ea24eac1cd116b4866 \
--hash=sha256:b7ea61af293a153f2d67430038cf0efc10140caa623f2bdf5a9f5a457ff20f57 \
--hash=sha256:b8451f31ae24620cc9372acd2728d87922f2bb0cae3fa57aed68b152844cdf08 \
--hash=sha256:bbb6bed49f083e2ec8ae0bb21c00c7c5171ab8e08a8b008c61a43fc6c944fdac \
--hash=sha256:bc581579885728bb54ef15000295c20e6a64a200b1b73d5cfca71879a3eb3e1f \
--hash=sha256:bcad49104711f88b2b7c3ba166de172857d837248205e541b044a552558fecc3 \
--hash=sha256:bfc86dff091104eec770c29ea1831dbe191968a70aa2d8ae8eda3240d863970a \
--hash=sha256:c00f0c45851a2c61efffd03dde8fb4d594026b5cc18196c94e15460f1225f2ed \
--hash=sha256:c0cc2cb47face4dae64bd70a9268dbebddb3e48c1b48cf6d7b6ac1471609fd88 \
--hash=sha256:c2db7b9e2d726f7e051bedb67abcf460b84b11437b2f9fdacda7e6931dace85b \
--hash=sha256:c44776f82b04e623eb9e1b81fcd17ac6e9808ae1ba5cdf8edce1f7c869a95a9b \
--hash=sha256:c564d1e6531611bf87078c28780456ecc75459dcca189629fff2fe7c020d8e67 \
--hash=sha256:c568e72f5425a74616daeb824afe28da460cbeea036432f41c6af5380b83300d \
--hash=sha256:c5e970d3996c597186c9dbb6e77a8048737a834ac03cb13186a54999e0e1c31e \
--hash=sha256:c634053459278cf31fb404ddb5ecd38124e4609e8b609166da621edc2d5796db \
--hash=sha256:c63c0d7832956d5f3bb77888b93c854569d13f806289ff75c43926d25c6e5fd2 \
--hash=sha256:c6bd2c9781915592b209160d0f017d4c7c82ad53075e6b0c24d2a89299e7f9e9 \
--hash=sha256:c74954409ea5789f7a60daa5f94580c00ad0b60b20751c47b35c4784877b5057 \
--hash=sha256:c7a56140fcbf4662cb263754a754c651a16fe2196cae1fd232d18f89acd30c83 \
--hash=sha256:c7b996c02de5e032cb63dc65482b73693b7ecaa586654126be2749ddea239c40 \
--hash=sha256:c7f66a53e9b7ec831abb15e3d9b6cee8f52d6a24cd0a374786bf46c3ec218bc6 \
--hash=sha256:c8052c3058c402d53602583da5ddcf1a15a63ab1efe0222f47c7be59944e6463 \
--hash=sha256:c9f8fdb7bbefc4907c2bb3593f810f2b67a2d5329e1d38724a1aa3d763cf63eb \
--hash=sha256:cbdf4b42f4514422051889424fd03bc269be8c5d751bf39ec29ad761590bd10d \
--hash=sha256:cc0cd4065a65ac98f3e2742ee9f314da9d224db49b07dc17d3a20cef0d79658d \
--hash=sha256:cebad8f4796248b91fc2168515e507e5cb6b663a32befd09f3b1e7920acdcb1a \
--hash=sha256:cf99debb17227a50620aee16647bb33a0387f5fa5418d628666c0f05745e0d2a \
--hash=sha256:cfbbba4597f19ad717f79fd3f2a67ae7efae647bd6a61e14554e1b5ad242a5bf \
--hash=sha256:d0acd8191c0e5a61d1c27bfa33b6ec8431982299f5d71c02129aa4f16f182ad0 \
--hash=sha256:d0b6a9bd86f865ebc9d847a1eb0a655a0e2b447cbcde743dda97c4298415cc0b \
--hash=sha256:d0f943b53bb1d7389d72a5380078670e5fcc34a1328142148b72d20fd82031c7 \
--hash=sha256:d48795c7d64ca1c42e3d61fcc6478cb15a19b6ad3f9c882bc8d8dee49d4a420f \
--hash=sha256:d8255971f6789cf0cb365e3e22b9b166eba978548a26241eaa5b7af0440d885a \
--hash=sha256:ddab54dc0ec46ed09ef9ac131252cb5740ed21fbe6fc145f3c6fed0b575a8f15 \
--hash=sha256:dde9cd67f18803949ebf96de8aba12b8ec5ee3115e34c75a2db85a3b0a6c20d5 \
--hash=sha256:de29795f23833cdfb68ba45c8a5cc0ec49778ea5deb670188f4465bba5930d25 \
--hash=sha256:e0feb03a338f8f5e819ae23a73aabb7b46fd3b73f15f7df782dd12d99e2b02ad \
--hash=sha256:e30550965c78223439815dbdf40c93eb8931dfbf12427110dcfcaeebef76feb6 \
--hash=sha256:e3e80cad85ba68c07c1e8d4ccc9cf51e63bf6a73d6bf631640be947bd72b6b63 \
--hash=sha256:e4beaef2f4796558e738e15ca0b8802e35f419a9fa374a978e41706f43c48b26 \
--hash=sha256:e6d2a185ec4ff0478089305abd833da3a9fda8803eb77325b89ebeae5585a3b7 \
--hash=sha256:ed7fe197b8bb66eef4f62c052e33752d456d2fdda74805469d4bd954950ab339 \
--hash=sha256:ee48728a07566c32e097d267f4d4d01b85123c9ae748a42da02185b908cbedc4 \
--hash=sha256:ee6c4e0085bff5f6621bf9c53452584dcb91ebd993ce841e1f4061ac12b6b556 \
--hash=sha256:ef03fb4b3685df0ed9dc6a074a090f030345cad2c23c61818da3e08e693a9caa \
--hash=sha256:f01a680d4b66fd15cc7513fae55c673cc8cc340d41340305b7f9a782abdbefed \
--hash=sha256:f0494d3d97502e270282cc6a1f8648cd7335b4fe8d5c452006e5b7f9d62b8892 \
--hash=sha256:f24bed98595b9d854da8d6debaf82754abf3e8fe63ec90505ef560566814df7e \
--hash=sha256:f42671900e0b602d05a074c52fd3d757c2f8e5c4f73f771794dae1aa4aea5f0e \
--hash=sha256:f5b1d315a615cec81a79e2ce3a94221dc5c23e7fd4012897085d3b5e5a5638d0 \
--hash=sha256:f5f06f59e19aa0770aaf651ce91c196fa620b35aed49a7e6c36e7335f3f83db7 \
--hash=sha256:fcac44d917672ad6257ad64b80b5168306f168a78cab5c0612e4c699caed18cf
+34
View File
@@ -0,0 +1,34 @@
{
"playwright": "1.61.0",
"platforms": {
"ubuntu24.04-x64": [
{
"path": "builds/firefox/1532/firefox-ubuntu-24.04.zip",
"sha256": "8f3c97b95caf84cec1e83acdbee5079156cce338fc21bf2f4bc6afe3eec616c0",
"size": 110001368
},
{
"path": "builds/ffmpeg/1011/ffmpeg-linux.zip",
"sha256": "ebc74fc5b94830176a3c2914ae96bd8bc7f6a91f4f33890230f84a172ee61ccc",
"size": 2376500
}
],
"win64": [
{
"path": "builds/firefox/1532/firefox-win64.zip",
"sha256": "c02daa45e8af1164cba27301f076a877d9419f0d40b51b9fab4fe415daf6f77f",
"size": 122449192
},
{
"path": "builds/ffmpeg/1011/ffmpeg-win64.zip",
"sha256": "8d08827c019ad36e7b9d49d3648447d884534cb2acf200e71c715f6dd834cc50",
"size": 1411741
},
{
"path": "builds/winldd/1007/winldd-win64.zip",
"sha256": "0069f0d11d4ad6df068a068c003d22fe7dbec192a47bba64b2e115e9c8ce41d8",
"size": 128684
}
]
}
}
+9
View File
@@ -0,0 +1,9 @@
# The PUBLISHED SET, the control side of the A/B oracles (scripts/ci_published_set.py): the last published invisible-playwright and the invisible-core it pins (its seal pins the engine). Written by `python scripts/ci_published_set.py resolve --write`; .github/workflows/published-set.yml keeps it equal to the index.
# wrapper-requires: greenlet<4.0.0,>=3.1.1 | psutil>=5.9 | pyee<14,>=13
# core-requires: maxminddb>=2.2 | platformdirs>=4 | psutil>=5.9 | requests[socks]>=2.31 | tzdata>=2024.1
invisible-core==70.83.0 \
--hash=sha256:1dff040e41f5aba5aa07e086328ca436291fddbd31514d1bc9a9dbfc4ba7fb6a \
--hash=sha256:f7144262686adf54a4a1c85a8d17f76b31dc4ddcfbd6636d777c5c39963d3293
invisible-playwright==0.60.0 \
--hash=sha256:00509578944ff0d742761d4d5f19fcde21b7657197fa24ab0718e076ebdf9aa6 \
--hash=sha256:7285f5756ad2031087d12f339c2e89b76bdb953449c9151c0edc11a58d96d9c6
+27 -11
View File
@@ -1,20 +1,36 @@
[
{"id": "wrapper.e2e.udp", "giro": "G2", "os": ["linux", "windows"], "min_tests": 43, "exact": true, "tests": ["tests/test_preload_newtab_turns_the_privileged_about_process_off_e2e.py", "tests/test_the_association_is_ready_when_the_peerconnection_is_born_e2e.py", "tests/test_turn_over_tcp_is_tried_for_real_e2e.py", "tests/test_webrtc_realness.py::test_the_gather_is_real_without_a_proxy", "tests/test_the_whole_udp_chain_by_name_e2e.py::test_a_turn_srflx_by_name_arrives_through_the_relay_when_the_exit_of_the_lab_is_loopback", "tests/test_declared_host_network_e2e.py", "tests/test_a_page_over_ipv6_gathers_on_a_machine_declared_without_it_e2e.py", "tests/test_webrtc_realness.py::test_a_gateway_with_coherent_udp_gives_the_page_a_srflx_born_through_its_relay", "tests/test_webrtc_realness.py::test_a_host_with_ipv6_addresses_gathers_through_an_ipv4_relay", "tests/test_webrtc_realness.py::test_a_gateway_that_is_far_away_still_gives_the_page_a_srflx_born_through_its_relay", "tests/test_webrtc_realness.py::test_the_first_candidate_of_a_gather_does_not_wait_for_a_gateway_that_is_far_away", "tests/test_webrtc_realness.py::test_a_gather_after_the_page_loaded_through_the_gateway_costs_only_the_road_to_the_server", "tests/test_webrtc_realness.py::test_two_contexts_with_two_proxies_each_gets_the_srflx_of_its_own", "tests/test_webrtc_realness.py::test_the_turn_over_tcp_of_a_context_goes_through_the_proxy_of_that_context", "tests/test_webrtc_realness.py::test_a_proxy_that_does_not_relay_udp_gives_no_srflx_at_all", "tests/test_webrtc_realness.py::test_a_proxy_whose_udp_leaves_from_another_address_gives_no_srflx_at_all", "tests/test_webrtc_realness.py::test_a_proxy_whose_relay_never_answers_gives_no_srflx_at_all"], "marker": "e2e", "needs_root": false, "note": "Needs the candidate binary (STEALTHFOX_E2E_BINARY) and the engine that carries the UDP line. 57 = 1+7+6+1+21 from the five files + 21 from the 10 UDP-line tests of test_webrtc_realness.py (parametrized). The chain by name is here in its variant with the lab's exit on loopback (127.0.0.2) and the pref `media.peerconnection.ice.loopback`, on Linux and Windows: the exit of the lab is loopback, and a loopback mapped address is thrown away by nICEr unless the ICE context allows it. The variant without the pref (an exit that is not loopback) is the suite wrapper.e2e.udp.exit, Linux only; the address added to the interface of the Windows runner is work of the release after firefox-63. The preload_newtab test (2) is here: seen green on Linux as root (Docker) and on Windows 10 runs of 10 (windows-2022, round 5 engine); it reads the engine's own process log."},
{"id": "wrapper.e2e.udp", "giro": "G2", "os": ["linux", "windows"], "min_tests": 44, "exact": true, "tests": ["tests/test_preload_newtab_turns_the_privileged_about_process_off_e2e.py", "tests/test_the_association_is_ready_when_the_peerconnection_is_born_e2e.py", "tests/test_turn_over_tcp_is_tried_for_real_e2e.py", "tests/test_webrtc_realness.py::test_the_gather_is_real_without_a_proxy", "tests/test_the_whole_udp_chain_by_name_e2e.py::test_a_turn_srflx_by_name_arrives_through_the_relay_when_the_exit_of_the_lab_is_loopback", "tests/test_declared_host_network_e2e.py", "tests/test_a_held_ice_port_blinds_the_loopback_checks_e2e.py", "tests/test_a_page_over_ipv6_gathers_on_a_machine_declared_without_it_e2e.py", "tests/test_webrtc_realness.py::test_a_gateway_with_coherent_udp_gives_the_page_a_srflx_born_through_its_relay", "tests/test_webrtc_realness.py::test_a_host_with_ipv6_addresses_gathers_through_an_ipv4_relay", "tests/test_webrtc_realness.py::test_a_gateway_that_is_far_away_still_gives_the_page_a_srflx_born_through_its_relay", "tests/test_webrtc_realness.py::test_the_first_candidate_of_a_gather_does_not_wait_for_a_gateway_that_is_far_away", "tests/test_webrtc_realness.py::test_a_gather_after_the_page_loaded_through_the_gateway_costs_only_the_road_to_the_server", "tests/test_webrtc_realness.py::test_two_contexts_with_two_proxies_each_gets_the_srflx_of_its_own", "tests/test_webrtc_realness.py::test_the_turn_over_tcp_of_a_context_goes_through_the_proxy_of_that_context", "tests/test_webrtc_realness.py::test_a_proxy_that_does_not_relay_udp_gives_no_srflx_at_all", "tests/test_webrtc_realness.py::test_a_proxy_whose_udp_leaves_from_another_address_gives_no_srflx_at_all", "tests/test_webrtc_realness.py::test_a_proxy_whose_relay_never_answers_gives_no_srflx_at_all"], "marker": "e2e", "needs_root": false, "note": "Needs the candidate binary (STEALTHFOX_E2E_BINARY) and the engine that carries the UDP line. 57 = 1+7+6+1+21 from the five files + 21 from the 10 UDP-line tests of test_webrtc_realness.py (parametrized). The chain by name is here in its variant with the lab's exit on loopback (127.0.0.2) and the pref `media.peerconnection.ice.loopback`, on Linux and Windows: the exit of the lab is loopback, and a loopback mapped address is thrown away by nICEr unless the ICE context allows it. The variant without the pref (an exit that is not loopback) is the suite wrapper.e2e.udp.exit, Linux only; the address added to the interface of the Windows runner is work of the release after firefox-63. The preload_newtab test (2) is here: seen green on Linux as root (Docker) and on Windows 10 runs of 10 (windows-2022, round 5 engine); it reads the engine's own process log."},
{"id": "wrapper.e2e.udp.exit", "giro": "G2", "os": ["linux"], "min_tests": 7, "exact": true, "tests": ["tests/test_the_whole_udp_chain_by_name_e2e.py::test_a_turn_srflx_by_name_arrives_through_the_relay_before_the_tick", "tests/test_a_proxy_that_cannot_carry_udp_leaks_nothing_direct_e2e.py"], "marker": "e2e", "needs_root": ["linux"], "note": "Linux only, and not collected on Windows: the exit of the lab is a documentation address (198.51.100.9) added to lo with `ip addr add`, which needs root and iproute2; a mapped address in 127/8 would be thrown away by nICEr as bogus (stun_client_ctx.cpp nr_stun_transport_addr_check) and the pref that allows it is off in a product. The page reads a srflx equal to the gateway exit and the relay of the TURN server, the TURN name resolved by the DoH through the proxy, in the tick of 2 s. On the Windows runner of GitHub (administrator, the network of the runner) it could run too: not yet. A skipped test would turn the verdict red, hence a suite of its own. Its twin with the lab's exit on loopback and the pref stays in wrapper.e2e.udp on both systems, so that Windows keeps the walk of the chain by name.", "linux_only": "The lab's exit is a documentation address the host must hold besides its loopback (nICEr throws away a mapped address in 127/8). Linux holds it on lo as root; Windows takes no extra address on its loopback pseudo-interface, and adding it to the runner's adapter took the runner off the network (runs 43314251547 and 43334169682 died in the test step). A Windows twin waits for a way that leaves the runner's network alone."},
{"id": "wrapper.e2e.udp.sandbox", "giro": "G2", "os": ["linux"], "min_tests": 13, "exact": true, "tests": ["tests/test_the_socket_process_is_sandboxed_e2e.py", "tests/test_webrtc_realness.py::test_the_gather_is_real_without_a_proxy", "tests/test_webrtc_realness.py::test_a_gateway_with_coherent_udp_gives_the_page_a_srflx_born_through_its_relay", "tests/test_ice_names_by_the_context_proxy_e2e.py::test_a_gateway_without_udp_resolves_the_ice_name_then_ends_in_701"], "marker": "e2e", "needs_root": false, "note": "The browser WITH its sandbox, run by a normal user, as on any Linux that allows user namespaces. On the Ubuntu 24.04 runner AppArmor refuses them to a user, so every other non-root suite runs a browser WITHOUT the sandbox of its socket and content processes; the gate turns the restriction off for this leg (sysctl kernel.apparmor_restrict_unprivileged_userns=0) and the first test fails unless the socket and a tab process have a seccomp filter (Seccomp: 2). The three situations of the UDP line: A (a proxy that carries UDP: the srflx born through the relay), B (no proxy: the gather is real), C (a proxy with no UDP: the ICE server name goes by DoH through the proxy and the gather ends in 701). No root and no resolver trap needed.", "linux_only": "It reads the seccomp filter of the socket and tab processes in /proc. The Windows twin reads the sandbox token of the same processes (integrity level, restrictions) and needs a measurement of the retail Firefox's tokens first; until then Linux only."},
{"id": "wrapper.e2e.web", "giro": "G2", "os": ["linux", "windows"], "min_tests": 27, "exact": true, "tests": ["tests/test_networkidle_through_a_served_browser_with_routes_e2e.py", "tests/test_http3_through_the_proxy_e2e.py"], "marker": "e2e", "needs_root": false, "note": "The networkidle e2e with routes and the HTTP/3 e2e, split from wrapper.e2e.udp (about 260 s of 500 on Linux; the whole suite did not fit the 15 minutes of Windows)."},
{"id": "wrapper.e2e.udp.sandbox", "giro": "G2", "os": ["linux"], "min_tests": 13, "exact": true, "tests": ["tests/test_the_socket_process_is_sandboxed_e2e.py", "tests/test_webrtc_realness.py::test_the_gather_is_real_without_a_proxy", "tests/test_webrtc_realness.py::test_a_gateway_with_coherent_udp_gives_the_page_a_srflx_born_through_its_relay", "tests/test_ice_names_by_the_context_proxy_e2e.py::test_a_gateway_without_udp_resolves_the_ice_name_then_ends_in_701"], "marker": "e2e", "needs_root": false, "note": "The browser WITH its sandbox, run by a normal user, as on any Linux that allows user namespaces. On the Ubuntu 24.04 runner AppArmor refuses them to a user, so every other non-root suite runs a browser WITHOUT the sandbox of its socket and content processes; the gate turns the restriction off for this leg (sysctl kernel.apparmor_restrict_unprivileged_userns=0) and the first test fails unless the socket and a tab process have a seccomp filter (Seccomp: 2). The three situations of the UDP line: A (a proxy that carries UDP: the srflx born through the relay), B (no proxy: the gather is real), C (a proxy with no UDP: the ICE server name goes by DoH through the proxy and the gather ends in 701). No root and no resolver trap needed.", "linux_only": "It reads the seccomp filter of the socket and tab processes in /proc. The Windows twin reads the sandbox token of the same processes (integrity level, restrictions) and needs a measurement of the retail Firefox's tokens first; until then Linux only.", "needs_userns": true},
{"id": "wrapper.e2e.web", "giro": "G2", "os": ["linux", "windows"], "min_tests": 27, "exact": true, "tests": ["tests/test_networkidle_through_a_served_browser_with_routes_e2e.py", "tests/test_http3_through_the_proxy_e2e.py"], "marker": "e2e", "needs_root": false, "note": "The networkidle e2e with routes and the HTTP/3 e2e, split from wrapper.e2e.udp (about 260 s of 500 on Linux; the whole suite did not fit the 15 minutes of Windows).", "moz_log": "nsHttp:5,neqo_http3:5"},
{"id": "wrapper.e2e.doh", "giro": "G2", "os": ["linux", "windows"], "min_tests": 19, "exact": true, "tests": ["tests/test_the_hosts_file_of_the_host_is_never_read_e2e.py", "tests/test_resolver_race_e2e.py", "tests/test_doh_under_stress_e2e.py", "tests/test_context_proxy_only_resolves_by_doh_e2e.py", "tests/test_doh_through_the_proxy_e2e.py", "tests/test_ice_names_by_the_context_proxy_e2e.py"], "marker": "e2e", "needs_root": ["linux"], "note": "Linux needs root: the resolver trap of the file (ResolverTrap) points /etc/resolv.conf at a counting resolver on port 53. Su Windows il resolver trap non gira: l'asserzione sul resolver di sistema è l'unica omessa. Run it without xdist (port 53 is one per host). On the Linux leg the gate exports INVPW_REQUIRE_TRAP=1: a trap that cannot run or bind port 53 is a failure, not a skipped assertion."},
{"id": "wrapper.e2e.context.egress", "giro": "G2", "os": ["linux", "windows"], "min_tests": 14, "exact": true, "tests": ["tests/test_nothing_leaves_but_the_proxy_e2e.py", "tests/test_a_turn_name_over_tcp_goes_through_the_proxy_of_the_context_e2e.py"], "marker": "e2e", "needs_root": ["linux"], "note": "Taken from the minimal-engine port (branch tests/minimal-port) unchanged but for the removed engine gate: 12 = 6 kinds of page work (hints, image/fetch/WebSocket/EventSource, WebRTC STUN and TURN-udp by name, geolocation, a service worker with push, a page still loading when its context closes) x 2 schemes (no proxy at launch and a gateway on the context; a launch gateway and a different one on the context), and 2 = the TURN server named over TCP in those two schemes. EXPECTED RED on the published firefox-63: the 2 TURN-by-name cases (the lookup of the TCP socket takes user context 0; fixed by commits ac0214bff4 and 058edd6cc6 of firefox-64). The 12 have not run on any engine yet. Like wrapper.e2e.doh: the Linux leg runs as root for the resolver trap (INVPW_REQUIRE_TRAP=1); on Windows the DoH log and the gateway's CONNECTs are the sink."},
{"id": "wrapper.e2e.context.sink", "giro": "G2", "os": ["linux", "windows"], "min_tests": 36, "exact": true, "tests": ["tests/test_nothing_of_a_context_leaves_but_through_its_proxy_e2e.py"], "marker": "e2e", "needs_root": ["linux"], "note": "The behavioural half of the class gate 'nothing of a context leaves but through its proxy', with a witness at an address of this host (no root, no address on lo) and the engine's own resolver log as the native-lookup sink. 35 = 31 + the 4 OCSP cases; the 31 are 19 probes (fetch, WebSocket, stun, turn over UDP, turn and turns over TCP, each by name, by IP and by a .local name, behind SOCKS5 and behind an HTTP proxy where the road differs) + 3 controls (the same probe by IP with no proxy IS heard by the witness) + 1 control of the native sink. + 4 PeerConnections built from a torn-down window (a detached iframe, a closed popup; behind SOCKS5 and behind HTTP; defect B3: EXPECTED RED on firefox-63, green on firefox-64) + 2 controls of them (the same PeerConnection from an attached iframe, green on both). + 2 cases of two contexts alive at once (each with its own proxy and DoH, a TURN server over TCP by a different name in each; behind SOCKS5 EXPECTED RED on firefox-63 like turn_tcp-name-socks5, behind HTTP green on both). EXPECTED RED on firefox-63: turn_tcp-name-socks5, turns_tcp-name-socks5 (user context 0, fixed in firefox-64) and the three .local cases fetch-local-socks5, stun-local-socks5, stun-local-http (audit B4, also red on firefox-64 until decided). The Linux leg runs as root so the resolver trap is a second sink. Windows reads the same engine log (its getaddrinfo lines are in the parent process file under the sandbox: run 43574494194), with the no-proxy native control as its positive control. THE OCSP CASES (4): a TLS page whose leaf, signed by a lab CA the engine trusts (put in the profile by the engine's xpcshell, no ignore_https_errors), names its OCSP responder by a NAME (ocsp-<nonce>.lab.test) and by an IP; a context behind the gateway loads it and the request must go through the gateway, never be looked up natively, in user context 0, or reach the responder (2 cases, EXPECTED RED on firefox-63, green on firefox-64); the same page in a context with no proxy IS asked of the responder (control); a page of an issuer the engine does not trust makes no OCSP request (negative control). THE CLOSED CONTEXT CASE (1, gated firefox-65): a beacon sent on pagehide as a proxied context closes, to a name never looked up, is resolved over the DoH through the context's gateway after the close; on firefox-64 it went to the machine's resolver every time (hunt 43733181674)."},
{"id": "wrapper.e2e.realness", "giro": "G2", "os": ["linux", "windows"], "min_tests": 32, "exact": true, "tests": ["tests/test_realness_behind_a_declared_exit_e2e.py"], "marker": "e2e", "needs_root": ["linux"], "note": "The realness check without a real proxy: six declared exits, the values a page reads, and the roads. Linux runs as root without xdist like the DoH suite (the resolver trap); on Windows the trap does not exist and the assertion on the system resolver is the only one omitted."},
{"id": "wrapper.unit.udp", "giro": "G1", "os": ["linux", "windows"], "min_tests": 263, "exact": true, "tests": ["tests/test_doh_session_prefs_unit.py", "tests/test_every_route_command_is_answered_may_fail.py", "tests/test_preload_newtab_is_written_only_when_asked.py", "tests/test_the_doh_e2e_launch_on_a_virtual_display.py", "tests/test_the_egress_sink_helpers.py", "tests/test_the_exit_of_a_context_is_discovered_through_its_own_gateway.py", "tests/test_the_fake_doh_answers.py", "tests/test_the_fake_doh_delays_and_refuses.py", "tests/test_the_h3_line_helpers.py", "tests/test_the_host_address_helper.py", "tests/test_the_http_proxy_helper_asks_for_credentials.py", "tests/test_the_lab_ca_and_its_ocsp_leaf.py", "tests/test_the_leak_watcher_sees_a_direct_connection.py", "tests/test_the_network_declaration_reaches_the_engine.py", "tests/test_the_realness_helpers.py", "tests/test_the_resolver_trap_counts_its_own_users.py", "tests/test_the_resolver_trap_is_required_by_the_gate.py", "tests/test_the_server_says_nothing_about_the_launch_counter.py", "tests/test_the_udp_bench_survives_what_a_loaded_machine_does_to_it.py", "tests/test_the_udp_chain_helper.py", "tests/test_the_witness_hears_a_direct_send.py", "tests/test_the_witness_picks_a_port_both_sockets_bind.py"], "marker": "unit", "needs_root": false, "note": "The leak watcher file defines exactly one of its two resolver-trap tests per host (7 everywhere), so no test is skipped. `exact`: min_tests is raised by hand when a test is added. The sink of the egress gate (tests/test_the_egress_sink_helpers.py, 20): the engine's log (the same on Linux and Windows) and the witness read on known inputs, and a blind log that must raise, never answer 'nothing'. The lab CA of its OCSP case (tests/test_the_lab_ca_and_its_ocsp_leaf.py, 17; tests/test_the_fake_doh_answers.py +1, the DoH serving a lab-CA leaf): the leaf's AIA, trusted and untrusted issuers, the responder, the xpcshell step."},
{"id": "wrapper.e2e.page", "giro": "G2", "os": ["linux", "windows"], "min_tests": 130, "exact": true, "tests": ["tests/test_a_tiny_download_on_a_served_browser_is_saved_e2e.py", "tests/test_a_page_that_moves_on_e2e.py", "tests/test_a_popup_is_reported_when_the_engine_says_it_is_ready_as_playwright_does_e2e.py", "tests/test_a_popup_of_a_link_reaches_the_client_e2e.py", "tests/test_popup_destinations_e2e.py", "tests/test_popups_reach_the_client_e2e.py", "tests/test_route_superseded_e2e.py", "tests/test_closing_one_of_four_browsers_does_not_hold_the_loop_e2e.py", "tests/test_a_drag_keeps_its_buttons_pressed_e2e.py"], "marker": "e2e", "needs_root": false, "note": "130 = 126 + the 4 of test_a_drag_keeps_its_buttons_pressed_e2e.py (a drag reaches the page with the button it holds: event.buttons is 1 on every mousemove of a left drag, 2 on a right one, 0 after the release; with and without humanize). The 126 before it: 116 + the 9 of test_closing_one_of_four_browsers_does_not_hold_the_loop_e2e.py (four browsers in one process, one closes: the loop is never seen inside a step of the close, the removal of the profile is held still and reached on a thread of the reaper while the close has returned, the other three keep answering; one control holds the loop on purpose, the other leaves it late in its selector and must not be charged). 116 = 100 + the 16 of test_a_page_that_moves_on_e2e.py (a navigation the page overtook with location.replace ends; the engine fix 860ef8a6d9 is proved by it; 2 of them the strict networkidle cases, a document still arriving that moves). 100 counted at the collection; was 96 = 10+32+16+34+4 before the popup tests of 6200bc2). A page is handed over when the engine says Page.ready; a popup reaches the client (link, noopener, window.open; own site and another; with and without a route; in-process and over launch_server) as Playwright's does; a superseded route. Needs the candidate binary, and the stock Playwright client of the dev extra."},
{"id": "wrapper.e2e.realness", "giro": "G2", "os": ["linux", "windows"], "min_tests": 31, "exact": true, "tests": ["tests/test_realness_behind_a_declared_exit_e2e.py"], "marker": "e2e", "needs_root": ["linux"], "note": "The realness check without a real proxy: six declared exits, the values a page reads, and the roads. Linux runs as root without xdist like the DoH suite (the resolver trap); on Windows the trap does not exist and the assertion on the system resolver is the only one omitted."},
{"id": "wrapper.unit.udp", "giro": "G1", "os": ["linux", "windows"], "min_tests": 273, "exact": true, "tests": ["tests/test_doh_session_prefs_unit.py", "tests/test_every_route_command_is_answered_may_fail.py", "tests/test_preload_newtab_is_written_only_when_asked.py", "tests/test_the_doh_e2e_launch_on_a_virtual_display.py", "tests/test_the_egress_sink_helpers.py", "tests/test_the_exit_of_a_context_is_discovered_through_its_own_gateway.py", "tests/test_the_fake_doh_answers.py", "tests/test_the_fake_doh_delays_and_refuses.py", "tests/test_the_h3_line_helpers.py", "tests/test_the_host_address_helper.py", "tests/test_the_http_proxy_helper_asks_for_credentials.py", "tests/test_the_lab_ca_and_its_ocsp_leaf.py", "tests/test_the_leak_watcher_sees_a_direct_connection.py", "tests/test_the_network_declaration_reaches_the_engine.py", "tests/test_the_realness_helpers.py", "tests/test_the_resolver_trap_counts_its_own_users.py", "tests/test_the_resolver_trap_is_required_by_the_gate.py", "tests/test_the_server_says_nothing_about_the_launch_counter.py", "tests/test_the_udp_bench_survives_what_a_loaded_machine_does_to_it.py", "tests/test_the_udp_chain_helper.py", "tests/test_the_witness_hears_a_direct_send.py", "tests/test_the_witness_picks_a_port_both_sockets_bind.py"], "marker": "unit", "needs_root": false, "note": "The leak watcher file defines exactly one of its two resolver-trap tests per host (7 everywhere), so no test is skipped. `exact`: min_tests is raised by hand when a test is added. The sink of the egress gate (tests/test_the_egress_sink_helpers.py, 20): the engine's log (the same on Linux and Windows) and the witness read on known inputs, and a blind log that must raise, never answer 'nothing'. The lab CA of its OCSP case (tests/test_the_lab_ca_and_its_ocsp_leaf.py, 17; tests/test_the_fake_doh_answers.py +1, the DoH serving a lab-CA leaf): the leaf's AIA, trusted and untrusted issuers, the responder, the xpcshell step."},
{"id": "wrapper.e2e.page", "giro": "G2", "os": ["linux", "windows"], "min_tests": 130, "exact": true, "tests": ["tests/test_a_tiny_download_on_a_served_browser_is_saved_e2e.py", "tests/test_a_page_that_moves_on_e2e.py", "tests/test_a_popup_is_reported_when_the_engine_says_it_is_ready_as_playwright_does_e2e.py", "tests/test_a_popup_of_a_link_reaches_the_client_e2e.py", "tests/test_popup_destinations_e2e.py", "tests/test_popups_reach_the_client_e2e.py", "tests/test_route_superseded_e2e.py", "tests/test_closing_one_of_four_browsers_does_not_hold_the_loop_e2e.py", "tests/test_a_drag_keeps_its_buttons_pressed_e2e.py"], "marker": "e2e", "needs_root": false, "note": "130 = 126 + the 4 of test_a_drag_keeps_its_buttons_pressed_e2e.py (a drag reaches the page with the button it holds: event.buttons is 1 on every mousemove of a left drag, 2 on a right one, 0 after the release; with and without humanize). The 126 before it: 116 + the 9 of test_closing_one_of_four_browsers_does_not_hold_the_loop_e2e.py (four browsers in one process, one closes: the loop is never seen inside a step of the close, the removal of the profile is held still and reached on a thread of the reaper while the close has returned, the other three keep answering; one control holds the loop on purpose, the other leaves it late in its selector and must not be charged). 116 = 100 + the 16 of test_a_page_that_moves_on_e2e.py (a navigation the page overtook with location.replace ends; the engine fix 860ef8a6d9 is proved by it; 2 of them the strict networkidle cases, a document still arriving that moves). 100 counted at the collection; was 96 = 10+32+16+34+4 before the popup tests of 6200bc2). A page is handed over when the engine says Page.ready; a popup reaches the client (link, noopener, window.open; own site and another; with and without a route; in-process and over launch_server) as Playwright's does; a superseded route. Needs the candidate binary, and the stock Playwright client of the dev extra.", "moz_log": "DocumentChannel:5,ProcessIsolation:5,nsDocShell:4,DocLoader:4", "juggler_trace": true},
{"id": "wrapper.unit.page", "giro": "G1", "os": ["linux", "windows"], "min_tests": 72, "exact": true, "tests": ["tests/test_a_download_finished_before_it_was_announced_is_finished.py", "tests/test_every_order_of_the_events_of_a_popup_gives_one_page_event.py", "tests/test_ci_drive_gate_goes_through_the_core.py", "tests/test_a_page_is_handed_over_only_when_the_engine_says_it_is_ready.py", "tests/test_a_new_page_waits_for_the_engine.py", "tests/test_page_number_follows_the_call.py", "tests/test_a_commit_at_any_point_of_the_hand_over_reaches_the_client_once.py", "tests/test_no_event_of_any_family_is_lost_by_the_hand_over.py", "tests/test_the_hand_over_of_a_popup_holds_under_concurrency.py", "tests/test_a_page_closed_before_its_announcement_is_not_announced.py", "tests/test_a_live_event_does_not_overtake_the_replay_of_a_new_page.py"], "marker": "unit", "needs_root": false, "note": "72 = 44 + 3+9+5+1+10 of the popup hand-over (24 counted at the collection before; was 20 = 3+8+1+8 before 6200bc2). The page dispatcher's wait for Page.ready and what it hands over; the drive gate goes through the core (the engine waits for the session's road)."},
{"id": "wrapper.e2e.compositing", "giro": "G2", "os": ["linux", "windows"], "min_tests": 9, "exact": true, "tests": ["tests/test_software_compositing_is_declared_e2e.py", "tests/test_a_screenshot_draws_the_text_of_the_bundled_fonts_as_the_content_does_e2e.py"], "marker": "e2e", "needs_root": false, "note": "The engine DECLARES software compositing on every machine (core: the compositing entries of zoom.stealth.gfx.feature_status carry the VM decision, and on Windows gfx.webrender.software=true, gfx.webrender.software.d3d11=false). 3 = (1) the compositor read from a privileged context is 'WebRender (Software)' on Windows and on Linux (windowUtils.layerManagerType of each window: Troubleshoot.snapshot().graphics throws on this engine, `ext is null`, so it is not the route); (2) the GPU process uses under 1.5 s of CPU on the fixed 10-scene loop of one browser (Windows runner: 0.32 s declared, 2.7-4.2 s not, runs 43652292533 and 43642744101; on Linux it is held to the bound if a GPU process exists); (3) the 86 keys of the page-bytes probe plus the canvas 2D scenes (drawImage scaled with smoothing off/low/medium/high, text with linear/radial/conic gradients) equal tests/data/page_bytes_<os>.json, PNGs on decoded pixels. EXPECTED RED on the core 64.71.0 (tests 1 and 2 on Windows). The reference of Windows holds the 75 stable keys and 6 of the 11 PNG keys of run 43652292533; the five other PNG keys and the new canvas keys, and all of Linux, are written from the first run on the engine of the reference (the failure of test 3 prints RECORD-BEGIN ... RECORD-END with the entries to merge): a reference that is not complete is red, never skipped. 9 = those 3 + the 6 families of tests/test_a_screenshot_draws_the_text_of_the_bundled_fonts_as_the_content_does_e2e.py (from firefox-66, engine_at_least): a screenshot draws the text of Arial, Times New Roman, Consolas and Segoe UI, with accents, the typographic apostrophe, the euro sign, Chinese, Arabic and Russian, and of MS PGothic (face 2 of msgothic5_32.ttc: Japanese and Latin) and NSimSun (face 1 of simsun.ttc: Chinese), two faces that are not the first of their collection, with the same bytes as the content process drew them in a canvas (an SVG image with a foreignObject of the same markup), cut from the same page.screenshot, on both systems and with no threshold. EXPECTED RED on every engine that rebuilds the text in the parent with another font than the bundle (Linux: fontconfig answers DejaVu Sans), and skipped, hence red here, on an engine older than firefox-66. It saves the screenshot, the two boxes and a result.json under RUNNER_TEMP/invpw-evidence."},
{"id": "wrapper.e2e.fakeweb", "giro": "G2", "os": ["linux", "windows"], "min_tests": 4, "exact": true, "tests": ["tests/test_fakeweb_p2_e2e.py", "tests/test_fakeweb_p4_e2e.py"], "marker": "e2e", "needs_root": false, "note": "The fake web, offline: our browser on the hard pages (profile P2: a reused routed page reaches networkidle every time, also under a load of three other browsers; the other site is another process) and on the 17-step journey of a person (profile P4), each judged against what stock Firefox does, as tests/fakeweb/pages.json declares it. 4 = 3 + 1. Stock itself is held to that declaration, and compared with ours step by step, by scripts/run_fakeweb.py in .github/workflows/fakeweb.yml. Needs the candidate binary (STEALTHFOX_E2E_BINARY)."},
{"id": "wrapper.e2e.compositing", "giro": "G2", "os": ["linux", "windows"], "min_tests": 9, "exact": true, "tests": ["tests/test_software_compositing_is_declared_e2e.py", "tests/test_a_screenshot_draws_the_text_of_the_bundled_fonts_as_the_content_does_e2e.py"], "marker": "e2e", "needs_root": false, "note": "The engine DECLARES software compositing on every machine (core: the compositing entries of zoom.stealth.gfx.feature_status carry the VM decision, and on Windows gfx.webrender.software=true, gfx.webrender.software.d3d11=false). 3 = (1) the compositor read from a privileged context is 'WebRender (Software)' on Windows and on Linux (windowUtils.layerManagerType of each window: Troubleshoot.snapshot().graphics throws on this engine, `ext is null`, so it is not the route); (2) the GPU process uses under 1.5 s of CPU on the fixed 10-scene loop of one browser (Windows runner: 0.32 s declared, 2.7-4.2 s not, runs 43652292533 and 43642744101; on Linux it is held to the bound if a GPU process exists); (3) the 86 keys of the page-bytes probe plus the canvas 2D scenes (drawImage scaled with smoothing off/low/medium/high, text with linear/radial/conic gradients) equal tests/data/page_bytes_<os>.json, PNGs on decoded pixels. EXPECTED RED on the core 64.71.0 (tests 1 and 2 on Windows). The reference of Windows holds the 75 stable keys and 6 of the 11 PNG keys of run 43652292533; the five other PNG keys and the new canvas keys, and all of Linux, are written from the first run on the engine of the reference (the failure of test 3 prints RECORD-BEGIN ... RECORD-END with the entries to merge): a reference that is not complete is red, never skipped. 9 = those 3 + the 6 families of tests/test_a_screenshot_draws_the_text_of_the_bundled_fonts_as_the_content_does_e2e.py (from firefox-66, engine_at_least): a screenshot draws the text of Arial, Times New Roman, Consolas and Segoe UI, with accents, the typographic apostrophe, the euro sign, Chinese, Arabic and Russian, and of MS PGothic (face 2 of msgothic5_32.ttc: Japanese and Latin) and NSimSun (face 1 of simsun.ttc: Chinese), two faces that are not the first of their collection, with the same bytes as the content process drew them in a canvas (an SVG image with a foreignObject of the same markup), cut from the same page.screenshot, on both systems and with no threshold. EXPECTED RED on every engine that rebuilds the text in the parent with another font than the bundle (Linux: fontconfig answers DejaVu Sans), and skipped, hence red here, on an engine older than firefox-66. It saves the screenshot, the two boxes and a result.json under RUNNER_TEMP/invpw-evidence.", "runner_image": {"windows": "windows-2022"}},
{"id": "wrapper.e2e.fakeweb", "giro": "G2", "os": ["linux", "windows"], "min_tests": 7, "exact": true, "tests": ["tests/test_fakeweb_p2_e2e.py", "tests/test_fakeweb_p4_e2e.py"], "marker": "e2e", "needs_root": false, "note": "The fake web, offline: our browser on the hard pages (profile P2: a reused routed page reaches networkidle every time, also under a load of three other browsers; the other site is another process) and on the 17-step journey of a person (profile P4: every step as stock, and every page left only once its noise is done), each judged against what stock Firefox does, as tests/fakeweb/pages.json declares it. 7 = 3 + 4 (the last two: a `load` that takes 20 s is a step that succeeds, and a `load` that never comes ends in an error that names the wait and the page). Stock itself is held to that declaration, and compared with ours step by step, by scripts/run_fakeweb.py in .github/workflows/fakeweb.yml. Needs the candidate binary (STEALTHFOX_E2E_BINARY).", "stock_firefox": true, "extra_steps": ["fakeweb_profiles"]},
{"id": "wrapper.e2e.stock_twin.dnd", "giro": "G2", "os": ["linux", "windows"], "min_tests": 4, "exact": true, "tests": ["tests/test_a_drag_from_the_top_into_a_frame_of_another_site_e2e.py"], "marker": "e2e", "needs_root": false, "note": "Split from the row wrapper.e2e.stock_twin, which ran past the 25-minute limit of a leg: one file, one leg. The twin of the real drag from the top into a frame of another site (4 scales): the same steps first on Playwright's own Firefox (stock_firefox), headed, driven by the stock Playwright client, and second on ours; the verdict is 'the same as the reference' (tests/_stock_twin.py). Each record keeps the page's and the chrome's devicePixelRatio and the real scale of the screen. The file is in no whole-suite row: the references are installed only for this row's legs.", "stock_firefox": true},
{"id": "wrapper.e2e.stock_twin.select", "giro": "G2", "os": ["linux", "windows"], "min_tests": 4, "exact": true, "tests": ["tests/test_a_select_dropdown_opens_at_its_element_e2e.py"], "marker": "e2e", "needs_root": false, "note": "Split from the row wrapper.e2e.stock_twin, which ran past the 25-minute limit of a leg: one file, one leg. The twin of the select dropdown (4 scales), measured from chrome scope against RETAIL Firefox 159 driven by Marionette alone, headed (the leg sets INVPW_RETAIL_FIREFOX to its firefox.exe), the reference first and ours second; the verdict is 'the same as the reference' (tests/_stock_twin.py, tests/_retail_reference.py). Each record keeps the page's and the chrome's devicePixelRatio and the real scale of the screen. The file is in no whole-suite row: the references are installed only for this row's legs.", "stock_firefox": true},
{"id": "wrapper.e2e.stock_twin.tooltip", "giro": "G2", "os": ["linux", "windows"], "min_tests": 4, "exact": true, "tests": ["tests/test_a_tooltip_opens_at_the_pointer_e2e.py"], "marker": "e2e", "needs_root": false, "note": "Split from the row wrapper.e2e.stock_twin, which ran past the 25-minute limit of a leg: one file, one leg. The twin of the tooltip (4 scales), measured from chrome scope against RETAIL Firefox 159 driven by Marionette alone, headed (the leg sets INVPW_RETAIL_FIREFOX to its firefox.exe), the reference first and ours second; the verdict is 'the same as the reference' (tests/_stock_twin.py, tests/_retail_reference.py). Each record keeps the page's and the chrome's devicePixelRatio and the real scale of the screen. The file is in no whole-suite row: the references are installed only for this row's legs.", "stock_firefox": true},
{"id": "wrapper.e2e.stock_twin.intersection", "giro": "G2", "os": ["linux", "windows"], "min_tests": 8, "exact": true, "tests": ["tests/test_intersection_and_lazy_loading_in_a_frame_of_another_site_e2e.py"], "marker": "e2e", "needs_root": false, "note": "Split from the row wrapper.e2e.stock_twin, which ran past the 25-minute limit of a leg: one file, one leg. The twin of what the IntersectionObserver of a scrolled frame of another site reads (8 steps, 4 scales) and of when a lazy frame is requested (4 distances, 4 scales): the same steps first on Playwright's own Firefox (stock_firefox), headed, driven by the stock Playwright client, and second on ours; the verdict is 'the same as the reference' (tests/_stock_twin.py). Each record keeps the page's and the chrome's devicePixelRatio and the real scale of the screen. The file is in no whole-suite row: the references are installed only for this row's legs.", "stock_firefox": true},
{"id": "wrapper.e2e.fontconfig", "giro": "G2", "os": ["linux"], "min_tests": 2, "exact": true, "tests": ["tests/test_the_parent_reads_the_bundle_from_fontconfig_s_cache_linux_e2e.py"], "marker": "e2e", "needs_root": false, "linux_only": "Fontconfig exists only on Linux: the parent of the engine shows <GRE>/fonts to it (FcConfigAppFontAddDir) to rebuild a font from a path and a face index. On Windows DirectWrite opens the file from its path, with no folder to scan and no cache to read, so this test has no Windows counterpart.", "note": "2 = (1) the stand-in that runs the engine under strace stays in the engine's place, as the core launches it (the leader of a process group of its own): a fake engine with a child, no browser; the process the launcher holds lives as long as the fake engine, and the group killed holds strace and the child (the stand-in that exec'd setsid forked and exited 0 at once: candidate 44161687675); (2) the warm launch of the parent reads the bundle from fontconfig's cache and does not scan it again (from firefox-66, engine_at_least). Two launches under strace with the same XDG_CACHE_HOME of the test, the first cold and the second warm: the cold parent opens every font file of <GRE>/fonts (the folder as the disk lists it) before any page and fontconfig writes its cache; the warm parent does not open every one of them, and it opens a *.cache-* file of fontconfig (a few files are opened to be used, so the verdict asks about the whole folder, as a scan does). Scan and drawing are told apart by position: only what the parent opens before the first page counts (the opens that draw are written as after_startup). Evidence in RUNNER_TEMP/invpw-evidence/fontconfig-cache: the interval and the number of opens of the bundle, the names of the files of the bundle each launch opened before the first page, the size of the cache file, the VmRSS of the parent after about:blank and after a page with every family, and a third launch with gfx.bundled-fonts.activate=0 (the behaviour before), which is evidence only. Needs strace on the runner: without it both are red, not skipped. No threshold."},
{"id": "wrapper.unit.compositing", "giro": "G1", "os": ["linux", "windows"], "min_tests": 30, "exact": true, "tests": ["tests/test_the_page_bytes_reference_compares_decoded_pixels.py"], "marker": "unit", "needs_root": false, "note": "The helpers of wrapper.e2e.compositing on known inputs, no browser: the PNG compared on decoded pixels (another deBG chunk and compression are the same, one pixel is not, every scanline filter), the comparison with a reference (changed, missing and extra keys named, the entry to record), the type of an engine process, an engine process known by its executable and not by the name it gives itself (Linux), and the CPU of a window, and the shape of the committed Windows reference, and the box cut out of a screenshot (its pixels, a box outside the picture refused, written as a PNG and read back, two boxes told apart by a pixel that is named, the pixels that are not grey)."},
{"id": "wrapper.unit.all.linux", "giro": "G1", "os": ["linux"], "min_tests": 2178, "exact": true, "tests": ["tests/test_a_162_message_is_read_like_a_161_one.py", "tests/test_a_click_makes_one_mousemove_at_its_point.py", "tests/test_a_closed_context_leaves_nothing_in_the_registry.py", "tests/test_a_closed_page_says_nothing.py", "tests/test_a_closed_pipe_is_a_closed_target.py", "tests/test_a_commit_at_any_point_of_the_hand_over_reaches_the_client_once.py", "tests/test_a_context_proxy_carries_its_measured_udp_exit.py", "tests/test_a_context_route_disables_the_cache.py", "tests/test_a_detached_frame_answers_detached.py", "tests/test_a_dialog_is_a_protocol_object.py", "tests/test_a_dialog_is_answered_after_a_pause.py", "tests/test_a_download_finished_before_it_was_announced_is_finished.py", "tests/test_a_failed_expect_carries_its_call_log.py", "tests/test_a_failed_launch_stops_the_display.py", "tests/test_a_field_is_typed_after_a_pause.py", "tests/test_a_launch_asks_nobody_on_the_internet_where_it_leaves_from.py", "tests/test_a_launch_gives_the_core_its_engine_for_the_security_state.py", "tests/test_a_launch_has_one_deadline.py", "tests/test_a_launch_without_a_session_gets_one.py", "tests/test_a_live_event_does_not_overtake_the_replay_of_a_new_page.py", "tests/test_a_module_that_leaves_a_browser_open_fails.py", "tests/test_a_new_page_waits_for_the_engine.py", "tests/test_a_non_finite_number_crosses_the_wire_as_a_tag.py", "tests/test_a_page_closed_before_its_announcement_is_not_announced.py", "tests/test_a_page_is_handed_over_only_when_the_engine_says_it_is_ready.py", "tests/test_a_path_leaves_as_one_stroke.py", "tests/test_a_port_number_is_held_until_it_is_used.py", "tests/test_a_request_and_a_response_are_light.py", "tests/test_a_request_says_what_it_is.py", "tests/test_a_session_ends_before_the_next_test_starts.py", "tests/test_a_stroke_is_judged_by_its_shape_not_its_length.py", "tests/test_a_unit_test_does_not_read_the_seal_of_the_job.py", "tests/test_actions_without_a_point.py", "tests/test_add_script_tag.py", "tests/test_an_expect_reads_its_value_once.py", "tests/test_async_api.py", "tests/test_browser_output_is_drained.py", "tests/test_ci_downloads_are_authenticated.py", "tests/test_ci_drive_gate_goes_through_the_core.py", "tests/test_ci_host_gate.py", "tests/test_ci_lab_geoip.py", "tests/test_ci_lab_geoip_verify.py", "tests/test_ci_lab_intermediates.py", "tests/test_ci_lab_security_state.py", "tests/test_ci_real_geoip_check.py", "tests/test_ci_real_geoip_exit_code.py", "tests/test_ci_runs_once_per_commit.py", "tests/test_ci_verdict.py", "tests/test_ci_workflows_build_the_geoip_database.py", "tests/test_ci_workflows_set_the_intermediates_list.py", "tests/test_ci_workflows_set_the_security_state.py", "tests/test_cli.py", "tests/test_click_rhythm.py", "tests/test_connect_does_not_start_threads_on_the_loop.py", "tests/test_context_locale_is_a_list.py", "tests/test_core_pin.py", "tests/test_cpu_by_type_window.py", "tests/test_cross_origin_iframe.py", "tests/test_cursor_dispatch.py", "tests/test_cursor_wiring.py", "tests/test_docs_name_the_mcp_repo_as_it_is.py", "tests/test_doh_session_prefs_unit.py", "tests/test_drag_motion.py", "tests/test_e2e_hermetic.py", "tests/test_element_handle_actions.py", "tests/test_every_order_of_the_events_of_a_popup_gives_one_page_event.py", "tests/test_every_page_draws_its_own_acts.py", "tests/test_every_refusal_is_declared.py", "tests/test_every_route_command_is_answered_may_fail.py", "tests/test_every_suite_runs_on_linux_and_windows.py", "tests/test_expose_binding_refusal.py", "tests/test_fakeweb_p4_report.py", "tests/test_fission_identity_parity_e2e.py", "tests/test_fixtures_name_why_the_package_is_missing.py", "tests/test_fork.py", "tests/test_frame_dispatch.py", "tests/test_geoip_used.py", "tests/test_goto_follows_the_base_url.py", "tests/test_hook_wiring.py", "tests/test_imports.py", "tests/test_integration.py", "tests/test_juggler_event_buffer.py", "tests/test_juggler_event_listeners.py", "tests/test_juggler_injected.py", "tests/test_juggler_lives_in_the_core.py", "tests/test_juggler_posix_pipe.py", "tests/test_juggler_transport.py", "tests/test_key_delay_reaches_the_keyboard.py", "tests/test_keyboard_rhythm.py", "tests/test_launch_counters_run_on_github.py", "tests/test_launcher_config.py", "tests/test_launcher_helpers.py", "tests/test_motion_never_hides_a_programming_error.py", "tests/test_navigation_response.py", "tests/test_new_page_defaults.py", "tests/test_no_event_of_any_family_is_lost_by_the_hand_over.py", "tests/test_no_legacy_in_the_wrapper.py", "tests/test_no_override_leaves_the_persona_scheme.py", "tests/test_no_thread_is_started_on_the_reader.py", "tests/test_page_number_follows_the_call.py", "tests/test_persistent_profile_keeps_state.py", "tests/test_pin.py", "tests/test_pin_dicts_are_valid.py", "tests/test_pinning_doc.py", "tests/test_pointer_server.py", "tests/test_popup_adoption_unit.py", "tests/test_prefs_composition_arm.py", "tests/test_preload_newtabLine truncated
{"id": "wrapper.unit.all.windows", "giro": "G1", "os": ["windows"], "min_tests": 2179, "exact": true, "tests": ["tests/test_a_162_message_is_read_like_a_161_one.py", "tests/test_a_click_makes_one_mousemove_at_its_point.py", "tests/test_a_closed_context_leaves_nothing_in_the_registry.py", "tests/test_a_closed_page_says_nothing.py", "tests/test_a_closed_pipe_is_a_closed_target.py", "tests/test_a_commit_at_any_point_of_the_hand_over_reaches_the_client_once.py", "tests/test_a_context_proxy_carries_its_measured_udp_exit.py", "tests/test_a_context_route_disables_the_cache.py", "tests/test_a_detached_frame_answers_detached.py", "tests/test_a_dialog_is_a_protocol_object.py", "tests/test_a_dialog_is_answered_after_a_pause.py", "tests/test_a_download_finished_before_it_was_announced_is_finished.py", "tests/test_a_failed_expect_carries_its_call_log.py", "tests/test_a_failed_launch_stops_the_display.py", "tests/test_a_field_is_typed_after_a_pause.py", "tests/test_a_launch_asks_nobody_on_the_internet_where_it_leaves_from.py", "tests/test_a_launch_gives_the_core_its_engine_for_the_security_state.py", "tests/test_a_launch_has_one_deadline.py", "tests/test_a_launch_without_a_session_gets_one.py", "tests/test_a_live_event_does_not_overtake_the_replay_of_a_new_page.py", "tests/test_a_module_that_leaves_a_browser_open_fails.py", "tests/test_a_new_page_waits_for_the_engine.py", "tests/test_a_non_finite_number_crosses_the_wire_as_a_tag.py", "tests/test_a_page_closed_before_its_announcement_is_not_announced.py", "tests/test_a_page_is_handed_over_only_when_the_engine_says_it_is_ready.py", "tests/test_a_path_leaves_as_one_stroke.py", "tests/test_a_port_number_is_held_until_it_is_used.py", "tests/test_a_request_and_a_response_are_light.py", "tests/test_a_request_says_what_it_is.py", "tests/test_a_session_ends_before_the_next_test_starts.py", "tests/test_a_stroke_is_judged_by_its_shape_not_its_length.py", "tests/test_a_unit_test_does_not_read_the_seal_of_the_job.py", "tests/test_actions_without_a_point.py", "tests/test_add_script_tag.py", "tests/test_an_expect_reads_its_value_once.py", "tests/test_async_api.py", "tests/test_browser_output_is_drained.py", "tests/test_ci_downloads_are_authenticated.py", "tests/test_ci_drive_gate_goes_through_the_core.py", "tests/test_ci_host_gate.py", "tests/test_ci_lab_geoip.py", "tests/test_ci_lab_geoip_verify.py", "tests/test_ci_lab_intermediates.py", "tests/test_ci_lab_security_state.py", "tests/test_ci_real_geoip_check.py", "tests/test_ci_real_geoip_exit_code.py", "tests/test_ci_runs_once_per_commit.py", "tests/test_ci_verdict.py", "tests/test_ci_workflows_build_the_geoip_database.py", "tests/test_ci_workflows_set_the_intermediates_list.py", "tests/test_ci_workflows_set_the_security_state.py", "tests/test_cli.py", "tests/test_click_rhythm.py", "tests/test_connect_does_not_start_threads_on_the_loop.py", "tests/test_context_locale_is_a_list.py", "tests/test_core_pin.py", "tests/test_cpu_by_type_window.py", "tests/test_cross_origin_iframe.py", "tests/test_cursor_dispatch.py", "tests/test_cursor_wiring.py", "tests/test_docs_name_the_mcp_repo_as_it_is.py", "tests/test_doh_session_prefs_unit.py", "tests/test_drag_motion.py", "tests/test_e2e_hermetic.py", "tests/test_element_handle_actions.py", "tests/test_every_order_of_the_events_of_a_popup_gives_one_page_event.py", "tests/test_every_page_draws_its_own_acts.py", "tests/test_every_refusal_is_declared.py", "tests/test_every_route_command_is_answered_may_fail.py", "tests/test_every_suite_runs_on_linux_and_windows.py", "tests/test_expose_binding_refusal.py", "tests/test_fakeweb_p4_report.py", "tests/test_fission_identity_parity_e2e.py", "tests/test_fixtures_name_why_the_package_is_missing.py", "tests/test_fork.py", "tests/test_frame_dispatch.py", "tests/test_geoip_used.py", "tests/test_goto_follows_the_base_url.py", "tests/test_hook_wiring.py", "tests/test_imports.py", "tests/test_integration.py", "tests/test_juggler_event_buffer.py", "tests/test_juggler_event_listeners.py", "tests/test_juggler_injected.py", "tests/test_juggler_lives_in_the_core.py", "tests/test_juggler_transport.py", "tests/test_key_delay_reaches_the_keyboard.py", "tests/test_keyboard_rhythm.py", "tests/test_launch_counters_run_on_github.py", "tests/test_launcher_config.py", "tests/test_launcher_helpers.py", "tests/test_motion_never_hides_a_programming_error.py", "tests/test_navigation_response.py", "tests/test_new_page_defaults.py", "tests/test_no_event_of_any_family_is_lost_by_the_hand_over.py", "tests/test_no_legacy_in_the_wrapper.py", "tests/test_no_override_leaves_the_persona_scheme.py", "tests/test_no_thread_is_started_on_the_reader.py", "tests/test_page_number_follows_the_call.py", "tests/test_persistent_profile_keeps_state.py", "tests/test_pin.py", "tests/test_pin_dicts_are_valid.py", "tests/test_pinning_doc.py", "tests/test_pointer_server.py", "tests/test_popup_adoption_unit.py", "tests/test_prefs_composition_arm.py", "tests/test_prefs_composition_arm_on_windows.py", "tests/tLine truncated
{"id": "wrapper.e2e.securitystate", "giro": "G2", "os": ["linux", "windows"], "min_tests": 4, "exact": true, "tests": ["tests/test_security_state_engine_e2e.py"], "marker": "e2e", "needs_root": false, "note": "The security state the core declares, against the engine: the engine launched directly in its generate mode makes what it is given (the contract's result, security_state/ with the bytes of the full filter and of the delta, the core's own validation of it); a normal launch declares no pref of the mode and re-imports nothing; a certificate that Mozilla's CRLite test data say is revoked in a delta is refused at the first navigation (SEC_ERROR_REVOKED_CERTIFICATE) while a valid one loads, and the revoked one loads when the ready directory has no data; a ready directory with no or an empty security_state/ starts. Certificates made on the run (a fresh root trusted in cert9.db by the engine's own xpcshell, Mozilla's default test key as the key of CN=int), servers on loopback, no network. Red on firefox-67 (no generate mode)."}
{"id": "wrapper.unit.all.linux", "giro": "G1", "os": ["linux"], "min_tests": 4375, "exact": true, "tests": ["tests/test_a_162_message_is_read_like_a_161_one.py", "tests/test_a_click_makes_one_mousemove_at_its_point.py", "tests/test_a_closed_context_leaves_nothing_in_the_registry.py", "tests/test_a_closed_page_says_nothing.py", "tests/test_a_closed_pipe_is_a_closed_target.py", "tests/test_a_commit_at_any_point_of_the_hand_over_reaches_the_client_once.py", "tests/test_a_context_proxy_carries_its_measured_udp_exit.py", "tests/test_a_context_route_disables_the_cache.py", "tests/test_a_detached_frame_answers_detached.py", "tests/test_a_dialog_is_a_protocol_object.py", "tests/test_a_dialog_is_answered_after_a_pause.py", "tests/test_a_download_finished_before_it_was_announced_is_finished.py", "tests/test_a_failed_expect_carries_its_call_log.py", "tests/test_a_failed_generation_of_the_security_state_keeps_its_evidence.py", "tests/test_a_failed_launch_stops_the_display.py", "tests/test_a_field_is_typed_after_a_pause.py", "tests/test_a_file_chooser_is_never_dropped_in_silence.py", "tests/test_a_frame_tap_needs_a_context_with_touch.py", "tests/test_a_gil_free_thread_dump_kills_a_busy_process_and_the_stack_watchdog_does_not.py", "tests/test_a_handle_action_walks_like_a_selector_action.py", "tests/test_a_launch_asks_nobody_on_the_internet_where_it_leaves_from.py", "tests/test_a_launch_gives_the_core_its_engine_for_the_security_state.py", "tests/test_a_launch_has_one_deadline.py", "tests/test_a_launch_without_a_session_gets_one.py", "tests/test_a_live_event_does_not_overtake_the_replay_of_a_new_page.py", "tests/test_a_marionette_session_is_asked_after_the_first_window.py", "tests/test_a_module_that_leaves_a_browser_open_fails.py", "tests/test_a_new_page_waits_for_the_engine.py", "tests/test_a_non_finite_number_crosses_the_wire_as_a_tag.py", "tests/test_a_page_closed_before_its_announcement_is_not_announced.py", "tests/test_a_page_is_handed_over_only_when_the_engine_says_it_is_ready.py", "tests/test_a_path_leaves_as_one_stroke.py", "tests/test_a_port_number_is_held_until_it_is_used.py", "tests/test_a_read_whose_probe_ran_out_is_the_callers_timeout.py", "tests/test_a_request_and_a_response_are_light.py", "tests/test_a_request_says_what_it_is.py", "tests/test_a_screenshot_refuses_what_would_touch_the_page.py", "tests/test_a_screenshot_sends_its_scale_to_the_engine.py", "tests/test_a_session_ends_before_the_next_test_starts.py", "tests/test_a_streamed_upload_is_staged_in_the_session.py", "tests/test_a_stroke_is_judged_by_its_shape_not_its_length.py", "tests/test_a_test_that_is_not_e2e_never_leaves_the_machine.py", "tests/test_a_unit_test_does_not_read_the_seal_of_the_job.py", "tests/test_ab_host.py", "tests/test_ab_host_aa_stable.py", "tests/test_ab_network.py", "tests/test_ab_network_turn_credential.py", "tests/test_ab_network_turn_deallocation.py", "tests/test_ab_network_webrtc_evidence.py", "tests/test_ab_oracle.py", "tests/test_ab_oracle_declared_differences.py", "tests/test_actions_without_a_point.py", "tests/test_add_script_tag.py", "tests/test_an_element_handle_serves_every_method_of_the_client.py", "tests/test_an_expect_reads_its_value_once.py", "tests/test_async_api.py", "tests/test_browser_output_is_drained.py", "tests/test_ci_downloads_are_authenticated.py", "tests/test_ci_drive_gate_goes_through_the_core.py", "tests/test_ci_host_gate.py", "tests/test_ci_host_gate_ab.py", "tests/test_ci_lab_geoip.py", "tests/test_ci_lab_geoip_verify.py", "tests/test_ci_lab_intermediates.py", "tests/test_ci_lab_security_state.py", "tests/test_ci_linux_legs_read_no_mirror.py", "tests/test_ci_poison_host.py", "tests/test_ci_published_set.py", "tests/test_ci_real_geoip_check.py", "tests/test_ci_real_geoip_exit_code.py", "tests/test_ci_runs_once_per_commit.py", "tests/test_ci_suite_run.py", "tests/test_ci_verdict.py", "tests/test_ci_windows_temp_is_on_d.py", "tests/test_ci_workflows_build_the_geoip_database.py", "tests/test_ci_workflows_set_the_intermediates_list.py", "tests/test_ci_workflows_set_the_security_state.py", "tests/test_cli.py", "tests/test_click_rhythm.py", "tests/test_connect_does_not_start_threads_on_the_loop.py", "tests/test_context_locale_is_a_list.py", "tests/test_core_pin.py", "tests/test_cpu_by_type_window.py", "tests/test_cross_origin_iframe.py", "tests/test_cursor_dispatch.py", "tests/test_cursor_wiring.py", "tests/test_docs_name_the_mcp_repo_as_it_is.py", "tests/test_doh_session_prefs_unit.py", "tests/test_drag_motion.py", "tests/test_e2e_hermetic.py", "tests/test_element_handle_actions.py", "tests/test_every_action_is_pinned_by_commit_sha.py", "tests/test_every_argument_reaches_the_page_as_playwright_sends_it.py", "tests/test_every_held_request_of_the_journey_starts_after_the_load.py", "tests/test_every_order_of_the_events_of_a_popup_gives_one_page_event.py", "tests/test_every_page_a_twin_asks_for_is_routed.py", "tests/test_every_page_draws_its_own_acts.py", "tests/test_every_refusal_is_declared.py", "tests/tLine truncated
{"id": "wrapper.unit.all.windows", "giro": "G1", "os": ["windows"], "min_tests": 4387, "exact": true, "tests": ["tests/test_a_162_message_is_read_like_a_161_one.py", "tests/test_a_click_makes_one_mousemove_at_its_point.py", "tests/test_a_closed_context_leaves_nothing_in_the_registry.py", "tests/test_a_closed_page_says_nothing.py", "tests/test_a_closed_pipe_is_a_closed_target.py", "tests/test_a_commit_at_any_point_of_the_hand_over_reaches_the_client_once.py", "tests/test_a_context_proxy_carries_its_measured_udp_exit.py", "tests/test_a_context_route_disables_the_cache.py", "tests/test_a_detached_frame_answers_detached.py", "tests/test_a_dialog_is_a_protocol_object.py", "tests/test_a_dialog_is_answered_after_a_pause.py", "tests/test_a_download_finished_before_it_was_announced_is_finished.py", "tests/test_a_failed_expect_carries_its_call_log.py", "tests/test_a_failed_generation_of_the_security_state_keeps_its_evidence.py", "tests/test_a_failed_launch_stops_the_display.py", "tests/test_a_field_is_typed_after_a_pause.py", "tests/test_a_file_chooser_is_never_dropped_in_silence.py", "tests/test_a_frame_tap_needs_a_context_with_touch.py", "tests/test_a_gil_free_thread_dump_kills_a_busy_process_and_the_stack_watchdog_does_not.py", "tests/test_a_handle_action_walks_like_a_selector_action.py", "tests/test_a_launch_asks_nobody_on_the_internet_where_it_leaves_from.py", "tests/test_a_launch_gives_the_core_its_engine_for_the_security_state.py", "tests/test_a_launch_has_one_deadline.py", "tests/test_a_launch_without_a_session_gets_one.py", "tests/test_a_live_event_does_not_overtake_the_replay_of_a_new_page.py", "tests/test_a_marionette_session_is_asked_after_the_first_window.py", "tests/test_a_module_that_leaves_a_browser_open_fails.py", "tests/test_a_new_page_waits_for_the_engine.py", "tests/test_a_non_finite_number_crosses_the_wire_as_a_tag.py", "tests/test_a_page_closed_before_its_announcement_is_not_announced.py", "tests/test_a_page_is_handed_over_only_when_the_engine_says_it_is_ready.py", "tests/test_a_path_leaves_as_one_stroke.py", "tests/test_a_port_number_is_held_until_it_is_used.py", "tests/test_a_read_whose_probe_ran_out_is_the_callers_timeout.py", "tests/test_a_request_and_a_response_are_light.py", "tests/test_a_request_says_what_it_is.py", "tests/test_a_screenshot_refuses_what_would_touch_the_page.py", "tests/test_a_screenshot_sends_its_scale_to_the_engine.py", "tests/test_a_session_ends_before_the_next_test_starts.py", "tests/test_a_streamed_upload_is_staged_in_the_session.py", "tests/test_a_stroke_is_judged_by_its_shape_not_its_length.py", "tests/test_a_test_that_is_not_e2e_never_leaves_the_machine.py", "tests/test_a_unit_test_does_not_read_the_seal_of_the_job.py", "tests/test_ab_host.py", "tests/test_ab_host_aa_stable.py", "tests/test_ab_network.py", "tests/test_ab_network_turn_credential.py", "tests/test_ab_network_turn_deallocation.py", "tests/test_ab_network_webrtc_evidence.py", "tests/test_ab_oracle.py", "tests/test_ab_oracle_declared_differences.py", "tests/test_actions_without_a_point.py", "tests/test_add_script_tag.py", "tests/test_an_element_handle_serves_every_method_of_the_client.py", "tests/test_an_expect_reads_its_value_once.py", "tests/test_async_api.py", "tests/test_browser_output_is_drained.py", "tests/test_ci_downloads_are_authenticated.py", "tests/test_ci_drive_gate_goes_through_the_core.py", "tests/test_ci_host_gate.py", "tests/test_ci_host_gate_ab.py", "tests/test_ci_lab_geoip.py", "tests/test_ci_lab_geoip_verify.py", "tests/test_ci_lab_intermediates.py", "tests/test_ci_lab_security_state.py", "tests/test_ci_linux_legs_read_no_mirror.py", "tests/test_ci_poison_host.py", "tests/test_ci_published_set.py", "tests/test_ci_real_geoip_check.py", "tests/test_ci_real_geoip_exit_code.py", "tests/test_ci_runs_once_per_commit.py", "tests/test_ci_suite_run.py", "tests/test_ci_verdict.py", "tests/test_ci_windows_temp_is_on_d.py", "tests/test_ci_workflows_build_the_geoip_database.py", "tests/test_ci_workflows_set_the_intermediates_list.py", "tests/test_ci_workflows_set_the_security_state.py", "tests/test_cli.py", "tests/test_click_rhythm.py", "tests/test_connect_does_not_start_threads_on_the_loop.py", "tests/test_context_locale_is_a_list.py", "tests/test_core_pin.py", "tests/test_cpu_by_type_window.py", "tests/test_cross_origin_iframe.py", "tests/test_cursor_dispatch.py", "tests/test_cursor_wiring.py", "tests/test_docs_name_the_mcp_repo_as_it_is.py", "tests/test_doh_session_prefs_unit.py", "tests/test_drag_motion.py", "tests/test_e2e_hermetic.py", "tests/test_element_handle_actions.py", "tests/test_every_action_is_pinned_by_commit_sha.py", "tests/test_every_argument_reaches_the_page_as_playwright_sends_it.py", "tests/test_every_held_request_of_the_journey_starts_after_the_load.py", "tests/test_every_order_of_the_events_of_a_popup_gives_one_page_event.py", "tests/test_every_page_a_twin_asks_for_is_routed.py", "tests/test_every_page_draws_its_own_acts.py", "tests/test_every_pytest_process_clears_the_gp_Line truncated
{"id": "wrapper.e2e.securitystate", "giro": "G2", "os": ["linux", "windows"], "min_tests": 4, "exact": true, "tests": ["tests/test_security_state_engine_e2e.py"], "marker": "e2e", "needs_root": false, "note": "The security state the core declares, against the engine: the engine launched directly in its generate mode makes what it is given (the contract's result, security_state/ with the bytes of the full filter and of the delta, the core's own validation of it); a normal launch declares no pref of the mode and re-imports nothing; a certificate that Mozilla's CRLite test data say is revoked in a delta is refused at the first navigation (SEC_ERROR_REVOKED_CERTIFICATE) while a valid one loads, and the revoked one loads when the ready directory has no data; a ready directory with no or an empty security_state/ starts. Certificates made on the run (a fresh root trusted in cert9.db by the engine's own xpcshell, Mozilla's default test key as the key of CN=int), servers on loopback, no network. Red on firefox-67 (no generate mode).", "core_dumps": "invpw-cores"},
{"id": "wrapper.e2e.suite.linux.1", "giro": "G2", "os": ["linux"], "min_tests": 447, "exact": true, "tests": ["tests/test_a_closed_browser_leaves_the_others_alone_e2e.py", "tests/test_a_context_that_ends_leaves_no_process_e2e.py", "tests/test_a_cors_preflight_is_not_a_request_of_the_page_e2e.py", "tests/test_a_declared_webgl_extension_survives_its_use_e2e.py", "tests/test_a_granted_permission_is_the_one_the_page_asks_for_e2e.py", "tests/test_a_held_ice_port_blinds_the_loopback_checks_e2e.py", "tests/test_a_launch_without_a_session_gets_one_e2e.py", "tests/test_a_left_documents_body_is_evicted_e2e.py", "tests/test_a_mouse_click_makes_one_mousemove_on_its_point_e2e.py", "tests/test_a_page_over_ipv6_gathers_on_a_machine_declared_without_it_e2e.py", "tests/test_a_popup_is_reported_when_the_engine_says_it_is_ready_as_playwright_does_e2e.py", "tests/test_a_screenshot_draws_the_text_of_the_bundled_fonts_as_the_content_does_e2e.py", "tests/test_a_screenshot_honours_its_scale_e2e.py", "tests/test_a_screenshot_refuses_what_would_touch_the_page_e2e.py", "tests/test_a_served_browser_answers_a_plain_client_e2e.py", "tests/test_a_tiny_download_on_a_served_browser_is_saved_e2e.py", "tests/test_a_turn_name_over_tcp_goes_through_the_proxy_of_the_context_e2e.py", "tests/test_accept_language_on_the_wire_e2e.py", "tests/test_browser_output_is_drained.py", "tests/test_click_rhythm.py", "tests/test_closing_one_of_four_browsers_does_not_hold_the_loop_e2e.py", "tests/test_control_a_selects_all_in_a_field_e2e.py", "tests/test_cross_origin_iframe.py", "tests/test_declared_host_network_e2e.py", "tests/test_detectors_e2e.py", "tests/test_e2e.py", "tests/test_element_handle_actions.py", "tests/test_element_screenshot_e2e.py", "tests/test_every_page_draws_its_own_acts.py", "tests/test_file_chooser.py", "tests/test_fingerprint_surface.py", "tests/test_fission_frames_history_and_processes_e2e.py", "tests/test_fission_frames_workers_storage_and_special_frames_e2e.py", "tests/test_frames_outlive_the_back_forward_cache_e2e.py", "tests/test_goto_networkidle_after_spa_e2e.py", "tests/test_goto_script_redirect_e2e.py", "tests/test_hidden_display_linux.py", "tests/test_ice_names_by_the_context_proxy_e2e.py::test_the_ice_name_of_a_context_goes_by_the_proxy_of_that_context", "tests/test_ignore_https_errors_e2e.py", "tests/test_injected_node_surface.py", "tests/test_juggler_connection.py", "tests/test_juggler_posix_pipe.py", "tests/test_juggler_transport.py", "tests/test_navigation_across_processes_e2e.py", "tests/test_navigation_response.py", "tests/test_networkidle_reaches_the_client_e2e.py", "tests/test_oop_frame_element.py", "tests/test_oop_frame_geometry.py", "tests/test_page_number_follows_the_call.py", "tests/test_persistent_profile_keeps_state.py", "tests/test_pointer_position.py", "tests/test_popups_reach_the_client_e2e.py", "tests/test_preload_newtab_turns_the_privileged_about_process_off_e2e.py", "tests/test_realness_behind_a_declared_exit_e2e.py", "tests/test_resolver_race_e2e.py", "tests/test_route_header_order_e2e.py", "tests/test_same_document_goto_e2e.py", "tests/test_screencast.py", "tests/test_screencast_stop_e2e.py", "tests/test_screenshot_looks_where_you_are.py", "tests/test_security_state_engine_e2e.py", "tests/test_service_worker.py", "tests/test_service_worker_controller_e2e.py", "tests/test_set_offline_e2e.py", "tests/test_shadow_trusted_input.py", "tests/test_strict_and_force.py", "tests/test_the_callers_code_is_not_counted_e2e.py", "tests/test_the_device_enumeration_takes_the_declared_time_e2e.py", "tests/test_the_engine_is_born_in_the_job_e2e.py::test_a_launch_scans_no_process_of_the_machine", "tests/test_the_engine_is_born_in_the_job_e2e.py::test_after_close_no_process_of_the_session_is_left", "tests/test_the_hosts_file_of_the_host_is_never_read_e2e.py", "tests/test_trial_does_not_act.py", "tests/test_turn_over_tcp_is_tried_for_real_e2e.py", "tests/test_ua_widget_not_selectable.py", "tests/test_voices_e2e.py", "tests/test_wait_for_function.py", "tests/test_webgl_draws_on_the_engine_s_own_gl_e2e.py", "tests/test_webgl_noise_active.py", "tests/test_webrtc_realness.py::test_a_gateway_that_is_far_away_still_gives_the_page_a_srflx_born_through_its_relay", "tests/test_webrtc_realness.py::test_a_gather_after_the_page_loaded_through_the_gateway_costs_only_the_road_to_the_server", "tests/test_webrtc_realness.py::test_a_host_with_ipv6_addresses_gathers_through_an_ipv4_relay", "tests/test_webrtc_realness.py::test_a_proxy_that_does_not_relay_udp_gives_no_srflx_at_all", "tests/test_webrtc_realness.py::test_a_proxy_whose_relay_never_answers_gives_no_srflx_at_all", "tests/test_webrtc_realness.py::test_a_proxy_whose_udp_leaves_from_another_address_gives_no_srflx_at_all", "tests/test_webrtc_realness.py::test_not_blocked_behind_tcp_only_socks", "tests/test_webrtc_realness.py::test_the_first_candidate_of_a_gather_does_not_wait_for_a_gateway_that_is_far_away", "tests/test_webrtc_realness.py::test_the_turn_over_tcp_of_a_context_goes_throuLine truncated
{"id": "wrapper.e2e.suite.linux.2", "giro": "G2", "os": ["linux"], "min_tests": 420, "exact": true, "tests": ["tests/test_a_click_waits_for_the_navigation_it_plans_e2e.py", "tests/test_a_context_init_script_runs_once_e2e.py", "tests/test_a_drag_keeps_its_buttons_pressed_e2e.py", "tests/test_a_field_is_typed_after_a_pause.py", "tests/test_a_goto_to_a_response_with_no_document_ends_e2e.py", "tests/test_a_keepalive_request_reaches_the_client_e2e.py", "tests/test_a_latin_letter_on_a_cyrillic_persona_e2e.py", "tests/test_a_page_cannot_probe_the_juggler_e2e.py", "tests/test_a_page_that_moves_on_e2e.py", "tests/test_a_pointer_event_is_handled_before_the_call_returns_e2e.py", "tests/test_a_request_says_what_it_is_e2e.py", "tests/test_a_select_dropdown_stays_open_after_the_release_e2e.py", "tests/test_a_worker_comes_back_with_its_page_from_the_cache_e2e.py", "tests/test_actions_without_a_point.py", "tests/test_add_script_tag.py", "tests/test_an_isolated_page_and_the_next_e2e.py", "tests/test_bypass_csp_e2e.py", "tests/test_caller_world_handles_e2e.py", "tests/test_canvas_reads_as_drawn.py", "tests/test_canvas_render_stealth.py", "tests/test_context_locale_e2e.py", "tests/test_context_proxy_only_resolves_by_doh_e2e.py", "tests/test_doh_through_the_proxy_e2e.py", "tests/test_doh_under_stress_e2e.py", "tests/test_download_is_intercepted_e2e.py", "tests/test_drag_motion.py", "tests/test_expose_binding_e2e.py", "tests/test_fakeweb_p4_e2e.py", "tests/test_fingerprint_consistency.py", "tests/test_fission_frames_dialogs_downloads_popups_e2e.py", "tests/test_fission_frames_route_and_bindings_e2e.py", "tests/test_fission_identity_parity_e2e.py", "tests/test_fission_iframe_crash_e2e.py", "tests/test_fission_strategy1_bench.py", "tests/test_goto_to_the_same_url_e2e.py", "tests/test_http3_through_the_proxy_e2e.py", "tests/test_input_is_born_before_the_page_sees_it_e2e.py", "tests/test_juggler_actions.py", "tests/test_juggler_event_listeners.py", "tests/test_juggler_injected.py::test_a_javascript_that_THROWS_arrives_as_an_error_not_as_None", "tests/test_juggler_injected.py::test_actionability_DISTINGUISHES_instead_of_always_saying_yes", "tests/test_juggler_injected.py::test_reads_that_make_no_sense_are_REJECTED", "tests/test_juggler_injected.py::test_states_DISCRIMINATE_instead_of_always_saying_true", "tests/test_juggler_injected.py::test_the_DOM_READING_group", "tests/test_juggler_injected.py::test_the_selector_engines_respond", "tests/test_juggler_injected.py::test_the_text_reads", "tests/test_juggler_lifecycle_e2e.py", "tests/test_key_delay_reaches_the_keyboard.py", "tests/test_keyboard_rhythm.py", "tests/test_long_session_e2e.py", "tests/test_mouse.py", "tests/test_mouse_events_keep_their_values_e2e.py", "tests/test_new_page_defaults.py", "tests/test_popup_destinations_e2e.py", "tests/test_popup_pages.py", "tests/test_proxy_http_auth_e2e.py", "tests/test_proxy_reaches_the_browser.py", "tests/test_proxy_socks_auth_e2e.py", "tests/test_requestless_navigation.py", "tests/test_route_abort_code.py", "tests/test_route_e2e.py", "tests/test_route_post_data_e2e.py", "tests/test_route_sends_a_navigation_elsewhere_e2e.py", "tests/test_route_superseded_e2e.py", "tests/test_same_document_navigation.py", "tests/test_screenshot_of_text_returns_linux_e2e.py", "tests/test_scroll_into_view.py", "tests/test_scroll_only_if_needed_e2e.py", "tests/test_service_workers_blocked.py", "tests/test_set_input_files_payloads.py", "tests/test_software_compositing_is_declared_e2e.py", "tests/test_the_association_is_ready_when_the_peerconnection_is_born_e2e.py", "tests/test_the_callers_code_runs_once_e2e.py", "tests/test_the_close_returns_when_the_browser_has_exited_e2e.py", "tests/test_the_favicon_stays_out_of_sight_e2e.py", "tests/test_the_font_list_is_the_bundle_e2e.py", "tests/test_the_parent_reads_the_bundle_from_fontconfig_s_cache_linux_e2e.py", "tests/test_the_scheme_is_the_personas_e2e.py", "tests/test_the_whole_udp_chain_by_name_e2e.py::test_a_turn_srflx_by_name_arrives_through_the_relay_when_the_exit_of_the_lab_is_loopback", "tests/test_typing_a_character_without_a_key_e2e.py", "tests/test_wait_for_timeout.py", "tests/test_web_fonts_of_closed_contexts_e2e.py"], "marker": "e2e", "needs_root": false, "windows_twin": "wrapper.e2e.suite.windows.2", "note": "Part 2 of the whole e2e suite of the wrapper (every test that opens the browser: what e2e.yml runs on the published engine), on the engine under test, as two passes through scripts/ci_suite_run.py (4 browsers at once, then the wall_clock tests alone; no rerun). The files of the 2 rows of linux are the files of tests/ that tests/test_the_e2e_suite_is_accounted_for.py holds one by one: a file whole when every test of it is here, else its tests by name. Partition from the junits of runs 44942540063 and 44985244053, test time balanced (about 564 s of estimated wall time, 4 browsers). A new file is added by hand to a row of each system and the minimum of the row goes up by hand. Left out of every row,Line truncated
{"id": "wrapper.e2e.suite.linux.3", "giro": "G2", "os": ["linux"], "min_tests": 333, "exact": true, "tests": ["tests/test_a_click_in_an_iframe_lands_at_the_frames_own_screen_origin_e2e.py", "tests/test_a_context_language_is_the_accept_language_of_every_request_e2e.py", "tests/test_a_file_chooser_reaches_every_client_e2e.py", "tests/test_a_frame_reads_only_declared_origins_while_it_loads_e2e.py", "tests/test_a_goto_to_a_refused_port_ends_with_its_reason_e2e.py", "tests/test_a_handle_action_walks_like_a_selector_action_e2e.py", "tests/test_a_launch_and_a_context_timezone_reach_the_page_e2e.py", "tests/test_a_navigation_that_moved_is_told_by_the_engine_e2e.py", "tests/test_a_popup_moves_and_resizes_as_declared_e2e.py", "tests/test_a_popup_of_a_link_reaches_the_client_e2e.py", "tests/test_a_regional_indicator_pair_measures_the_same_first_and_after_other_families_e2e.py", "tests/test_an_element_handle_serves_every_method_of_the_client_e2e.py", "tests/test_audio_context_values_are_declared_e2e.py", "tests/test_audio_noise_e2e.py", "tests/test_audio_sample_rate_is_declared_e2e.py", "tests/test_bundle_font_names_e2e.py", "tests/test_canvas_create_pattern_projection_e2e.py", "tests/test_canvas_measure_text_metrics_e2e.py", "tests/test_css_media_reads_the_declared_screen_and_pointer_e2e.py", "tests/test_dom_iterables_from_evaluate_e2e.py", "tests/test_every_argument_reaches_the_page_e2e.py", "tests/test_every_reader_of_a_webgl_canvas_agrees_e2e.py", "tests/test_exslt_date_time_through_an_imported_stylesheet_is_in_the_declared_zone_e2e.py", "tests/test_fakeweb_p2_e2e.py", "tests/test_fission_frames_tree_input_and_pixels_e2e.py", "tests/test_focus_survives_os_deactivation_e2e.py", "tests/test_fullscreen_without_wm_e2e.py", "tests/test_geolocation_reads_nothing_of_the_host_windows_e2e.py", "tests/test_goto_and_every_way_it_is_stopped_e2e.py", "tests/test_hardware_values_are_declared_e2e.py", "tests/test_input_reaches_the_top_and_a_frame_of_another_site_at_every_scale_e2e.py", "tests/test_ipv6_literal_connect_e2e.py", "tests/test_moz_element_paints_a_webgl_canvas_as_drawn_e2e.py", "tests/test_native_line_endings_are_windows_e2e.py", "tests/test_nested_frame_actions.py", "tests/test_networkidle_through_a_served_browser_with_routes_e2e.py", "tests/test_nothing_leaves_but_the_proxy_e2e.py", "tests/test_nothing_of_a_context_leaves_but_through_its_proxy_e2e.py", "tests/test_page_element_atoms_run_in_a_sandbox_e2e.py", "tests/test_popup_geometry_is_the_declared_frame_e2e.py", "tests/test_script_cache_written_is_adopted_e2e.py", "tests/test_the_branding_a_page_loads_is_the_declared_archive_e2e.py", "tests/test_the_evaluated_code_has_no_debugger_name_e2e.py", "tests/test_the_host_gl_probe_runs_only_on_an_undeclared_engine_linux_e2e.py", "tests/test_the_launch_counter_is_one_plain_get_before_any_page_e2e.py", "tests/test_the_maximized_window_frames_and_popups_read_retail_e2e.py", "tests/test_the_parent_methods_of_the_window_origin_are_not_exposed_to_a_page_e2e.py", "tests/test_the_shutdown_ping_leaves_by_the_background_task_e2e.py", "tests/test_webgl_declared_parameters_e2e.py", "tests/test_webgl_shader_language_e2e.py", "tests/test_webgpu_adapter_is_declared_e2e.py", "tests/test_webgpu_canvas_readback_is_noised_e2e.py", "tests/test_webgpu_external_texture_e2e.py", "tests/test_window_occlusion_e2e.py"], "marker": "e2e", "needs_root": false, "windows_twin": "wrapper.e2e.suite.windows.3", "note": "Part 2 of the whole e2e suite of the wrapper (every test that opens the browser: what e2e.yml runs on the published engine), on the engine under test, as two passes through scripts/ci_suite_run.py (4 browsers at once, then the wall_clock tests alone; no rerun). The files of the 2 rows of linux are the files of tests/ that tests/test_the_e2e_suite_is_accounted_for.py holds one by one: a file whole when every test of it is here, else its tests by name. Partition from the junits of runs 44942540063 and 44985244053, test time balanced (about 565 s of estimated wall time, 4 browsers). A new file is added by hand to a row of each system and the minimum of the row goes up by hand. Left out of every row, with the reason in the accounting test: the files and tests of wrapper.e2e.udp.exit and wrapper.e2e.udp.sandbox (root and user namespaces, their own rows), the files of the round after the publication (tests/_post_publication.py), and the tests that skip on linux (a skip is red in the verdict).", "run": "suite_run"},
{"id": "wrapper.e2e.suite.windows.1", "giro": "G2", "os": ["windows"], "min_tests": 332, "exact": true, "tests": ["tests/test_a_click_waits_for_the_navigation_it_plans_e2e.py", "tests/test_a_closed_browser_leaves_the_others_alone_e2e.py", "tests/test_a_context_init_script_runs_once_e2e.py", "tests/test_a_goto_to_a_refused_port_ends_with_its_reason_e2e.py", "tests/test_a_granted_permission_is_the_one_the_page_asks_for_e2e.py", "tests/test_a_held_ice_port_blinds_the_loopback_checks_e2e.py", "tests/test_a_left_documents_body_is_evicted_e2e.py", "tests/test_a_page_cannot_probe_the_juggler_e2e.py", "tests/test_a_screenshot_honours_its_scale_e2e.py", "tests/test_a_screenshot_refuses_what_would_touch_the_page_e2e.py", "tests/test_a_tiny_download_on_a_served_browser_is_saved_e2e.py", "tests/test_a_worker_comes_back_with_its_page_from_the_cache_e2e.py", "tests/test_browser_output_is_drained.py", "tests/test_canvas_create_pattern_projection_e2e.py", "tests/test_click_rhythm.py", "tests/test_closing_one_of_four_browsers_does_not_hold_the_loop_e2e.py", "tests/test_context_locale_e2e.py", "tests/test_context_proxy_only_resolves_by_doh_e2e.py", "tests/test_detectors_e2e.py", "tests/test_download_is_intercepted_e2e.py", "tests/test_e2e.py", "tests/test_element_handle_actions.py", "tests/test_every_page_draws_its_own_acts.py", "tests/test_every_reader_of_a_webgl_canvas_agrees_e2e.py", "tests/test_fission_identity_parity_e2e.py", "tests/test_fission_iframe_crash_e2e.py", "tests/test_focus_survives_os_deactivation_e2e.py", "tests/test_geolocation_reads_nothing_of_the_host_windows_e2e.py", "tests/test_goto_to_the_same_url_e2e.py", "tests/test_ignore_https_errors_e2e.py", "tests/test_juggler_actions.py", "tests/test_juggler_transport.py", "tests/test_keyboard_rhythm.py", "tests/test_moz_element_paints_a_webgl_canvas_as_drawn_e2e.py", "tests/test_nested_frame_actions.py", "tests/test_popups_reach_the_client_e2e.py", "tests/test_preload_newtab_turns_the_privileged_about_process_off_e2e.py", "tests/test_route_superseded_e2e.py", "tests/test_scroll_only_if_needed_e2e.py", "tests/test_security_state_engine_e2e.py", "tests/test_service_worker.py", "tests/test_service_workers_blocked.py", "tests/test_strict_and_force.py", "tests/test_the_engine_is_born_in_the_job_e2e.py", "tests/test_the_hosts_file_of_the_host_is_never_read_e2e.py", "tests/test_the_shutdown_ping_leaves_by_the_background_task_e2e.py", "tests/test_trial_does_not_act.py", "tests/test_ua_widget_not_selectable.py", "tests/test_webgpu_canvas_readback_is_noised_e2e.py"], "marker": "e2e", "needs_root": false, "linux_twin": "wrapper.e2e.suite.linux.1", "note": "Part 1 of the whole e2e suite of the wrapper (every test that opens the browser: what e2e.yml runs on the published engine), on the engine under test, as two passes through scripts/ci_suite_run.py (4 browsers at once, then the wall_clock tests alone; no rerun). The files of the 4 rows of windows are the files of tests/ that tests/test_the_e2e_suite_is_accounted_for.py holds one by one: a file whole when every test of it is here, else its tests by name. Partition from the junits of runs 44942540063 and 44985244053, test time balanced (about 609 s of estimated wall time, 4 browsers). A new file is added by hand to a row of each system and the minimum of the row goes up by hand. Left out of every row, with the reason in the accounting test: the files and tests of wrapper.e2e.udp.exit and wrapper.e2e.udp.sandbox (root and user namespaces, their own rows), the files of the round after the publication (tests/_post_publication.py), and the tests that skip on windows (a skip is red in the verdict).", "runner_image": {"windows": "windows-2022"}, "run": "suite_run"},
{"id": "wrapper.e2e.suite.windows.2", "giro": "G2", "os": ["windows"], "min_tests": 291, "exact": true, "tests": ["tests/test_a_file_chooser_reaches_every_client_e2e.py", "tests/test_a_goto_to_a_response_with_no_document_ends_e2e.py", "tests/test_a_latin_letter_on_a_cyrillic_persona_e2e.py", "tests/test_a_navigation_that_moved_is_told_by_the_engine_e2e.py", "tests/test_a_regional_indicator_pair_measures_the_same_first_and_after_other_families_e2e.py", "tests/test_a_select_dropdown_stays_open_after_the_release_e2e.py", "tests/test_a_turn_name_over_tcp_goes_through_the_proxy_of_the_context_e2e.py", "tests/test_add_script_tag.py", "tests/test_an_element_handle_serves_every_method_of_the_client_e2e.py", "tests/test_an_isolated_page_and_the_next_e2e.py", "tests/test_audio_context_values_are_declared_e2e.py", "tests/test_bundle_font_names_e2e.py", "tests/test_caller_world_handles_e2e.py", "tests/test_canvas_reads_as_drawn.py", "tests/test_canvas_render_stealth.py", "tests/test_css_media_reads_the_declared_screen_and_pointer_e2e.py", "tests/test_declared_host_network_e2e.py", "tests/test_every_argument_reaches_the_page_e2e.py", "tests/test_expose_binding_e2e.py", "tests/test_fission_frames_dialogs_downloads_popups_e2e.py", "tests/test_fullscreen_without_wm_e2e.py", "tests/test_goto_networkidle_after_spa_e2e.py", "tests/test_goto_script_redirect_e2e.py", "tests/test_hidden_desktop.py", "tests/test_ice_names_by_the_context_proxy_e2e.py::test_the_ice_name_of_a_context_goes_by_the_proxy_of_that_context", "tests/test_juggler_lifecycle_e2e.py", "tests/test_key_delay_reaches_the_keyboard.py", "tests/test_long_session_e2e.py", "tests/test_mouse.py", "tests/test_native_line_endings_are_windows_e2e.py", "tests/test_navigation_across_processes_e2e.py", "tests/test_networkidle_reaches_the_client_e2e.py", "tests/test_nothing_leaves_but_the_proxy_e2e.py", "tests/test_nothing_of_a_context_leaves_but_through_its_proxy_e2e.py", "tests/test_oop_frame_geometry.py", "tests/test_proxy_socks_auth_e2e.py", "tests/test_resolver_race_e2e.py", "tests/test_route_e2e.py", "tests/test_screencast_stop_e2e.py", "tests/test_the_branding_a_page_loads_is_the_declared_archive_e2e.py", "tests/test_the_device_enumeration_takes_the_declared_time_e2e.py", "tests/test_the_evaluated_code_has_no_debugger_name_e2e.py", "tests/test_the_favicon_stays_out_of_sight_e2e.py", "tests/test_the_font_list_is_the_bundle_e2e.py", "tests/test_the_scheme_is_the_personas_e2e.py", "tests/test_the_whole_udp_chain_by_name_e2e.py::test_a_turn_srflx_by_name_arrives_through_the_relay_when_the_exit_of_the_lab_is_loopback", "tests/test_turn_over_tcp_is_tried_for_real_e2e.py", "tests/test_voices_e2e.py", "tests/test_wait_for_function.py", "tests/test_wait_for_timeout.py", "tests/test_web_fonts_of_closed_contexts_e2e.py", "tests/test_webrtc_realness.py::test_a_gateway_that_is_far_away_still_gives_the_page_a_srflx_born_through_its_relay", "tests/test_webrtc_realness.py::test_a_gather_after_the_page_loaded_through_the_gateway_costs_only_the_road_to_the_server", "tests/test_webrtc_realness.py::test_a_host_with_ipv6_addresses_gathers_through_an_ipv4_relay", "tests/test_webrtc_realness.py::test_a_proxy_that_does_not_relay_udp_gives_no_srflx_at_all", "tests/test_webrtc_realness.py::test_a_proxy_whose_relay_never_answers_gives_no_srflx_at_all", "tests/test_webrtc_realness.py::test_a_proxy_whose_udp_leaves_from_another_address_gives_no_srflx_at_all", "tests/test_webrtc_realness.py::test_not_blocked_behind_tcp_only_socks", "tests/test_webrtc_realness.py::test_the_first_candidate_of_a_gather_does_not_wait_for_a_gateway_that_is_far_away", "tests/test_webrtc_realness.py::test_the_turn_over_tcp_of_a_context_goes_through_the_proxy_of_that_context", "tests/test_webrtc_realness.py::test_two_contexts_with_two_proxies_each_gets_the_srflx_of_its_own"], "marker": "e2e", "needs_root": false, "linux_twin": "wrapper.e2e.suite.linux.2", "note": "Part 2 of the whole e2e suite of the wrapper (every test that opens the browser: what e2e.yml runs on the published engine), on the engine under test, as two passes through scripts/ci_suite_run.py (4 browsers at once, then the wall_clock tests alone; no rerun). The files of the 4 rows of windows are the files of tests/ that tests/test_the_e2e_suite_is_accounted_for.py holds one by one: a file whole when every test of it is here, else its tests by name. Partition from the junits of runs 44942540063 and 44985244053, test time balanced (about 610 s of estimated wall time, 4 browsers). A new file is added by hand to a row of each system and the minimum of the row goes up by hand. Left out of every row, with the reason in the accounting test: the files and tests of wrapper.e2e.udp.exit and wrapper.e2e.udp.sandbox (root and user namespaces, their own rows), the files of the round after the publication (tests/_post_publication.py), and the tests that skip on windows (a skip is red in the verdict).", "runner_image": {"windows": "windows-2022"}, "run": "suite_run"},
{"id": "wrapper.e2e.suite.windows.3", "giro": "G2", "os": ["windows"], "min_tests": 277, "exact": true, "tests": ["tests/test_a_click_in_an_iframe_lands_at_the_frames_own_screen_origin_e2e.py", "tests/test_a_context_that_ends_leaves_no_process_e2e.py", "tests/test_a_cors_preflight_is_not_a_request_of_the_page_e2e.py", "tests/test_a_launch_without_a_session_gets_one_e2e.py", "tests/test_a_mouse_click_makes_one_mousemove_on_its_point_e2e.py", "tests/test_a_page_over_ipv6_gathers_on_a_machine_declared_without_it_e2e.py", "tests/test_a_served_browser_answers_a_plain_client_e2e.py", "tests/test_actions_without_a_point.py", "tests/test_audio_noise_e2e.py", "tests/test_audio_sample_rate_is_declared_e2e.py", "tests/test_bypass_csp_e2e.py", "tests/test_control_a_selects_all_in_a_field_e2e.py", "tests/test_cross_origin_iframe.py", "tests/test_dom_iterables_from_evaluate_e2e.py", "tests/test_drag_motion.py", "tests/test_element_screenshot_e2e.py", "tests/test_fakeweb_p4_e2e.py", "tests/test_fingerprint_consistency.py", "tests/test_first_launch_from_a_new_path.py", "tests/test_fission_frames_history_and_processes_e2e.py", "tests/test_fission_frames_workers_storage_and_special_frames_e2e.py", "tests/test_fission_strategy1_bench.py", "tests/test_goto_and_every_way_it_is_stopped_e2e.py", "tests/test_http3_through_the_proxy_e2e.py", "tests/test_input_is_born_before_the_page_sees_it_e2e.py", "tests/test_ipv6_literal_connect_e2e.py", "tests/test_networkidle_through_a_served_browser_with_routes_e2e.py", "tests/test_page_number_follows_the_call.py", "tests/test_persistent_profile_keeps_state.py", "tests/test_pointer_position.py", "tests/test_popup_destinations_e2e.py", "tests/test_popup_pages.py", "tests/test_proxy_http_auth_e2e.py", "tests/test_requestless_navigation.py", "tests/test_route_abort_code.py", "tests/test_route_post_data_e2e.py", "tests/test_same_document_navigation.py", "tests/test_screencast.py", "tests/test_screenshot_looks_where_you_are.py", "tests/test_service_worker_controller_e2e.py", "tests/test_set_input_files_payloads.py", "tests/test_set_offline_e2e.py", "tests/test_the_callers_code_is_not_counted_e2e.py", "tests/test_the_callers_code_runs_once_e2e.py", "tests/test_the_close_returns_when_the_browser_has_exited_e2e.py", "tests/test_the_launch_counter_is_one_plain_get_before_any_page_e2e.py", "tests/test_webgl_declared_parameters_e2e.py", "tests/test_webgl_shader_language_e2e.py", "tests/test_webgpu_adapter_is_declared_e2e.py", "tests/test_webgpu_external_texture_e2e.py"], "marker": "e2e", "needs_root": false, "linux_twin": "wrapper.e2e.suite.linux.1", "note": "Part 3 of the whole e2e suite of the wrapper (every test that opens the browser: what e2e.yml runs on the published engine), on the engine under test, as two passes through scripts/ci_suite_run.py (4 browsers at once, then the wall_clock tests alone; no rerun). The files of the 4 rows of windows are the files of tests/ that tests/test_the_e2e_suite_is_accounted_for.py holds one by one: a file whole when every test of it is here, else its tests by name. Partition from the junits of runs 44942540063 and 44985244053, test time balanced (about 610 s of estimated wall time, 4 browsers). A new file is added by hand to a row of each system and the minimum of the row goes up by hand. Left out of every row, with the reason in the accounting test: the files and tests of wrapper.e2e.udp.exit and wrapper.e2e.udp.sandbox (root and user namespaces, their own rows), the files of the round after the publication (tests/_post_publication.py), and the tests that skip on windows (a skip is red in the verdict).", "runner_image": {"windows": "windows-2022"}, "run": "suite_run"},
{"id": "wrapper.e2e.suite.windows.4", "giro": "G2", "os": ["windows"], "min_tests": 293, "exact": true, "tests": ["tests/test_a_context_language_is_the_accept_language_of_every_request_e2e.py", "tests/test_a_declared_webgl_extension_survives_its_use_e2e.py", "tests/test_a_drag_keeps_its_buttons_pressed_e2e.py", "tests/test_a_field_is_typed_after_a_pause.py", "tests/test_a_frame_reads_only_declared_origins_while_it_loads_e2e.py", "tests/test_a_handle_action_walks_like_a_selector_action_e2e.py", "tests/test_a_keepalive_request_reaches_the_client_e2e.py", "tests/test_a_launch_and_a_context_timezone_reach_the_page_e2e.py", "tests/test_a_page_that_moves_on_e2e.py", "tests/test_a_pointer_event_is_handled_before_the_call_returns_e2e.py", "tests/test_a_popup_is_reported_when_the_engine_says_it_is_ready_as_playwright_does_e2e.py", "tests/test_a_popup_moves_and_resizes_as_declared_e2e.py", "tests/test_a_popup_of_a_link_reaches_the_client_e2e.py", "tests/test_a_request_says_what_it_is_e2e.py", "tests/test_a_screenshot_draws_the_text_of_the_bundled_fonts_as_the_content_does_e2e.py", "tests/test_accept_language_on_the_wire_e2e.py", "tests/test_canvas_measure_text_metrics_e2e.py", "tests/test_doh_through_the_proxy_e2e.py", "tests/test_doh_under_stress_e2e.py", "tests/test_exslt_date_time_through_an_imported_stylesheet_is_in_the_declared_zone_e2e.py", "tests/test_fakeweb_p2_e2e.py", "tests/test_file_chooser.py", "tests/test_fingerprint_surface.py", "tests/test_fission_frames_route_and_bindings_e2e.py", "tests/test_fission_frames_tree_input_and_pixels_e2e.py", "tests/test_frames_outlive_the_back_forward_cache_e2e.py", "tests/test_hardware_values_are_declared_e2e.py", "tests/test_injected_node_surface.py", "tests/test_input_reaches_the_top_and_a_frame_of_another_site_at_every_scale_e2e.py", "tests/test_juggler_connection.py", "tests/test_juggler_event_listeners.py", "tests/test_juggler_injected.py::test_a_javascript_that_THROWS_arrives_as_an_error_not_as_None", "tests/test_juggler_injected.py::test_actionability_DISTINGUISHES_instead_of_always_saying_yes", "tests/test_juggler_injected.py::test_reads_that_make_no_sense_are_REJECTED", "tests/test_juggler_injected.py::test_states_DISCRIMINATE_instead_of_always_saying_true", "tests/test_juggler_injected.py::test_the_DOM_READING_group", "tests/test_juggler_injected.py::test_the_selector_engines_respond", "tests/test_juggler_injected.py::test_the_text_reads", "tests/test_mouse_events_keep_their_values_e2e.py", "tests/test_navigation_response.py", "tests/test_new_page_defaults.py", "tests/test_oop_frame_element.py", "tests/test_page_element_atoms_run_in_a_sandbox_e2e.py", "tests/test_popup_geometry_is_the_declared_frame_e2e.py", "tests/test_proxy_reaches_the_browser.py", "tests/test_realness_behind_a_declared_exit_e2e.py", "tests/test_route_header_order_e2e.py", "tests/test_route_sends_a_navigation_elsewhere_e2e.py", "tests/test_same_document_goto_e2e.py", "tests/test_script_cache_written_is_adopted_e2e.py", "tests/test_scroll_into_view.py", "tests/test_shadow_trusted_input.py", "tests/test_software_compositing_is_declared_e2e.py", "tests/test_the_association_is_ready_when_the_peerconnection_is_born_e2e.py", "tests/test_the_maximized_window_frames_and_popups_read_retail_e2e.py", "tests/test_the_parent_methods_of_the_window_origin_are_not_exposed_to_a_page_e2e.py", "tests/test_typing_a_character_without_a_key_e2e.py", "tests/test_webgl_noise_active.py", "tests/test_window_occlusion_e2e.py"], "marker": "e2e", "needs_root": false, "linux_twin": "wrapper.e2e.suite.linux.2", "note": "Part 4 of the whole e2e suite of the wrapper (every test that opens the browser: what e2e.yml runs on the published engine), on the engine under test, as two passes through scripts/ci_suite_run.py (4 browsers at once, then the wall_clock tests alone; no rerun). The files of the 4 rows of windows are the files of tests/ that tests/test_the_e2e_suite_is_accounted_for.py holds one by one: a file whole when every test of it is here, else its tests by name. Partition from the junits of runs 44942540063 and 44985244053, test time balanced (about 609 s of estimated wall time, 4 browsers). A new file is added by hand to a row of each system and the minimum of the row goes up by hand. Left out of every row, with the reason in the accounting test: the files and tests of wrapper.e2e.udp.exit and wrapper.e2e.udp.sandbox (root and user namespaces, their own rows), the files of the round after the publication (tests/_post_publication.py), and the tests that skip on windows (a skip is red in the verdict).", "runner_image": {"windows": "windows-2022"}, "run": "suite_run"},
{"id": "wrapper.e2e.suite.windows.control_a", "giro": "G2", "os": ["windows"], "min_tests": 20, "exact": true, "tests": ["tests/test_control_a_selects_all_in_a_field_e2e.py"], "marker": "e2e", "needs_root": false, "linux_twin": "wrapper.e2e.suite.linux.1", "note": "The keyboard shortcut Control+A selects all in a field (5 ways to press it x an input and a textarea, in-process and served to the stock client), alone on its own Windows runner (windows-latest), as e2e.yml runs it on the published engine: the Windows keyboard of a real user is what it needs. The same file is in one of wrapper.e2e.suite.windows.1..4 and in wrapper.e2e.suite.linux.1.", "run": "suite_run"},
{"id": "wrapper.e2e.ab_oracle", "giro": "G2", "os": ["linux", "windows"], "min_tests": 1, "exact": true, "tests": ["tests/test_ab_oracle_e2e.py"], "marker": "e2e", "needs_root": false, "note": "Same seed, same bytes: the engine of the published set (the last published engine, with its own core and wrapper) against the candidate (with core_ref and wrapper_ref), on one machine, after the control: the published engine against ITSELF (the A/A; a difference is a broken control, exit 2, and the A/B is not run). On a pull request (no candidate: INVPW_BINARY_PATH is the published engine, no INVISIBLE_SEAL_FILE) the A/A is the whole test, on the first two seeds of the candidate set (all five when the pull request changes a file of this oracle: the step of e2e.yml that runs scripts/ci_ab_pr_seeds.py exports AB_ORACLE_PR_SEEDS), and saves both dumps and the diff under $AB_ORACLE_OUT or $RUNNER_TEMP/invpw-evidence/ab-oracle. scripts/ci_ab_oracle.py runs the host gate's dump (scripts/ci_host_gate.py dump: the persona seeds of ci/persona-seeds.json, each at its own DPR with nothing pinned, the whole page of scripts/host_gate; the `candidate` set of 5 seeds that reach every webgl renderer and every DPR, or with AB_ORACLE_SEED_SET=final and AB_ORACLE_SHARD=i/n the 20 seeds that reach every value of every dimension split over n jobs) twice, once with the published engine (fetched by the published set's own core under its own seal, which checks the archive's sha256, and dumped in that set's venv) and once with the candidate binary of the leg under its own seal, and compares every leaf of every visit: the only differences allowed are the `noise` entries of scripts/host_gate/exceptions.json and the diag. keys; anything else is red with the leaf, the two values and the seed; fewer leaves than the host gate's reference holds (16439 per visit; a DPR the reference does not record is held to the least of those it does) is red. The files (dump-<N>.json, dump-<N>-again.json for the tag of the published set, diff-a-a.json and, with a candidate, dump-candidate.json and diff.json) are the artifact ab-oracle-<os> of the leg. 1 = the one test; the comparator's own cases (51, the A/A's among them) are in tests/test_ab_oracle.py, the persona seeds' (15) in tests/test_persona_cover.py, in the rows of the whole unit suite. Needs the engine's binary (INVPW_BINARY_PATH) and, for the A/B, the candidate's seal (INVISIBLE_SEAL_FILE) and the network (the release assets of the published engine, and INVPW_PUBLISHED_PYTHON). Each engine runs with the core it was built for: a core that declares less than the published engine requires is no longer a red of this suite (it was: engine candidate 5, every A/B a broken control). THE CONTROL IS THE PUBLISHED SET, as a user installs it: the last invisible-playwright on the index, the invisible-core it pins exactly and the engine that core's seal pins, in a venv of their own (ci/py-lock/published.txt, installed by hash from the run's wheelhouse; scripts/ci_published_set.py; INVPW_PUBLISHED_PYTHON is its python). The candidate's side is the candidate engine with core_ref and wrapper_ref. No tag is written in a harness file.", "timeout_minutes": 50, "core_dumps": "cores", "extra_steps": ["keep_oracle_files"], "artifact": "ab-oracle"},
{"id": "wrapper.e2e.ab_network", "giro": "G2", "os": ["linux", "windows"], "min_tests": 1, "exact": true, "tests": ["tests/test_ab_network_e2e.py"], "marker": "e2e", "needs_root": false, "note": "Network A/B oracle: the P4 journey, HTTPS h1/h2 (ClientHello, h2 frames, header order), HTTP/3 (transport parameters, H3 SETTINGS), WebRTC through the coherent SOCKS5 lab gateway, DNS through the fake DoH, and an idle launch; transcripts compared leaf by leaf, direct connections red on either side. A/A first (the published engine twice: a difference is a broken control; ci/ab-network-volatile.json holds the leaves the A/A proved volatile, and may only shrink), then the published engine against the candidate. Without a candidate (a PR's e2e) the A/A alone, on the first seed (all five when the pull request changes a file of this oracle: AB_NETWORK_PR_SEEDS), in jobs of its own in e2e.yml on Linux and on Windows (the shared e2e jobs leave this file out). THE CONTROL IS THE PUBLISHED SET, as a user installs it: the last invisible-playwright on the index, the invisible-core it pins exactly and the engine that core's seal pins, in a venv of their own (ci/py-lock/published.txt, installed by hash from the run's wheelhouse; scripts/ci_published_set.py; INVPW_PUBLISHED_PYTHON is its python). The candidate's side is the candidate engine with core_ref and wrapper_ref. No tag is written in a harness file.", "timeout_minutes": 75, "core_dumps": "cores", "extra_steps": ["keep_oracle_files"]},
{"id": "wrapper.e2e.ab_host", "giro": "G2", "os": ["linux", "windows"], "min_tests": 1, "exact": true, "tests": ["tests/test_ab_host_e2e.py"], "marker": "e2e", "needs_root": false, "note": "Host A/B oracle: the whole TRACE of a closed run, from the launch to the exit of the browser, after the same journey. Compared: the processes by kind (the parent, -contentproc type, sandboxingKind, isForBrowser, the helpers by what they ran) with their count, except for the kinds of type tab whose count follows the idle time (only their presence counts), and the host paths the tree touched, judged by one rule (red if and only if a path is in all the measured launches of one engine and in no launch of the other, the long launches included; every other path that differs is listed in not-judged.json, not judged); what is ours (the package, the profile and temp dirs of the launch, the run cache, its own shared memory) leaves the comparison as a class. Linux: strace of the whole tree. Windows: the process-creation audit (event 4688, with the command line) and an ETW file trace of Kernel-File, which need an administrator. It has jobs of its own in e2e.yml on Linux and on Windows (a measurement shares the machine with no other browser), and its footprints keep the lifecycle of the tree (who started and ended when, how) and how the close ended. Each engine run starts with a discarded warm-up launch whose trace is kept and listed apart (what only the warm-up did, with the process that did it); only the tree of the launch is compared (a Windows service's paths are counted by process name and left out), and a path or a kind that differs names the processes to blame. A/A first, then the published engine against the candidate; the one declared difference (Linux glxtest, gone on the 69) is in ci/ab-host-expected.json, applied by kind, a list that may only shrink. There is no list of noise. Without a candidate (a PR e2e) the A/A alone, on the first two seeds (all five when the pull request changes a file of this oracle: AB_HOST_PR_SEEDS). THE CONTROL IS THE PUBLISHED SET, as a user installs it: the last invisible-playwright on the index, the invisible-core it pins exactly and the engine that core's seal pins, in a venv of their own (ci/py-lock/published.txt, installed by hash from the run's wheelhouse; scripts/ci_published_set.py; INVPW_PUBLISHED_PYTHON is its python). The candidate's side is the candidate engine with core_ref and wrapper_ref. No tag is written in a harness file.", "runner_image": {"windows": "windows-2022"}, "timeout_minutes": 50, "core_dumps": "cores", "stock_firefox": ["windows"], "location_service": ["windows"], "extra_steps": ["keep_oracle_files"]},
{"id": "wrapper.e2e.ab_host_crash", "giro": "G2", "os": ["linux"], "min_tests": 1, "exact": true, "tests": ["tests/test_ab_host_crash_linux_e2e.py"], "marker": "e2e", "needs_root": false, "linux_only": "A signal sent to the parent of the browser with os.kill, the core the kernel writes and gdb reads, and the signal line of strace exist on Linux only: Windows has no counterpart of this test. What a Windows launch that did not end with 0 leaves (the `.extra` files and the minidump names, read from the crash folders) is held by the unit tests of the recorder with fake launches, and by every Windows leg of the three oracles, which are red on any parent that does not end with 0.", "note": "The recorder of the host oracle, tested on a launch that dies on purpose: scripts/ci_ab_host.py crash-probe launches the engine once under the oracle's stand-in (strace of the tree, cores enabled, a crash watcher), sends SIGSEGV to the browser's parent with os.kill and closes it as the oracle closes its launches; the test passes when the oracle reports RED (exit 1, `FAIL the parent process exited with code ...: seed N, launch crash`) and the artifact (RUNNER_TEMP/invpw-evidence/ab-host-crash) holds the signal line of the strace log (strace-signals.txt, strace-tail.txt), the core run through gdb (gdb-core.*.txt: `thread apply all bt`, the MOZ_CRASH reason, `info sharedlibrary`), the build ids and what the collectors did not find (said.txt). It fails when the oracle says green for a launch that died, when the evidence is missing and when the probe did not run; the red of the probe does not make the job red. It runs in the job of the host oracle on Linux (e2e-host: strace, gdb and elfutils installed, kernel.core_pattern pointed at INVPW_CORE_DIR), after the A/A, and is left out of the shared e2e job (OWN_JOB_FILES).", "timeout_minutes": 35, "core_dumps": "cores", "extra_steps": ["keep_oracle_files"]}
]
+6 -1
View File
@@ -8,5 +8,10 @@
{"file": "tests/unit/test_canvas_text_refs.py", "reason": "feature cancelled with the 69 backlog (21/11)", "date": "2026-11-21", "tests": {"wrapper.unit.all.linux": 7, "wrapper.unit.all.windows": 7}},
{"file": "tests/unit/test_compare_canvas_text_runs.py", "reason": "feature cancelled with the 69 backlog (21/11)", "date": "2026-11-21", "tests": {"wrapper.unit.all.linux": 3, "wrapper.unit.all.windows": 3}},
{"file": "tests/unit/test_fontconfig_criterion.py", "reason": "feature cancelled with the 69 backlog (21/11)", "date": "2026-11-21", "tests": {"wrapper.unit.all.linux": 5, "wrapper.unit.all.windows": 5}},
{"file": "tests/unit/test_theme_refusal_drop.py", "reason": "feature cancelled with the 69 backlog (21/11)", "date": "2026-11-21", "tests": {"wrapper.unit.all.linux": 3, "wrapper.unit.all.windows": 3}}
{"file": "tests/unit/test_theme_refusal_drop.py", "reason": "feature cancelled with the 69 backlog (21/11)", "date": "2026-11-21", "tests": {"wrapper.unit.all.linux": 3, "wrapper.unit.all.windows": 3}},
{"nodeid": "tests/test_detectors_e2e.py::test_the_headless_detector_sees_no_headless_and_no_proxy_tell", "suite": "wrapper.e2e.suite.linux.1", "count": 1, "from_min_tests": 449, "reason": "removed with the vendored bundle whose licence notice cannot ship without a studied system's name (pm, 27/11)", "decided_by": "pm", "date": "2026-11-27"},
{"nodeid": "tests/test_realness_behind_a_declared_exit_e2e.py::test_the_vendored_detection_page_finds_nothing_behind_the_gateway", "suite": "wrapper.e2e.suite.linux.1", "count": 1, "from_min_tests": 449, "reason": "removed with the vendored bundle whose licence notice cannot ship without a studied system's name (pm, 27/11)", "decided_by": "pm", "date": "2026-11-27"},
{"nodeid": "tests/test_detectors_e2e.py::test_the_headless_detector_sees_no_headless_and_no_proxy_tell", "suite": "wrapper.e2e.suite.windows.1", "count": 1, "from_min_tests": 333, "reason": "removed with the vendored bundle whose licence notice cannot ship without a studied system's name (pm, 27/11)", "decided_by": "pm", "date": "2026-11-27"},
{"nodeid": "tests/test_realness_behind_a_declared_exit_e2e.py::test_the_vendored_detection_page_finds_nothing_behind_the_gateway", "suite": "wrapper.e2e.suite.windows.4", "count": 1, "from_min_tests": 274, "reason": "removed with the vendored bundle whose licence notice cannot ship without a studied system's name (pm, 27/11)", "decided_by": "pm", "date": "2026-11-27"},
{"nodeid": "tests/test_realness_behind_a_declared_exit_e2e.py::test_the_vendored_detection_page_finds_nothing_behind_the_gateway", "suite": "wrapper.e2e.realness", "count": 1, "from_min_tests": 32, "reason": "removed with the vendored bundle whose licence notice cannot ship without a studied system's name (pm, 27/11)", "decided_by": "pm", "date": "2026-11-27"}
]
+2 -2
View File
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
[project]
name = "invisible_playwright"
version = "0.58.0"
version = "0.61.0"
description = "Playwright wrapper for a patched Firefox with deterministic stealth profile."
readme = "README.md"
requires-python = ">=3.11"
@@ -69,7 +69,7 @@ dependencies = [
# metadata; nothing in src/ hardcodes a second copy (tests/test_core_pin.py
# fails if one appears). What stays invisible to install-time machinery is the
# --no-deps / lockfile residue, and _pin.py is the only layer that sees it.
"invisible_core==68.80.0",
"invisible_core==71.85.0",
# ⛔ playwright is NO LONGER a dependency: since the full fork, the Python
# client lives in src/invisible_playwright/_pw/ and its server in
# src/invisible_playwright/_juggler/ (no Node driver). Reintroducing it would not visibly
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
+749
View File
@@ -0,0 +1,749 @@
#!/usr/bin/env python3
"""A/B oracle: same seed, same bytes, the published engine against the candidate.
A page reads the same values from two engines that differ only by the work of one
release. This runs the host gate's dump (scripts/ci_host_gate.py dump: the page in
scripts/host_gate, whole APIs) twice on the SAME machine, each engine with ITS OWN core and wrapper
(the published engine with the published set, the candidate with core_ref and wrapper_ref), over the persona seeds (ci/persona-seeds.json, computed by scripts/persona_cover.py
from the prefs the core emits: the `candidate` set, 5 seeds that reach every webgl renderer
and every DPR, or the `final` set, 20 seeds that reach every value of every dimension). Each
seed runs at its OWN DPR (nothing is pinned):
1. with the published engine: the one the PUBLISHED SET carries (scripts/ci_published_set.py:
the last wrapper on the index, the core it pins, the engine that core's seal pins). The
set's venv fetches its own engine the way a user's core does (ensure_binary under its
own seal, which checks the sha256 of the archive and the engine against the seal) and
the dump runs in that venv: the engine is launched by the core it was built for;
2. with the candidate binary the gate already holds, under its own seal, in the venv of
the job (core_ref, wrapper_ref).
The dump also reads what the host gate's retail comparison leaves alone, the ab. leaves (ci_host_gate.is_ab): ab.poison on every seed (zone, language, colour scheme, a
canary font and the audio context, which scripts/ci_poison_host.py holds to the declared identity on a poisoned host) and, on seeds 0 and 63, the extra visit of every realm and
window a page can make (--ab; ci_host_gate.ab_visit). They are compared like every other leaf; the diag. ones are not.
Then every leaf of every visit is compared. Everything must be equal. The only
differences allowed are the `noise` entries of host_gate/exceptions.json (values that
differ between two launches of one engine) and keys under the diag. prefix (what the
page records about the host). Any other difference is red and is printed with the leaf,
the two values and the seed. It is also red when a visit is missing on one side, or when a
visit compares fewer leaves than MIN_LEAVES says: a page that dumped less than the host gate's
own reference would pass anything.
DECLARED DIFFERENCES. ci/ab-oracle-expected.json (format ab-oracle-expected/1) lists, one row per os x seed x dpr x leaf, the differences between the published engine and the candidate that a
release is known to make, each with the two values and the reason. They are applied to the A/B only, never to the A/A (the engine against itself has none). A difference is allowed only
when a row matches it exactly: the same os (the leg's), seed, dpr and leaf, and both values. Any other difference is red, and so is a row that does not show in the run (its os, a visit the
run made, and no matching difference): it is STALE and the verdict says "remove it". The rows say what the published engine reads and what the candidate reads, never a tag: when the published set
moves to the release that holds the candidate's work, the two sides agree on those leaves, every row is stale, and the stale check forces them out. A row for a visit this run did not make (another
shard, another seed set) is not judged here.
python ci_ab_oracle.py run <candidate-firefox> --candidate-seal gate.seal.json \\
--leg linux-x86_64 --out ab-oracle [--engine-tag <the set's tag>] [--seed-set candidate|final] [--shard i/n]
python ci_ab_oracle.py run --published-binary <firefox> --leg linux-x86_64 --out ab-oracle --limit 2 (the A/A alone)
python ci_ab_oracle.py compare ab-oracle [--a-a] [--seed-set ...] [--shard i/n] (again, from the dumps)
--shard i/n (1-based) takes every n-th seed of the set, from the i-th: the final set can be split over n jobs
(more runners, not more browsers per runner). The seed set and the shard of `compare` must be those of the run:
they say which visits were asked for.
THE CONTROL. `run` first dumps the published engine TWICE and compares the two (the A/A): a difference there says the
oracle is broken (what is compared is not stable, or the engine is not repeatable), not that the candidate is wrong. It is
exit 2 and the A/B is not run. Without a candidate (a pull request: the engine under test IS the published one, given with
--published-binary) the A/A is the whole run; with a candidate (the gate's leg) the A/B follows, against the first dump of
the published engine. Exit codes: 0 green, 1 red (a finding), 2 broken control or a run that could not run.
--limit N visits only the first N seeds of the set (the A/A of a pull request, which has a time budget per test).
THE SECOND LAUNCH. The visit of seed 0 (RELAUNCH_SEED) is also launched twice on ONE profile folder (the wrapper's persistent context, the profile a user
keeps between runs): the dump keeps the items of the second launch in that visit under the prefix `relaunch.`, next to the visit's own items (a fresh
profile), so the retail comparison of the host gate is never touched. They are compared apart: the visit must have them on both sides, and as many as the
floor (they are not counted in the visit's own leaves, so a page that dumped less cannot hide behind them). The A/A and the A/B hold them to equality like the rest.
HOW EACH LAUNCH ENDS. Every browser a dump launches (the visits, the two launches of the pair on one profile, the ab visit) is seen by a probe in the dump process
(scripts/ci_crash_evidence.py: it reads the exit code of the browser's parent after the close the launch already makes, and a watcher reads the crash folders while it lives). A
parent that did not end with 0, or whose code was not seen, is a RED line that names the side, the seed, the dpr, the launch and the code, in the A/A and in the A/B alike; a dump
process whose probe wrote nothing is red too. What the launch left is kept in `<out>/crash/<run>/`: the core run through `gdb -batch` with the build ids, the `.extra` and the minidump
names, `said.txt` for what the collectors did not find, and `exits.json` with how every launch ended. This oracle runs no strace (a trace would slow the browser and change the
outcome it observes): the strace tail is the host oracle's.
WHAT A LAUNCH LEAVES, ALWAYS. The probe also saves, for EVERY launch of both engines (and of the A/A), what the browser wrote on stdout and stderr (the core merges them on one pipe) in
`<out>/crash/<run>/stderr/<launch>.txt`, green or not, and the cores written since the launch began (Linux) are run through gdb whatever code the parent ended with: a content process can
die and the parent still end with 0, and then the launch is red and names the core. A launch without a core says where it looked (`core_said` in exits.json). A TAB THAT DIED, or a session lost
during a visit (the core's `cannot find session`, a closed target), is the leaf `crash.tab.<launch>` of that visit, with the error and the step (`.error`, `.step`), and the comparison puts it FIRST:
`TAB CRASH side B seed 12 dpr 1.5 launch visit at step ...`. That leaf alone makes the verdict red; the leaves the dead tab could not read (or that only the other side has) are not listed as a
cascade of `<missing>`: they are counted in that line.
python ci_ab_oracle.py touched BASE_SHA (prints touched=true|false: does a pull request change a file of this oracle; e2e.yml's final-set job reads it)
Writes, in --out: dump-<N>.json and dump-<N>-again.json (the published engine's items, twice), diff-a-a.json (the A/A),
and with a candidate dump-candidate.json and diff.json (the verdict, the compared leaves per visit, every difference).
"""
from __future__ import annotations
import argparse
import hashlib
import json
import os
import shutil
import subprocess
import sys
import tempfile
import time
from pathlib import Path
sys.path.insert(0, str(Path(__file__).resolve().parent))
import ci_crash_evidence as crash # noqa: E402
import ci_host_gate as gate # noqa: E402
import ci_published_set as published_set # noqa: E402
import persona_cover as personas # noqa: E402
FORMAT = "ab-oracle/1"
EXPECTED_FORMAT = "ab-oracle-expected/1"
EXPECTED_FILE = Path(__file__).resolve().parents[1] / "ci" / "ab-oracle-expected.json"
#: What a row of the file has, and nothing else.
EXPECTED_KEYS = ("id", "os", "seed", "dpr", "leaf", "published", "candidate", "reason")
#: The legs the gate runs, and the os a row names for each.
LEG_OS = {"linux-x86_64": "linux", "win-x86_64": "windows"}
#: The control side is the PUBLISHED SET (scripts/ci_published_set.py): the wrapper the index published last, the core that wrapper pins, and the engine that core's seal pins, in a venv
#: of their own. The variable names that venv's python; the job sets it (or the oracle's test makes the venv from the run's wheelhouse). No tag is written in this file: the engine the
#: candidate is held to is the one the set carries, so a new release is the new baseline.
PUBLISHED_PYTHON_ENV = "INVPW_PUBLISHED_PYTHON"
SET_SCRIPT = Path(__file__).resolve().parent / "ci_published_set.py"
CANDIDATE = "candidate"
#: What the host gate's own reference holds per visit (non-diag leaves at each DPR, today).
#: A visit that compares fewer leaves than this is red. Moves by hand with the reference
#: (tests/test_ab_oracle.py holds the two together). A DPR the reference does not record (the personas
#: also have 1.25) is held to the least of the ones it does.
MIN_LEAVES = {1.0: 16439, 1.5: 16439}
#: The seeds a run visits, from ci/persona-seeds.json: the smallest set that reaches every webgl renderer and every DPR,
#: or the one that reaches every value of every dimension the core declares.
SEED_SETS = ("candidate", "final")
SEED_SET = "candidate"
#: The seed whose visit is also launched twice on one profile folder, and the prefix its second launch's leaves have (scripts/ci_host_gate.py holds it).
RELAUNCH_SEED = 0
RELAUNCH = gate.RELAUNCH
#: A value in diff.json longer than this is replaced by its length and its sha256 (the full value is in the dumps).
CLIP = 400
#: How many differences one run prints; diff.json has all of them.
PRINT_LIMIT = 200
#: What a leaf that is not in a visit reads as.
MISSING = "<missing>"
#: How the verdict names a tab that died (or a session that was lost) during a visit, first of all the lines: the dump records it as the leaf `crash.tab.<launch>`
#: (scripts/ci_crash_evidence.py), and the leaves the dead tab could not read are consequences, not differences.
TAB_CRASH = "TAB CRASH"
#: Said by the run when no visit is dumped within this time (the host gate's own budget is 180 s per page).
DUMP_TIMEOUT_S = 40 * 60
def dump_name(engine_tag: str) -> str:
"""dump-68.json for firefox-68."""
return "dump-%s.json" % engine_tag.rsplit("-", 1)[-1]
# -
# The comparison: two sets of visits, leaf by leaf.
def _clip(value):
text = json.dumps(value, sort_keys=True)
if len(text) <= CLIP:
return value
return {"clipped": text[:CLIP // 2], "len": len(text), "sha256": hashlib.sha256(text.encode()).hexdigest()}
def visit_name(dpr, seed) -> str:
return "dpr%s_seed%d" % (dpr, seed)
def parse_shard(text: str | None) -> tuple:
"""(i, n) from "i/n" (1-based, 1 <= i <= n); None is the whole set, (1, 1)."""
if text is None:
return (1, 1)
try:
i, n = (int(x) for x in text.split("/"))
except ValueError:
raise SystemExit("--shard is i/n, two whole numbers, not %r" % (text,)) from None
if not 1 <= i <= n:
raise SystemExit("--shard is i/n with 1 <= i <= n, not %r" % (text,))
return (i, n)
def select_visits(seed_set: str = SEED_SET, shard: str | None = None, path: Path = personas.DEFAULT_PATH,
limit: int | None = None) -> list:
"""[(dpr, seed)] of the seed set, each seed at its own DPR, the i-th of n shards (every n-th seed from the i-th),
the first `limit` of them when a limit is given."""
if seed_set not in SEED_SETS:
raise SystemExit("--seed-set is one of %s, not %r" % ("/".join(SEED_SETS), seed_set))
i, n = parse_shard(shard)
every = [(dpr, seed) for seed, dpr in personas.load_visits(seed_set, path)]
mine = every[i - 1::n][:limit]
if not mine:
raise SystemExit("shard %d/%d of the %d seeds of %r is empty" % (i, n, len(every), seed_set))
return mine
def relaunch_visits(visits) -> tuple:
"""The visits (dpr, seed) that are launched twice on one profile folder: the ones of RELAUNCH_SEED."""
return tuple(key for key in visits if key[1] == RELAUNCH_SEED)
def _bare(leaf: str) -> str:
"""The leaf without the prefix of the second launch: what exceptions.json names."""
return leaf[len(RELAUNCH):] if leaf.startswith(RELAUNCH) else leaf
def comparable(items: dict) -> dict:
"""The leaves of one visit that are held to equality: everything but diag (a second launch's leaves keep their prefix)."""
return {k: v for k, v in gate.leaves(items).items() if not gate.is_diag(_bare(k))}
def split_launches(leaves: dict) -> tuple:
"""(the leaves of the visit on a fresh profile, the leaves of the second launch)."""
first = {k: v for k, v in leaves.items() if not k.startswith(RELAUNCH)}
return first, {k: v for k, v in leaves.items() if k.startswith(RELAUNCH)}
def tab_crashes(leaves: dict) -> list:
"""[(launch, error, step)] of the tab crashes one side's visit recorded: the leaves `crash.tab.<launch>.error` and `.step` (a second launch's keep their prefix)."""
found: dict = {}
for leaf, value in leaves.items():
bare = _bare(leaf)
if bare.startswith(crash.TAB_PREFIX):
launch, _, field = bare[len(crash.TAB_PREFIX):].partition(".")
found.setdefault((leaf.startswith(RELAUNCH), launch), {})[field or "error"] = value
return [(launch, f.get("error"), f.get("step")) for (_second, launch), f in sorted(found.items())]
def os_of_leg(leg: str) -> str:
"""The os a row of the declared differences names for this leg ("linux-x86_64" is linux, "win-x86_64" is windows); any other leg is refused."""
if leg not in LEG_OS:
raise SystemExit("--leg is one of %s, not %r: the declared differences are per os" % ("/".join(sorted(LEG_OS)), leg))
return LEG_OS[leg]
def load_expected(path: Path | None = None) -> list:
"""The rows of ci/ab-oracle-expected.json (EXPECTED_FILE when no path is given). Refused: another format, a row that does not have exactly EXPECTED_KEYS, an os that is not
linux or windows, an empty reason, two rows with one id or with one (os, seed, dpr, leaf)."""
path = Path(path or EXPECTED_FILE)
document = json.loads(path.read_text(encoding="utf-8"))
if document.get("format") != EXPECTED_FORMAT:
raise SystemExit("%s is not an %s file" % (path, EXPECTED_FORMAT))
rows, ids, places = document["differences"], set(), set()
for row in rows:
if sorted(row) != sorted(EXPECTED_KEYS):
raise SystemExit("%s: the row %r has the keys %s, it must have exactly %s" % (path, row.get("id"), sorted(row), sorted(EXPECTED_KEYS)))
if row["os"] not in LEG_OS.values():
raise SystemExit("%s: the row %r names the os %r, it is linux or windows" % (path, row["id"], row["os"]))
if not str(row["reason"]).strip():
raise SystemExit("%s: the row %r has no reason" % (path, row["id"]))
place = (row["os"], row["seed"], row["dpr"], row["leaf"])
if row["id"] in ids or place in places:
raise SystemExit("%s: the row %r is declared twice (by id, or by os, seed, dpr and leaf)" % (path, row["id"]))
ids.add(row["id"])
places.add(place)
return rows
def _same_value(a, b) -> bool:
"""Equal as JSON says it (1 is not true, a list is its elements in order)."""
return json.dumps(a, sort_keys=True) == json.dumps(b, sort_keys=True)
def declared_covers(entry: dict, os_name: str, diff: dict) -> bool:
"""A row covers a difference only when os, seed, dpr, leaf and BOTH values are the row's."""
return (entry["os"] == os_name and entry["seed"] == diff["seed"] and entry["dpr"] == diff["dpr"] and entry["leaf"] == diff["leaf"]
and _same_value(entry["published"], diff["a"]) and _same_value(entry["candidate"], diff["b"]))
def apply_declared(differences: list, declared: list, os_name: str, seen: set, expected) -> tuple:
"""(the differences no row covers, the differences the rows cover with the id of the row, the stale rows).
A row is judged only when it names this os and a visit this run asked for and both sides have (`seen`); it is stale when no difference of the run is exactly its own."""
left, covered, stale = list(differences), [], []
for entry in declared:
visit = (entry["dpr"], entry["seed"])
if entry["os"] != os_name or visit not in expected or visit not in seen:
continue
hit = [d for d in left if declared_covers(entry, os_name, d)]
if not hit:
stale.append(entry)
for d in hit:
left.remove(d)
covered.append(dict(d, id=entry["id"]))
return left, covered, stale
def compare_visits(a: dict, b: dict, noise: list, min_leaves: dict | None = None,
expected: tuple | None = None, relaunch: tuple | None = None,
declared: list | None = None, os_name: str | None = None) -> dict:
"""a and b map (dpr, seed) to the items of that visit (as the dump returns them).
Returns the report: {"verdict": "green"|"red", "problems": [str], "differences":
[{"seed", "dpr", "leaf", "a", "b", "what"}], "compared": {visit: leaves}, "excused": n}.
`noise` is the list of entries of exceptions.json's "noise". `min_leaves` maps a dpr to the
fewest leaves a visit of that dpr may compare; `expected` is the visits both sides must have
(default: every seed at every DPR of the host gate). `relaunch` is the visits that were launched twice on one profile (default: those of RELAUNCH_SEED among the expected ones): each side must have the
second launch's leaves (prefix `relaunch.`) in them, as many as the floor, counted apart (report["relaunch"]), and a side must not have them in a visit that
was not asked to.
`declared` is the rows of ci/ab-oracle-expected.json, applied only with the `os_name` of the leg: the A/B passes them, the A/A never does. A difference that a row covers exactly
is not a problem and is listed in report["declared"] with the row's id; a row that this run does not show is a problem (stale) and its id is in report["stale"]."""
if declared and os_name is None:
raise ValueError("declared differences are per os: say which (os_name)")
min_leaves = MIN_LEAVES if min_leaves is None else min_leaves
if expected is None:
expected = tuple((dpr, seed) for dpr in gate.DPRS for seed in gate.SEEDS)
relaunch = relaunch_visits(expected) if relaunch is None else relaunch
problems, differences, compared, excused, relaunched = [], [], {}, 0, {}
crashes, cascade = [], {}
for side, visits in (("A", a), ("B", b)):
gone = [visit_name(*k) for k in expected if k not in visits]
if gone:
problems.append("side %s has no dump of %s" % (side, ", ".join(gone)))
stray = [visit_name(*k) for k in sorted(visits) if k not in expected]
if stray:
problems.append("side %s has dumps that were not asked for: %s" % (side, ", ".join(stray)))
for key in expected:
if key not in a or key not in b:
continue
dpr, seed = key
la, lb = comparable(a[key]), comparable(b[key])
count, again, skipped = 0, 0, 0
floor = min_leaves.get(dpr, min(min_leaves.values(), default=0))
died = {"A": tab_crashes(la), "B": tab_crashes(lb)}
crashed = bool(died["A"] or died["B"])
for side, found in died.items():
crashes += [{"side": side, "seed": seed, "dpr": dpr, "launch": launch, "error": error, "step": step} for launch, error, step in found]
for leaf in sorted(set(la) | set(lb)):
if gate.matching(noise, _bare(leaf)):
excused += 1
continue
if _bare(leaf).startswith(crash.TAB_PREFIX):
continue # said as a TAB CRASH, once, with its error and its step: not a difference of values
if crashed and (leaf not in la or leaf not in lb):
skipped += 1 # what the dead tab could not read (or the other side read and this one never got to): a consequence, said once below
continue
second = leaf.startswith(RELAUNCH)
count, again = count + (not second), again + second
va, vb = la.get(leaf, MISSING), lb.get(leaf, MISSING)
if va != vb:
differences.append({"seed": seed, "dpr": dpr, "leaf": leaf, "a": _clip(va), "b": _clip(vb),
"what": gate.describe(va, vb)})
compared[visit_name(dpr, seed)] = count
if skipped:
cascade[visit_name(dpr, seed)] = skipped
if count < floor and not crashed:
problems.append("%s compared %d leaves, fewer than the %d of the host gate's reference: "
"the page dumped less than it should" % (visit_name(dpr, seed), count, floor))
for side, leaves_of in (("A", la), ("B", lb)):
has = len(split_launches(leaves_of)[1])
if key in relaunch and has < floor and not crashed:
problems.append("side %s: the second launch of %s on a reused profile has %d leaves under %s, fewer than the %d of the host gate's "
"reference: it did not run, or the page dumped less than it should" % (side, visit_name(dpr, seed), has, RELAUNCH, floor))
if key not in relaunch and has and not crashed:
problems.append("side %s has the second launch of %s on a reused profile, which was not asked for" % (side, visit_name(dpr, seed)))
if key in relaunch:
relaunched[visit_name(dpr, seed)] = again
tab_lines = ["%s side %s seed %d dpr %s launch %s at step %s: %s%s" % (
TAB_CRASH, c["side"], c["seed"], c["dpr"], c["launch"], c["step"], c["error"],
" (the %d leaves of this visit that the tab could not read, or that only the other side has, are not compared)" % cascade[visit_name(c["dpr"], c["seed"])]
if visit_name(c["dpr"], c["seed"]) in cascade else "") for c in crashes]
problems = tab_lines + problems # the tab crash is the first line of the verdict, before anything it caused
covered, stale = [], []
if declared:
differences, covered, stale = apply_declared(differences, declared, os_name, {k for k in a if k in b}, expected)
problems += ["the declared difference %r (%s) does not show in this run: it is stale, remove it" % (e["id"], e["reason"]) for e in stale]
for d in differences:
problems.append("seed %d dpr %s %s: %s" % (d["seed"], d["dpr"], d["leaf"], d["what"]))
return {"verdict": "red" if problems else "green", "problems": problems, "differences": differences, "tab_crashes": crashes,
"compared": compared, "relaunch": relaunched, "excused": excused, "declared": covered, "stale": [e["id"] for e in stale]}
# -
# The files: what a run writes and what compare reads back.
def read_visits(directory: Path) -> dict:
"""(dpr, seed) -> items, from the *.json the host gate's dump wrote in directory."""
visits = {}
for path in sorted(directory.glob("*.json")):
d = json.loads(path.read_text(encoding="utf-8"))
visits[(d["dpr"], d["seed"])] = d["result"]["items"]
return visits
def pack(engine: str, visits: dict) -> dict:
return {"format": FORMAT, "engine": engine,
"visits": [{"dpr": dpr, "seed": seed, "items": visits[(dpr, seed)]} for dpr, seed in sorted(visits)]}
def unpack(document: dict) -> dict:
if document.get("format") != FORMAT:
raise SystemExit("not an %s dump: format %r" % (FORMAT, document.get("format")))
return {(v["dpr"], v["seed"]): v["items"] for v in document["visits"]}
def judge(published: dict, candidate: dict, noise: list, extra_problems=(), expected: tuple | None = None,
relaunch: tuple | None = None, declared: list | None = None, os_name: str | None = None) -> dict:
"""The verdict on two sets of visits. `declared` and `os_name` are the A/B's: the rows of ci/ab-oracle-expected.json and the os of the leg; the A/A is judged without them."""
report = compare_visits(published, candidate, noise, expected=expected, relaunch=relaunch, declared=declared, os_name=os_name)
if extra_problems:
crashed = [x for x in report["problems"] if x.startswith(TAB_CRASH)] # a tab that died is named before the exit code of the dump it left
report["problems"] = crashed + list(extra_problems) + report["problems"][len(crashed):]
report["verdict"] = "red"
return report
def write_json(path: Path, document) -> None:
path.write_text(json.dumps(document, sort_keys=True), encoding="utf-8")
def print_report(report: dict, published: str, other: str = CANDIDATE, title: str = "AB ORACLE") -> None:
n = len(report["differences"])
print("compared %d visits, leaves per visit: %s; %d leaves excused as noise"
% (len(report["compared"]), ", ".join("%s %d" % kv for kv in sorted(report["compared"].items())) or "none",
report["excused"]))
if report.get("relaunch"):
print("second launch on a reused profile, leaves per visit: %s" % ", ".join("%s %d" % kv for kv in sorted(report["relaunch"].items())))
if report.get("declared"):
print("%d differences declared in ci/ab-oracle-expected.json (the A/B only), each one exactly as its row says:" % len(report["declared"]))
for d in report["declared"]:
print("DECLARED %s seed %d dpr %s leaf %s: %s | %s" % (d["id"], d["seed"], d["dpr"], d["leaf"],
json.dumps(d["a"], sort_keys=True)[:80], json.dumps(d["b"], sort_keys=True)[:80]))
for d in report["differences"][:PRINT_LIMIT]:
print("DIFF seed %d dpr %s leaf %s: %s %s | %s %s" % (d["seed"], d["dpr"], d["leaf"], published,
json.dumps(d["a"], sort_keys=True)[:160],
other, json.dumps(d["b"], sort_keys=True)[:160]))
if n > PRINT_LIMIT:
print("... and %d more differences in diff.json" % (n - PRINT_LIMIT))
for p in report["problems"][:len(report["problems"]) - n]: # the differences are the last n problems
print("FAIL " + p)
print("%s %s: %d differences, %d problems"
% (title, "OK" if report["verdict"] == "green" else "FAILED", n, len(report["problems"])))
# -
# The run: two dumps, one per engine, as subprocesses (the seal a process runs under is read at import).
def published_python() -> str:
"""The python of the published set's venv (INVPW_PUBLISHED_PYTHON). RuntimeError when there is none: a candidate held to a control that is not the published set is
the broken control this file used to run (the candidate's core with the published engine, which refuses a launch whose declarations that core does not emit)."""
python = os.environ.get(PUBLISHED_PYTHON_ENV)
if not python or not Path(python).is_file():
raise RuntimeError("%s names no python (%r): the control side of an A/B is the PUBLISHED SET in a venv of its own (scripts/ci_published_set.py install --house <the "
"run's wheelhouse> --venv <dir>, then export the python it prints), never the core and the wrapper of the candidate" % (PUBLISHED_PYTHON_ENV, python))
return python
def set_command(python: str, *argv: str) -> list:
"""`python scripts/ci_published_set.py <argv>`, run BY the set's python: stdlib and its own invisible_core."""
return [python, str(SET_SCRIPT)] + list(argv)
def default_tag() -> str:
"""The tag of the engine the control side runs: the one the seal of the published set's core names; without a set (a pull request, whose engine IS the published one and
runs under the core the wrapper pins) the seal of the core of this process."""
python = os.environ.get(PUBLISHED_PYTHON_ENV)
if python and Path(python).is_file():
done = subprocess.run(set_command(python, "tag"), capture_output=True, text=True, env=published_set.clean_env(), timeout=120)
if done.returncode != 0:
raise RuntimeError("the published set's core names no seal tag: %s" % (done.stderr or done.stdout)[-600:])
return done.stdout.strip().splitlines()[-1]
from invisible_core.seal import active_seal
return active_seal().tag
def fetch_published(tag: str | None, work: Path) -> tuple:
"""(binary, None, python) of the published set: the engine its own core fetches under its own seal, and the python that is its venv's. `tag`, when given, is held
to the seal of the set (a label that names another engine than the one the set carries is a wrong control, said here)."""
python = published_python()
done = subprocess.run(set_command(python, "fetch", "--work", str(work)), capture_output=True, text=True, env=published_set.clean_env(), timeout=DUMP_TIMEOUT_S)
if done.returncode != 0:
raise RuntimeError("the published set could not fetch its engine (exit %s): %s" % (done.returncode, (done.stderr or done.stdout)[-800:]))
fetched = json.loads(done.stdout.strip().splitlines()[-1])
if tag and fetched["tag"] != tag:
raise RuntimeError("the control is labelled %s but the published set carries %s" % (tag, fetched["tag"]))
print("published engine %s: %s (core and wrapper of the published set, %s)" % (fetched["tag"], fetched["describe"], python))
sys.stdout.flush()
return fetched["binary"], None, python
def process_env(seal, python: str | None = None) -> dict:
"""The environment of a process that runs ONE engine: no autofix, no browser logging, and the seal of that engine. With `python` (the published set's venv) the process is the
set's: nothing of the candidate's job that could make it import another core or run another seal reaches it, and the core's pin check stays ON (a set whose wrapper and
core do not agree is refused, as it is on a user's machine). Without it (the candidate, or a pull request's published engine) it is as it always was."""
if python:
env = published_set.clean_env({"INVISIBLE_CORE_AUTOFIX": "off"})
else:
env = dict(os.environ, INVISIBLE_CORE_AUTOFIX="off", INVISIBLE_CORE_PIN="allow")
if seal: # None: the engine runs under the seal of the core it is launched with (the published set's, a pull request's published engine)
env["INVISIBLE_SEAL_FILE"] = str(seal)
for name in ("MOZ_LOG", "MOZ_LOG_FILE"): # the e2e legs log the engine; a run is as the host gate's
env.pop(name, None)
return env
def split_published(published: tuple) -> tuple:
"""(binary, seal, python or None) of a `published` tuple: two items (a binary given, run in this process's environment) or three (the published set)."""
return (published[0], published[1], published[2] if len(published) > 2 else None)
def own_cache_env(env: dict, folder: str, platform: str | None = None) -> dict:
"""`env` with the engine's per-user cache in a folder of this run (Linux: `XDG_CACHE_HOME`), and the wrapper's own cache where it was.
Why. fontconfig names the cache of the bundle's font folder by the md5 of its path, and writes it to the first writable cache folder
it knows, `$XDG_CACHE_HOME/fontconfig` or the legacy `~/.fontconfig`; it reads all of them. Every launch of the published engine of a
job has the same bundle path, so a launch that shares the user's folders leaves the cache of the bundle where a later launch of the
job reads it and finds it warm: tests/test_the_parent_reads_the_bundle_from_fontconfig_s_cache_linux_e2e.py needs its first launch
COLD (its run 44946411675 found `~/.fontconfig/<md5>-le64.cache-9` already there). The oracles' launches use a folder of their own, so
they neither read what an earlier test left nor leave what a later one would read. Both engines of an A/A start from the same empty
cache, which is also what makes their first launch the same.
`XDG_CACHE_HOME` is also where the wrapper looks for its engine (`platformdirs`): `INVISIBLE_PLAYWRIGHT_CACHE_DIR` is pinned to where
that is now, and an engine folder or a cache folder the caller set is kept. Windows has no fontconfig: `env` comes back as it was."""
if (platform or sys.platform) == "win32":
return env
import platformdirs
out = dict(env)
out.setdefault("INVISIBLE_PLAYWRIGHT_CACHE_DIR", platformdirs.user_cache_dir("invisible-playwright"))
out["XDG_CACHE_HOME"] = str(folder)
return out
def dump_with_exits(name: str, exe: str, seal_file, leg: str, visits, target: Path, out: Path, python: str | None = None) -> tuple:
"""The dump of one engine run as `run_dump` makes it, with the folder where its probe writes how each browser ended (`<out>/crash/<name>`, named to the dump process by
AB_CRASH_DIR): `(rc or "timeout", the red lines of the launches that did not end with 0, or that nobody saw)`. A dump process whose probe wrote nothing is red: an oracle
that does not see how its browsers end does not see them."""
crash_dir = out / "crash" / name
try:
with crash.environment(**{crash.CRASH_DIR_ENV: crash_dir}):
rc = run_dump(exe, Path(seal_file) if seal_file else None, leg, target, visits, **({"python": python} if python else {}))
except subprocess.TimeoutExpired:
rc = "timeout"
return rc, crash.exits_of_run(crash_dir, name, windows=leg.startswith("win"), needed=(rc == 0))
def run_dump(binary: str, seal: Path | None, leg: str, out: Path, visits: list | None = None, python: str | None = None) -> int:
"""The host gate's dump of `visits` ([(dpr, seed)], each seed at its own DPR) as a subprocess; None is the host gate's own grid. `python` is the published set's: the
dump of the control side runs in the venv that holds the published core and wrapper, never in the candidate's."""
env = process_env(seal, python)
cmd = [python or sys.executable, str(Path(gate.__file__)), "dump", binary, "--leg", leg, "--out", str(out)]
if visits is not None:
if relaunch_visits(visits):
cmd += ["--relaunch-seed", str(RELAUNCH_SEED)]
cmd += ["--no-pin", "--ab"] + [a for dpr, seed in visits for a in ("--visit", "%d:%s" % (seed, dpr))]
with tempfile.TemporaryDirectory(prefix="ab-oracle-cache-") as cache:
return subprocess.run(cmd, env=own_cache_env(env, cache), timeout=DUMP_TIMEOUT_S).returncode
def run(candidate: str, candidate_seal: Path, leg: str, out: Path, engine_tag: str,
published: tuple | None = None, visits: list | None = None) -> int:
"""`visits` is [(dpr, seed)] (default: the candidate set of the persona seeds, each at its own DPR)."""
visits = select_visits() if visits is None else visits
out.mkdir(parents=True, exist_ok=True)
work = Path(tempfile.mkdtemp(prefix="ab-oracle-"))
started = time.time()
problems, dumps = [], {}
try:
binary, seal, python = split_published(published or fetch_published(engine_tag, work))
for name, exe, seal_file, side_python in ((engine_tag, binary, seal, python), (CANDIDATE, candidate, candidate_seal, None)):
target = work / name
print("=== dump with %s: %s (seal %s), seeds %s"
% (name, exe, seal_file, " ".join("%d@%s" % (seed, dpr) for dpr, seed in visits)))
sys.stdout.flush()
rc, exits = dump_with_exits(name, exe, seal_file, leg, visits, target, out, side_python)
if rc != 0:
problems.append("the dump with %s ended with %s" % (name, rc))
problems += exits
dumps[name] = read_visits(target) if target.is_dir() else {}
write_json(out / (dump_name(engine_tag) if name == engine_tag else "dump-%s.json" % CANDIDATE),
pack(name, dumps[name]))
except SystemExit:
raise
except Exception as e: # noqa: BLE001 - a run that could not get its engine is red and says why
problems.append("%s: %s" % (type(e).__name__, str(e)[:500]))
for name in (engine_tag, CANDIDATE):
dumps.setdefault(name, {})
finally:
shutil.rmtree(work, ignore_errors=True)
noise = gate.load_exceptions().get("noise", [])
report = judge(dumps[engine_tag], dumps[CANDIDATE], noise, problems, expected=tuple(visits), declared=load_expected(), os_name=os_of_leg(leg))
report.update(format=FORMAT, engine=engine_tag, leg=leg, seconds=round(time.time() - started),
visits=["%d@%s" % (seed, dpr) for dpr, seed in visits])
write_json(out / "diff.json", report)
print_report(report, engine_tag)
return 0 if report["verdict"] == "green" else 1
def again_name(engine_tag: str) -> str:
"""dump-68-again.json for firefox-68: the second dump of the published engine, the A/A's other side."""
return dump_name(engine_tag)[:-len(".json")] + "-again.json"
def _dump_visits(name: str, exe: str, seal_file, leg: str, visits: list, work: Path, out: Path, file_name: str, python: str | None = None) -> tuple:
"""One engine's dump of `visits`: ({(dpr, seed): items}, problems); the packed dump is written to out/file_name."""
target = work / name
print("=== dump with %s: %s (seal %s), seeds %s"
% (name, exe, seal_file or "of the core", " ".join("%d@%s" % (seed, dpr) for dpr, seed in visits)))
sys.stdout.flush()
rc, exits = dump_with_exits(name, exe, seal_file, leg, visits, target, out, python)
problems = ([] if rc == 0 else ["the dump with %s ended with %s" % (name, rc)]) + exits
dumped = read_visits(target) if target.is_dir() else {}
write_json(out / file_name, pack(name, dumped))
return dumped, problems
def run_ab(leg: str, out: Path, engine_tag: str, published: tuple | None = None, candidate: str | None = None,
candidate_seal: Path | None = None, visits: list | None = None) -> int:
"""The A/A (the published engine twice), then, with a candidate, the A/B against the first dump. 0 green, 1 a finding,
2 a broken control (the A/A differs, or a dump of it did not run: the A/B is not run) .
`published` is (binary, seal or None) of a binary the caller gave, run in this process's environment, or (binary, None, python) of the published set; without it the
set the job made (INVPW_PUBLISHED_PYTHON) fetches its own engine."""
visits = select_visits() if visits is None else visits
expected = tuple(visits)
out.mkdir(parents=True, exist_ok=True)
work = Path(tempfile.mkdtemp(prefix="ab-oracle-"))
started = time.time()
noise = gate.load_exceptions().get("noise", [])
asked = ["%d@%s" % (seed, dpr) for dpr, seed in visits]
try:
try:
binary, seal, python = split_published(published or fetch_published(engine_tag, work))
first, p1 = _dump_visits(engine_tag, binary, seal, leg, visits, work, out, dump_name(engine_tag), **({"python": python} if python else {}))
again, p2 = _dump_visits(engine_tag + "-again", binary, seal, leg, visits, work, out, again_name(engine_tag), **({"python": python} if python else {}))
problems = p1 + p2
except SystemExit:
raise
except Exception as e: # noqa: BLE001 - a run that could not get its engine is red and says why
first, again, problems = {}, {}, ["%s: %s" % (type(e).__name__, str(e)[:500])]
control = judge(first, again, noise, problems, expected=expected)
control.update(format=FORMAT, engine=engine_tag, leg=leg, control=True, seconds=round(time.time() - started), visits=asked)
write_json(out / "diff-a-a.json", control)
print_report(control, engine_tag, engine_tag + "-again", "AB ORACLE A/A")
if control["verdict"] != "green":
print("BROKEN CONTROL: the published engine differs from itself (or did not run twice), so what is compared is not stable: "
"the A/B is not run, and the candidate is not judged")
return 2
if candidate is None:
return 0
cand, pc = _dump_visits(CANDIDATE, candidate, candidate_seal, leg, visits, work, out, "dump-%s.json" % CANDIDATE)
report = judge(first, cand, noise, pc, expected=expected, declared=load_expected(), os_name=os_of_leg(leg))
report.update(format=FORMAT, engine=engine_tag, leg=leg, seconds=round(time.time() - started), visits=asked)
write_json(out / "diff.json", report)
print_report(report, engine_tag)
return 0 if report["verdict"] == "green" else 1
finally:
shutil.rmtree(work, ignore_errors=True)
def clean_name(engine_tag: str) -> str:
"""poison-clean-68.json for firefox-68: the published engine's dump on the CLEAN runner, kept beside the poisoned run's (scripts/ci_poison_host.py)."""
return "poison-clean-" + dump_name(engine_tag)[len("dump-"):]
def run_clean(leg: str, out: Path, engine_tag: str, visits: list, published: tuple | None = None) -> int:
"""The published engine's dump of `visits` on this machine, written to out/clean_name(engine_tag), before the poison is applied. It judges nothing: 0
when it dumped, 1 when it did not (the by-product of the poisoned run is then missing and says so)."""
out.mkdir(parents=True, exist_ok=True)
work = Path(tempfile.mkdtemp(prefix="ab-oracle-clean-"))
try:
binary, seal, python = split_published(published or fetch_published(engine_tag, work))
_, problems = _dump_visits(engine_tag + "-clean", binary, seal, leg, visits, work, out, clean_name(engine_tag), **({"python": python} if python else {}))
except SystemExit:
raise
except Exception as e: # noqa: BLE001 - said, not raised: this is a by-product
problems = ["%s: %s" % (type(e).__name__, str(e)[:500])]
finally:
shutil.rmtree(work, ignore_errors=True)
for p in problems:
print("CLEAN DUMP: " + p)
return 1 if problems else 0
def recompare(directory: Path, engine_tag: str, visits: list | None = None, a_a: bool = False, leg: str | None = None) -> int:
"""`leg` (default: the os this runs on) says which rows of the declared differences apply to the A/B; the A/A takes none."""
visits = select_visits() if visits is None else visits
published = unpack(json.loads((directory / dump_name(engine_tag)).read_text(encoding="utf-8")))
if a_a:
again = unpack(json.loads((directory / again_name(engine_tag)).read_text(encoding="utf-8")))
report = judge(published, again, gate.load_exceptions().get("noise", []), expected=tuple(visits))
report.update(format=FORMAT, engine=engine_tag, control=True, visits=["%d@%s" % (seed, dpr) for dpr, seed in visits])
write_json(directory / "diff-a-a.json", report)
print_report(report, engine_tag, engine_tag + "-again", "AB ORACLE A/A")
return 0 if report["verdict"] == "green" else 2
candidate = unpack(json.loads((directory / ("dump-%s.json" % CANDIDATE)).read_text(encoding="utf-8")))
leg = leg or ("win-x86_64" if sys.platform == "win32" else "linux-x86_64")
report = judge(published, candidate, gate.load_exceptions().get("noise", []), expected=tuple(visits), declared=load_expected(), os_name=os_of_leg(leg))
report.update(format=FORMAT, engine=engine_tag, visits=["%d@%s" % (seed, dpr) for dpr, seed in visits])
write_json(directory / "diff.json", report)
print_report(report, engine_tag)
return 0 if report["verdict"] == "green" else 1
def touched(changed) -> bool:
"""Does a change to `changed` (paths of a pull request) touch a file of this oracle (scripts/ci_ab_pr_seeds.py holds the list)?"""
import ci_ab_pr_seeds as pr
return bool(pr.touches(changed, pr.ORACLES["AB_ORACLE_PR_SEEDS"][2]))
def main(argv=None) -> int:
ap = argparse.ArgumentParser(description=__doc__.split("\n")[0])
sub = ap.add_subparsers(dest="cmd", required=True)
r = sub.add_parser("run")
r.add_argument("candidate", nargs="?", help="the candidate's firefox binary (none: the A/A of the published engine alone)")
r.add_argument("--candidate-seal", type=Path, default=os.environ.get("INVISIBLE_SEAL_FILE"),
help="the candidate's seal (default: INVISIBLE_SEAL_FILE)")
r.add_argument("--leg", required=True)
r.add_argument("--out", type=Path, required=True)
r.add_argument("--engine-tag", default=None, help="the label of the control side (default: the tag the published set's seal names)")
r.add_argument("--seed-set", choices=SEED_SETS, default=SEED_SET,
help="the persona seeds to visit (ci/persona-seeds.json), each at its own DPR")
r.add_argument("--shard", help="i/n: every n-th seed of the set from the i-th (the final set over n jobs)")
r.add_argument("--limit", type=int, help="visit only the first N seeds of the set (the A/A of a pull request)")
r.add_argument("--published-binary", type=Path, help="use this binary for the published engine instead of fetching it")
r.add_argument("--published-seal", type=Path, help="with --published-binary: the seal of that engine")
t = sub.add_parser("touched", help="touched=true|false: does the pull request (BASE_SHA..HEAD) change a file of this oracle")
t.add_argument("base")
k = sub.add_parser("clean", help="the published engine's dump on this (clean) machine, for the poisoned run's by-product")
k.add_argument("--leg", required=True)
k.add_argument("--out", type=Path, required=True)
k.add_argument("--engine-tag", default=None, help="the label of the control side (default: the tag the published set's seal names)")
k.add_argument("--seed-set", choices=SEED_SETS, default=SEED_SET)
k.add_argument("--shard")
k.add_argument("--limit", type=int)
c = sub.add_parser("compare")
c.add_argument("directory", type=Path)
c.add_argument("--engine-tag", default=None, help="the label of the control side (default: the tag the published set's seal names)")
c.add_argument("--seed-set", choices=SEED_SETS, default=SEED_SET)
c.add_argument("--shard")
c.add_argument("--limit", type=int)
c.add_argument("--a-a", action="store_true", help="compare the two dumps of the published engine (the control)")
c.add_argument("--leg", help="the leg the dumps are of, which says the os of the declared differences (default: this machine's)")
args = ap.parse_args(argv)
if args.cmd == "touched":
import ci_ab_pr_seeds as pr
sys.stdout.reconfigure(newline="\n") # the line goes to $GITHUB_OUTPUT: a carriage return would be part of the value
print("touched=%s" % ("true" if touched(pr.changed_files(args.base)) else "false"))
return 0
args.engine_tag = args.engine_tag or default_tag()
if args.cmd == "clean":
return run_clean(args.leg, args.out, args.engine_tag, select_visits(args.seed_set, args.shard, limit=args.limit))
if args.cmd == "compare":
return recompare(args.directory, args.engine_tag, select_visits(args.seed_set, args.shard, limit=args.limit), args.a_a, args.leg)
if args.published_seal and not args.published_binary:
ap.error("--published-seal goes with --published-binary")
if args.candidate:
if not args.candidate_seal:
ap.error("--candidate-seal (or INVISIBLE_SEAL_FILE) is required: the candidate runs under its own seal")
if args.published_binary and not args.published_seal:
ap.error("--published-binary and --published-seal go together when there is a candidate")
elif not args.published_binary:
ap.error("a candidate, or --published-binary (the A/A of the published engine alone)")
given = (str(args.published_binary), args.published_seal) if args.published_binary else None
return run_ab(args.leg, args.out, args.engine_tag, given, args.candidate,
Path(args.candidate_seal) if args.candidate else None, select_visits(args.seed_set, args.shard, limit=args.limit))
if __name__ == "__main__":
sys.exit(main())
+93
View File
@@ -0,0 +1,93 @@
#!/usr/bin/env python3
"""How many persona seeds the A/A of each oracle visits on a pull request.
The page, network and host oracles run their A/A (the published engine against itself) on a pull request, where a test has a time budget: a few seeds. The A/A is
the control that every A/B verdict rests on, so when the pull request changes the code or the data of an oracle, its A/A runs on every seed of the `candidate` set
of ci/persona-seeds.json (the seeds the gate's leg runs), not on the first few: a change that makes the control unstable on one seed is found on the pull request.
`e2e.yml` runs this once per job, on a pull request, with the base commit of the pull request:
python scripts/ci_ab_pr_seeds.py "$BASE_SHA" >> "$GITHUB_ENV"
It fetches that commit (the checkout is shallow), lists the files the pull request changed (`git diff --name-only <base> HEAD`: HEAD is the merge commit the
runner checks out, so this is exactly what the pull request changes), and prints one `VARIABLE=N` line per oracle: N is every seed of the set when a file of the
oracle (ORACLES below, with what it shares with the others) is in the list, else the oracle's default. The tests read the variable with `pr_seed_count`; without it
(a push to main, a manual run) they use the default.
"""
from __future__ import annotations
import fnmatch
import json
import os
import subprocess
import sys
from pathlib import Path
ROOT = Path(__file__).resolve().parent.parent
#: What every oracle depends on: the page oracle's driver (the others use its fetch of the published engine and its cache folder), the recorder of how a launch ended, this file and the seeds.
SHARED = ("scripts/ci_ab_oracle.py", "scripts/ci_crash_evidence.py", "scripts/ci_ab_pr_seeds.py", "scripts/persona_cover.py", "ci/persona-seeds.json")
#: variable -> (oracle, seeds by default on a pull request that does not touch it, the files of the oracle: exact paths or fnmatch patterns).
ORACLES = {
"AB_ORACLE_PR_SEEDS": ("page", 2, SHARED + ("scripts/ci_host_gate.py", "scripts/ci_poison_host.py", "scripts/host_gate/*", "ci/ab-oracle-expected.json", "tests/test_ab_oracle*", "tests/test_ci_host_gate*",
"tests/test_ci_poison_host.py")),
"AB_NETWORK_PR_SEEDS": ("network", 1, SHARED + ("scripts/ci_ab_network.py", "ci/ab-network-volatile.json", "tests/test_ab_network*")),
"AB_HOST_PR_SEEDS": ("host", 2, SHARED + ("scripts/ci_ab_host.py", "tests/_strace_stand_in.py", "tests/_ab_host_declared.py", "ci/ab-host-expected.json", "tests/test_ab_host*")),
}
FALLBACK_SEEDS = 5
def candidate_seed_count() -> int:
"""How many seeds the `candidate` set of ci/persona-seeds.json has (5 when the file cannot be read)."""
try:
seeds = json.loads((ROOT / "ci" / "persona-seeds.json").read_text(encoding="utf-8")).get("candidate")
return len(seeds) if seeds else FALLBACK_SEEDS
except (OSError, ValueError, AttributeError):
return FALLBACK_SEEDS
def touches(changed, patterns) -> list:
"""The changed files that are one of `patterns` (exact paths or fnmatch patterns, `/` separated)."""
return sorted(p for p in changed if any(fnmatch.fnmatchcase(p, pattern) for pattern in patterns))
def pr_seed_counts(changed, every: int | None = None) -> dict:
"""{variable: how many seeds} for a pull request that changed `changed`: every seed for an oracle whose own files are in it, else its default."""
every = candidate_seed_count() if every is None else every
return {variable: (every if touches(changed, files) else default) for variable, (_name, default, files) in ORACLES.items()}
def pr_seed_count(variable: str, default: int, environ=None) -> int:
"""What a test reads: the number in `variable` (set by the step of e2e.yml), else `default`. A value that is not a whole number of at least 1 is an error."""
raw = (os.environ if environ is None else environ).get(variable, "").strip()
if not raw:
return default
if not raw.isdigit() or int(raw) < 1:
raise ValueError("%s=%r: the number of seeds is a whole number of at least 1" % (variable, raw))
return int(raw)
def changed_files(base: str, run=subprocess.run) -> list:
"""The files that differ between the base commit of the pull request and HEAD (the merge commit of the checkout)."""
run(["git", "fetch", "--no-tags", "--depth=1", "origin", base], check=True, capture_output=True, text=True)
done = run(["git", "diff", "--name-only", base, "HEAD"], check=True, capture_output=True, text=True)
return [line.strip() for line in done.stdout.splitlines() if line.strip()]
def main(argv=None) -> int:
args = sys.argv[1:] if argv is None else argv
if len(args) != 1:
print("usage: ci_ab_pr_seeds.py BASE_SHA", file=sys.stderr)
return 2
sys.stdout.reconfigure(newline="\n") # the lines go to $GITHUB_ENV: a carriage return would be part of the value
changed = changed_files(args[0])
counts = pr_seed_counts(changed)
for variable, (name, default, files) in ORACLES.items():
hit = touches(changed, files)
print("%s oracle: %d seeds (%s)" % (name, counts[variable], ("its files changed: " + ", ".join(hit[:6])) if hit else "default %d" % default),
file=sys.stderr)
print("%s=%d" % (variable, counts[variable]))
return 0
if __name__ == "__main__":
sys.exit(main())
+989
View File
@@ -0,0 +1,989 @@
#!/usr/bin/env python3
"""A browser that ended with a code other than 0 is RED in every oracle, and what it left is saved (one place, used by the page, network and host oracles).
The three A/B oracles (scripts/ci_ab_oracle.py, scripts/ci_ab_network.py, scripts/ci_ab_host.py) launch many browsers and used to look at how each one ended only as
evidence: run 45030727459 had a firefox-68 parent die with -11 (SIGSEGV) in a normal close of 2.3 s, and nothing was kept to find out why. Now:
* `exit_problem`: the exit code of the root (parent) process of a launch is 0 or the launch is a verdict line that names the seed, the run, the launch and the code.
A launch whose code was not seen is red too (an oracle that does not see how its browsers end does not see them).
* `collect`: for a launch that did not end with 0, on Linux the last 100 strace lines and the lines of the fatal signals of the whole log (the host oracle's
trace; the page and network oracles run no strace, and say so), the core run through `gdb -batch` (`thread apply all bt`, the MOZ_CRASH reason, `info
sharedlibrary`) with the build ids of the binary and of the core, and the crash reporter's `.extra` and the minidump names; on Windows the `.extra` files and the
minidump list. Whatever a collector does not find is SAID (`said`), never left silent.
* `LaunchProbe`: the observer the page and network oracles use. They launch through the wrapper, which keeps the browser's process inside the core's `Connection`;
the probe wraps `Connection.__init__` and `Connection.close` (it reads the code after the close the launch already makes, and a watcher thread of the same
crash folders that the host oracle's launches read too), so nothing about the launch changes: same environment, same prefs, same durations, same launch count.
Three more things the probe keeps, in EVERY launch and not only in a bad one:
* what the browser wrote (`stderr/<launch>.txt` in the crash folder): the core reads the browser's stdout and stderr (one pipe) through `ProcessOutput`, one reader for the whole life of
the process; the probe puts a tee in front of that reader, so the bytes are the ones the reader gets, the whole output and not the last 200 lines the core keeps, and the browser
cannot tell. A launch whose output could not be tee'd says so (`stderr_said`), and that is red;
* the cores written since the launch began (Linux): a core of a content process or of the parent goes through gdb whatever the code of the parent was (a tab can die and the parent
end with 0); a launch with a core, or with a minidump, whose parent ended with 0 is red, and a launch with none says where it looked (`core_said`);
* a tab that died is not here: it is the dump's leaf `crash.tab.<launch>` (`tab_lost`, `tab_crash_item`), which the page oracle's comparison puts first.
A probe never changes the outcome it observes: nothing here sets an environment variable of the browser, a pref, a crash reporter option or a working directory.
Cores are enabled the one way that cannot reach a launch that does not crash: the soft core limit of the oracle's own process is raised to the hard one (a child
inherits it), and where the kernel writes the core is the job's `kernel.core_pattern` (`INVPW_CORE_DIR` names that folder).
"""
from __future__ import annotations
import contextlib
import json
import os
import re
import shutil
import subprocess
import sys
import tempfile
import threading
import time
from pathlib import Path
FORMAT = "launch-exits/1"
#: The folder the job points the kernel's core pattern at (`sudo sysctl kernel.core_pattern=$INVPW_CORE_DIR/core.%e.%p.%t`).
CORE_DIR_ENV = "INVPW_CORE_DIR"
#: Where an oracle's launch probe writes what it saw (a folder of the oracle's artifact), named by the oracle that starts the run process.
CRASH_DIR_ENV = "AB_CRASH_DIR"
#: Where the probe saves what each browser wrote (a folder of the crash folder), and the most of it one launch keeps (the core's own reader keeps 200 lines; a launch writes a few KB).
STDERR_DIR = "stderr"
STDERR_LIMIT = 4 * 1024 * 1024
#: The prefix of the leaf a dump records when the tab of a visit died or its session was lost, and what says it (the lowercased text of the error: the core's `cannot find session`,
#: the client's `Target closed` / `has been closed`, a closed pipe, the page's own `crashed`).
TAB_PREFIX = "crash.tab."
TAB_LOST = ("cannot find session", "target closed", "targetclosederror", "session closed", "has been closed", "pipe is closed", "pipe closed", "page crashed", "tab crashed")
STRACE_TAIL_LINES = 100
SIGNAL_LINES = 20
#: The gdb commands: every thread's stack, the reason MOZ_CRASH wrote, the libraries the core mapped.
GDB_COMMANDS = ("thread apply all bt", "x/s *(char**)&gMozCrashReason", "info sharedlibrary")
GDB_LIMIT = 400_000
CORE_LIMIT = 3
#: The exit code of Linux processes that a signal ended is the negative of its number (Python's `Popen`).
SIGNALS = {1: "SIGHUP", 2: "SIGINT", 3: "SIGQUIT", 4: "SIGILL", 5: "SIGTRAP", 6: "SIGABRT", 7: "SIGBUS", 8: "SIGFPE", 9: "SIGKILL", 10: "SIGUSR1", 11: "SIGSEGV",
12: "SIGUSR2", 13: "SIGPIPE", 14: "SIGALRM", 15: "SIGTERM", 31: "SIGSYS"}
#: The NTSTATUS values a Windows crash gives as the exit code of the process.
NTSTATUS = {0xC0000005: "access violation", 0xC0000409: "stack buffer overrun / fast fail", 0xC000013A: "control-C", 0x80000003: "breakpoint",
0xC0000374: "heap corruption", 0xC00000FD: "stack overflow", 0xC000001D: "illegal instruction", 0xC0000094: "integer divide by zero"}
_FATAL = re.compile(r"^\d+\s+--- SIG(?:SEGV|BUS|ABRT|ILL|FPE|SYS|TRAP|TERM|INT|QUIT|HUP)\b")
#: A line of the strace log that is a signal delivered (`1234 --- SIGCHLD {...} ---`): never data of the comparison.
SIGNAL_LINE = re.compile(r"^\d+\s+--- SIG")
# -
# The verdict line.
def describe_exit(code, windows: bool | None = None) -> str:
"""`-11 (SIGSEGV)`, `0xC0000005 (access violation)`, `1`, or what it is when the code was not seen."""
if code is None:
return "no code (the exit code was not seen)"
windows = (sys.platform == "win32") if windows is None else windows
if windows and (code < 0 or code >= 0x80000000):
value = code & 0xFFFFFFFF
name = NTSTATUS.get(value)
return "0x%08X (%s)" % (value, name) if name else "0x%08X" % value
if code < 0:
return "%d (%s)" % (code, SIGNALS.get(-code, "signal %d" % -code))
return str(code)
def tab_lost(error) -> bool:
"""Does this error (an exception, or its text) say that the tab died or the session was lost? The dump records that as a leaf of its own (`tab_crash_item`) and goes on."""
text = ("%s: %s" % (type(error).__name__, error)) if isinstance(error, BaseException) else str(error)
text = text.lower()
return any(word in text for word in TAB_LOST)
def tab_crash_item(launch: str, step: str, error) -> dict:
"""The item a dump adds to a visit whose tab died: `{"crash.tab.<launch>": {"error": ..., "step": ...}}`, the error text and the step of the visit it came in."""
text = ("%s: %s" % (type(error).__name__, error)) if isinstance(error, BaseException) else str(error)
return {TAB_PREFIX + launch: {"error": text[:300], "step": str(step)[:200]}}
#: The order the parts of a launch's name are told in (a JSON file writes its keys sorted).
LABEL_ORDER = ("seed", "dpr", "launch")
def side_of(label: str) -> str:
"""The side of a run in the A/A and the A/B: the published engine is A, its second run and the candidate are B."""
label = str(label)
return "B" if label.endswith("-again") or label.endswith(" again") or label.startswith("candidate") else "A"
def exit_problem(code, windows: bool | None = None, **who) -> str | None:
"""The red line of a launch that did not end with 0, or None when it did. `who` is what names the launch (run, side, seed, dpr, launch ...)."""
if code == 0:
return None
where = ", ".join("%s %s" % (k.replace("_", " "), v) for k, v in who.items() if v not in (None, ""))
return "the parent process exited with code %s: %s" % (describe_exit(code, windows), where or "launch not named")
def exit_problems(launches, run: str, windows: bool | None = None, side: str | None = None) -> list:
"""The red lines of the launches a probe recorded (`LaunchProbe.launches`, or the `launches` of an exits file) for the run `run`."""
out = []
for launch in launches or []:
who = {"run": run, "side": side or side_of(run)}
label = launch.get("label") or {}
who.update({k: label[k] for k in sorted(label, key=lambda k: (LABEL_ORDER.index(k) if k in LABEL_ORDER else len(LABEL_ORDER), k))})
who["launch number"] = launch.get("n")
line = exit_problem(launch.get("returncode"), windows, **who)
if line:
if launch.get("evidence"):
line += " (evidence: %s)" % launch["evidence"]
out.append(line)
elif launch.get("cores") or launch.get("dmp"):
# the parent ended with 0 and a process of the browser left a core or a minidump: a content process died (the parent does not say so)
line = "a process of the browser crashed while the parent ended with 0: %s left %s" % (
", ".join("%s %s" % kv for kv in who.items() if kv[1] not in (None, "")),
" and ".join(x for x in ("core " + ", ".join(launch["cores"]) if launch.get("cores") else "", "minidump " + ", ".join(launch["dmp"]) if launch.get("dmp") else "") if x))
if launch.get("evidence"):
line += " (evidence: %s)" % launch["evidence"]
out.append(line)
return out
def parent_exit_problems(lifecycle, root_code, **who) -> list:
"""Windows (and strace, which names it too): the exit of a process of the kind `parent` that the lifecycle says was not `exited 0`, when the root's own code did not
say it (the process the core spawns may be a launcher stub that exits by itself)."""
if root_code not in (0, None):
return []
out = []
for e in lifecycle or []:
if e.get("event") == "end" and e.get("kind") == "parent" and e.get("how") not in ("exited 0", "exited 0 "):
out.append("the process of the kind parent ended with `%s` though the root's code was %s: %s"
% (e.get("how"), "0" if root_code == 0 else "not seen", ", ".join("%s %s" % kv for kv in who.items() if kv[1] not in (None, ""))))
return out
# -
# What a crash leaves: the folders, the files, the cores (the collectors that scripts/ci_ab_host.py and the probe's launches share live here).
def crash_report_dirs(profile_dir, windows: bool) -> list:
"""The folders a crash leaves its `.dmp` and `.extra` in: the profile's `minidumps` and the `Crash Reports/pending` of the user's application data."""
dirs = [Path(profile_dir) / "minidumps"] if profile_dir else []
if windows:
base = os.environ.get("APPDATA")
if base:
dirs.append(Path(base) / "Mozilla" / "Firefox" / "Crash Reports" / "pending")
else:
home = Path(os.path.expanduser("~"))
dirs += [home / ".config" / "mozilla" / "firefox" / "Crash Reports" / "pending", home / ".mozilla" / "firefox" / "Crash Reports" / "pending"]
return dirs
def scan_crash_files(dirs, seen: dict) -> None:
"""Adds to `seen` ({path: {"name", "dir", "size", "content"}}) every `.dmp` and `.extra` of `dirs`: a `.extra` is read at once, as the profile is deleted when the
launch ends, and again while its size keeps changing (a file seen half written)."""
for folder in dirs:
try:
entries = list(Path(folder).iterdir())
except OSError:
continue
for entry in entries:
if entry.suffix not in (".dmp", ".extra"):
continue
try:
size = entry.stat().st_size
if str(entry) in seen and seen[str(entry)]["size"] == size:
continue
item = {"name": entry.name, "dir": str(entry.parent), "size": size}
if entry.suffix == ".extra":
item["content"] = entry.read_text(encoding="utf-8", errors="replace")[:20000]
except OSError:
continue
seen[str(entry)] = item
class CrashWatcher:
"""A thread that looks at the crash folders while the launch lives, so that what a crash leaves is read before the launch deletes its profile.
`ignore` is a set of paths that were there before the launch (the user's `Crash Reports/pending` keeps reports of earlier crashes): they are not this launch's."""
def __init__(self, dirs_fn, period: float = 0.25, ignore=()) -> None:
self.dirs_fn, self.period = dirs_fn, period
self.ignore = set(ignore)
self.seen: dict = {}
self.scans = 0
self._halt = threading.Event()
self._thread = threading.Thread(target=self._run, name="ab-crash-watch", daemon=True)
def start(self) -> None:
self._thread.start()
def scan_once(self) -> None:
"""One look at the crash folders (what the thread does every period, and `stop` once more): a file seen empty or half written is read again when its size changes."""
scan_crash_files(self.dirs_fn(), self.seen)
self.scans += 1
def _run(self) -> None:
while not self._halt.is_set():
self.scan_once()
self._halt.wait(self.period)
def stop(self) -> dict:
self._halt.set()
if self._thread.is_alive():
self._thread.join(timeout=10)
self.scan_once()
files = [f for f in self.seen.values() if os.path.join(f["dir"], f["name"]) not in self.ignore]
return {"files": sorted(files, key=lambda f: f["name"]), "scans": self.scans}
def existing_crash_files(dirs) -> set:
"""The paths of the crash files that are there now (what a launch that starts after this look did not make)."""
seen: dict = {}
scan_crash_files(dirs, seen)
return {os.path.join(f["dir"], f["name"]) for f in seen.values()}
def core_dirs(env=None, pattern=None) -> list:
"""The folders a core of this machine can be in: the job's `INVPW_CORE_DIR` and the folder of the kernel's `core_pattern` when that is an absolute path (a pipe to
apport or systemd-coredump leaves no file)."""
env = os.environ if env is None else env
out = []
if env.get(CORE_DIR_ENV):
out.append(Path(env[CORE_DIR_ENV]))
if pattern is None:
pattern = kernel_core_pattern()
if pattern and not pattern.startswith("|") and pattern.startswith("/"):
out.append(Path(pattern).parent)
return out
def kernel_core_pattern():
try:
return Path("/proc/sys/kernel/core_pattern").read_text(encoding="utf-8").strip()
except OSError:
return None
def find_cores(dirs, since=None, slack: float = 5.0) -> list:
"""The `core*` files of `dirs` written at `since` or after (a file of an earlier launch is not this one's), newest first."""
found = []
for folder in dirs:
try:
entries = list(Path(folder).glob("core*"))
except OSError:
continue
for entry in entries:
try:
if entry.is_file() and (since is None or entry.stat().st_mtime >= since - slack):
found.append((entry.stat().st_mtime, entry))
except OSError:
continue
return [p for _t, p in sorted(found, key=lambda x: x[0], reverse=True)]
def core_info(core_dir: Path, binary: str, run=subprocess.run, commands=("bt",), more_dirs=(), since=None, limit: int = 8000, which=None) -> dict:
"""What a Linux core dump of a launch is: the kernel's core pattern (a pipe to apport or systemd-coredump puts no file in `core_dir`), the cores found there (and in
`more_dirs`, written at `since` or after) and what gdb says of each (`gdb -batch` with `commands`, `bt` by default) when gdb is installed."""
pattern = kernel_core_pattern()
cores = sorted(p for p in Path(core_dir).glob("core*") if p.is_file()) if core_dir else []
if more_dirs:
cores += [c for c in find_cores(more_dirs, since) if c not in cores]
out = {"core_pattern": pattern, "cores": [c.name for c in cores], "backtraces": {}}
gdb = (which or shutil.which)("gdb")
for core in cores[:CORE_LIMIT]:
if gdb:
argv = [gdb, "-batch"]
for command in commands:
argv += ["-ex", command]
done = run(argv + [str(binary), str(core)], capture_output=True, text=True, errors="replace", timeout=300)
out["backtraces"][core.name] = (done.stdout + done.stderr)[-limit:]
else:
out["backtraces"][core.name] = "gdb is not installed"
return out
def build_ids(binary: str, core: Path | None, run=subprocess.run, which=None) -> dict:
"""The build ids of the engine: `readelf -n` of the binary and of the `libxul.so` beside it, and `eu-unstrip -n --core` (every module the core mapped, with its id)
when elfutils is installed. A tool that is not there is said."""
which = which or shutil.which
out: dict = {}
readelf, unstrip = which("readelf"), which("eu-unstrip")
here = Path(binary).parent
for name, path in (("binary", Path(binary)), ("libxul", here / "libxul.so")):
if not path.exists():
out[name] = "%s does not exist" % path
elif not readelf:
out[name] = "readelf is not installed"
else:
done = run([readelf, "-n", str(path)], capture_output=True, text=True, errors="replace", timeout=60)
ids = [line.strip() for line in done.stdout.splitlines() if "Build ID" in line]
out[name] = ids[0] if ids else "no build id in %s" % path
if core is not None:
if not unstrip:
out["core"] = "eu-unstrip is not installed"
else:
done = run([unstrip, "-n", "--core", str(core)], capture_output=True, text=True, errors="replace", timeout=120)
out["core"] = (done.stdout + done.stderr)[-GDB_LIMIT:]
return out
def strace_tail(log, n: int = STRACE_TAIL_LINES) -> list:
"""The last `n` lines of a strace log (read from the end: the log of a closed run is tens of megabytes)."""
with open(log, "rb") as f:
f.seek(0, os.SEEK_END)
pos, data = f.tell(), b""
while pos > 0 and data.count(b"\n") <= n:
step = min(65536, pos)
pos -= step
f.seek(pos)
data = f.read(step) + data
return data.decode("utf-8", errors="replace").splitlines()[-n:]
def strace_signals(log, limit: int = SIGNAL_LINES) -> list:
"""`[line number, text]` of the last fatal-signal lines of the whole strace log (`--- SIGSEGV {si_addr=...} ---`): they come before a long tail of syscalls of the
crash reporter, so the last 100 lines may not hold them."""
kept: list = []
with open(log, encoding="utf-8", errors="replace") as f:
for number, line in enumerate(f, 1):
if _FATAL.match(line):
kept.append([number, line.rstrip("\n")])
if len(kept) > limit:
kept.pop(0)
return kept
def collect(code, binary: str, *, strace_log=None, strace_said: str | None = None, watched: dict | None = None, core_folders=(), since=None, windows: bool | None = None,
run=subprocess.run, which=None, cores=None) -> dict:
"""Everything a launch that did not end with 0 (or that left a core or a minidump) left, and what could not be found, said: {"exit", "strace", "cores", "crash_files", "said"}.
`cores` is the list of cores this launch is given (the probe keeps a core for the first launch that finds it); None looks in `core_folders` for those written since `since`."""
windows = (sys.platform == "win32") if windows is None else windows
said: list = []
out: dict = {"exit": {"code": code, "text": describe_exit(code, windows)}}
if windows:
out["strace"] = None
out["cores"] = None
said.append("no strace and no core on Windows: the minidumps and the `.extra` are what a Windows crash leaves")
else:
if strace_log is None:
out["strace"] = None
said.append(strace_said or "this oracle runs no strace (a trace slows the browser and would change the outcome it observes)")
else:
try:
out["strace"] = {"tail": strace_tail(strace_log), "signals": strace_signals(strace_log)}
if not out["strace"]["signals"]:
said.append("the strace log holds no fatal signal line")
except OSError as e:
out["strace"] = None
said.append("the strace log could not be read: %s" % e)
cores = find_cores(core_folders, since) if cores is None else list(cores)
info = {"core_pattern": kernel_core_pattern(), "folders": [str(d) for d in core_folders], "cores": [c.name for c in cores], "backtraces": {}, "build_ids": {}}
if not cores:
said.append("no core file written since the launch began, in %s (core_pattern %s)" % (", ".join(str(d) for d in core_folders) or "no folder", info["core_pattern"]))
info["build_ids"]["binary only (no core)"] = build_ids(binary, None, run, which)
for core in cores[:CORE_LIMIT]:
info["backtraces"][core.name] = gdb_report(binary, core, run, which)
info["build_ids"][core.name] = build_ids(binary, core, run, which)
out["cores"] = info
files = (watched or {}).get("files", [])
out["crash_files"] = {"dmp": [f["name"] for f in files if f["name"].endswith(".dmp")], "extra": [{"name": f["name"], "content": f.get("content", "")} for f in files
if f["name"].endswith(".extra")], "scans": (watched or {}).get("scans")}
if not files:
said.append("no minidump and no `.extra` in the crash folders (the crash reporter may be off, or the process ended before it wrote them)")
out["said"] = said
return out
def gdb_report(binary: str, core: Path, run=subprocess.run, which=None) -> str:
"""`gdb -batch` over a core: every thread's backtrace, the MOZ_CRASH reason and the shared libraries; or the reason it could not be asked."""
gdb = (which or shutil.which)("gdb")
if not gdb:
return "gdb is not installed"
argv = [gdb, "-batch"]
for command in GDB_COMMANDS:
argv += ["-ex", command]
try:
done = run(argv + [str(binary), str(core)], capture_output=True, text=True, errors="replace", timeout=300)
except subprocess.TimeoutExpired:
return "gdb did not finish within 300 s"
return (done.stdout + done.stderr)[:GDB_LIMIT]
def _safe(name: str) -> str:
return re.sub(r"[^A-Za-z0-9._-]+", "_", name)[:80]
def write_crash_files(crash: dict, directory) -> list:
"""The evidence of `collect` as files a person can read in the artifact (`strace-tail.txt`, `strace-signals.txt`, `gdb-<core>.txt`, `build-ids.txt`, `<name>.extra.txt`,
`minidumps.txt`, `said.txt`) and `crash.json`; returns the names written."""
folder = Path(directory)
folder.mkdir(parents=True, exist_ok=True)
written = []
def put(name, text):
(folder / name).write_text(text, encoding="utf-8", newline="\n")
written.append(name)
strace = crash.get("strace")
if strace:
put("strace-tail.txt", "\n".join(strace["tail"]) + "\n")
put("strace-signals.txt", "\n".join("%d: %s" % (n, t) for n, t in strace["signals"]) + "\n")
cores = crash.get("cores")
if cores:
for name, text in cores["backtraces"].items():
put("gdb-%s.txt" % _safe(name), text)
ids = "\n\n".join("%s\n%s" % (name, json.dumps(value, indent=1, sort_keys=True)) for name, value in sorted(cores["build_ids"].items()))
if ids:
put("build-ids.txt", ids + "\n")
files = crash.get("crash_files") or {}
for item in files.get("extra", []):
put("%s.txt" % _safe(item["name"]), item.get("content", "") + "\n")
put("minidumps.txt", "\n".join(files.get("dmp", [])) + ("\n" if files.get("dmp") else ""))
put("said.txt", "\n".join(crash.get("said", [])) + "\n")
put("crash.json", json.dumps(crash, indent=1, sort_keys=True) + "\n")
return written
# -
# The probe of the oracles that launch through the wrapper (the page and network oracles).
def raise_core_limit() -> str:
"""Linux: the soft core limit of this process becomes the hard one (every browser it launches inherits it); what was done, or why not."""
try:
import resource
except ImportError:
return "not Linux: no core limit"
try:
soft, hard = resource.getrlimit(resource.RLIMIT_CORE)
if soft != hard:
resource.setrlimit(resource.RLIMIT_CORE, (hard, hard))
return "RLIMIT_CORE %s" % ("unlimited" if hard == resource.RLIM_INFINITY else hard)
except (OSError, ValueError) as e:
return "RLIMIT_CORE could not be raised: %s" % e
class OutputRecord:
"""What one launch's browser wrote (stdout and stderr: the core merges them on one pipe), kept whole by the tee that sits in front of the core's own reader."""
def __init__(self, n: int, label: dict, started: float) -> None:
self.n, self.label, self.started = n, dict(label), started
self.output = None # the core's ProcessOutput this belongs to (set once it exists)
self.size, self.truncated, self._chunks = 0, False, []
self._lock = threading.Lock()
self.written = None # the file the probe saved it in, relative to the artifact
def add(self, line) -> None:
data = line if isinstance(line, bytes) else str(line).encode("utf-8", "replace")
with self._lock:
if self.size + len(data) > STDERR_LIMIT:
self.truncated = True
return
self._chunks.append(data)
self.size += len(data)
def text(self) -> str:
with self._lock:
return b"".join(self._chunks).decode("utf-8", "replace")
class OutputTee:
"""The stream the core's `ProcessOutput` reads, with every line it reads copied to a record: the same lines in the same order to the same reader, and nothing written to the browser."""
def __init__(self, stream, record: OutputRecord) -> None:
self._stream, self._record = stream, record
def readline(self, *args):
line = self._stream.readline(*args)
if line:
try:
self._record.add(line)
except Exception: # noqa: BLE001 - a probe never breaks a launch
pass
return line
def __getattr__(self, name):
return getattr(self._stream, name)
def core_said(folders, pattern, windows: bool) -> str | None:
"""Where a launch looked for a core and found none (Linux), told so that a missing core is never silent: and, when the job's folder is not where the kernel writes, that a core would not have been seen."""
if windows:
return "Windows: no core (the minidumps and the `.extra` are what a crash leaves)"
where = ", ".join(str(f) for f in folders)
if not where:
return "no core folder to look in: INVPW_CORE_DIR is not set and core_pattern %r is not a path (a core, if one was written, was not seen)" % (pattern,)
said = "no core file written since the launch began, in %s (core_pattern %s)" % (where, pattern)
if os.environ.get(CORE_DIR_ENV) and not (pattern or "").startswith(str(Path(os.environ[CORE_DIR_ENV]))):
said += ": the kernel does not write into INVPW_CORE_DIR, so a core would not have been seen there"
return said
class LaunchProbe:
"""Sees every browser this process launches through the core (`invisible_core.juggler.connection.Connection`): how its parent ended, and what a bad end left.
`install` wraps `Connection.__init__` (the launch has begun: a crash watcher starts) and `Connection.close` (the launch is over: the exit code is read with `poll()`
after the close the launch already makes). The oracle names the launch it is about to make with `set_label` (seed, launch ...)."""
def __init__(self, binary: str, crash_dir=None, windows: bool | None = None, run=subprocess.run, clock=time.time, which=None, folders=None, core_folders=None) -> None:
self.binary = binary
self.core_folders = core_folders
self.crash_dir = Path(crash_dir) if crash_dir else None
self.windows = (sys.platform == "win32") if windows is None else windows
self.run, self.clock, self.which = run, clock, which
self.folders = folders
self.label: dict = {}
self.launches: list = []
self._open: dict = {}
self._lock = threading.Lock()
self._patched = None
self._patched_output = None
self.core_limit = None
#: what the browsers wrote, a record per launch, in the order of their birth; and why no output could be kept, when none could
self.records: list = []
self.stderr_said = None
self.unconnected: list = []
#: the cores a launch has been given: one core is one launch's
self._claimed: set = set()
def set_label(self, **label) -> None:
self.label = dict(label)
def install(self, connection=None, output=None) -> "LaunchProbe":
"""Wraps `Connection.__init__` and `close`, and puts a tee in front of the reader of the browser's output (`ProcessOutput.__init__`). With a `connection` of the caller's (a
stand-in) the output class is the caller's too, or none."""
if connection is None:
from invisible_core.juggler.connection import Connection as connection
from invisible_core.juggler import connection as module
output = getattr(module, "ProcessOutput", None)
probe, original_init, original_close = self, connection.__init__, connection.close
if output is None:
self.stderr_said = "the core has no `ProcessOutput` to put a tee in front of: what the browsers write is not saved"
else:
original_output = output.__init__
def output_init(out, stream, *args, **kwargs):
record = probe._born()
try:
original_output(out, OutputTee(stream, record), *args, **kwargs)
finally:
record.output = out
output_init.__wrapped__ = original_output
output.__init__ = output_init
self._patched_output = (output, original_output)
def __init__(conn, *args, **kwargs):
original_init(conn, *args, **kwargs)
probe._began(conn)
def close(conn, *args, **kwargs):
try:
return original_close(conn, *args, **kwargs)
finally:
probe._ended(conn)
__init__.__wrapped__, close.__wrapped__ = original_init, original_close
connection.__init__, connection.close = __init__, close
self._patched = (connection, original_init, original_close)
if not self.windows:
self.core_limit = raise_core_limit()
return self
def _born(self) -> OutputRecord:
with self._lock:
record = OutputRecord(len(self.records) + 1, self.label, self.clock())
self.records.append(record)
return record
def uninstall(self) -> None:
if self._patched_output:
output, original = self._patched_output
output.__init__ = original
self._patched_output = None
if self._patched:
connection, original_init, original_close = self._patched
connection.__init__, connection.close = original_init, original_close
self._patched = None
def _dirs(self):
if self.folders is not None:
return self.folders() if callable(self.folders) else list(self.folders)
tmp = Path(tempfile.gettempdir())
profiles = []
try:
profiles = sorted(tmp.glob("invisible_profile_*"))
except OSError:
pass
return [p / "minidumps" for p in profiles] + crash_report_dirs(None, self.windows)
def _began(self, conn) -> None:
try:
if getattr(conn, "_process", None) is None:
return
watcher = CrashWatcher(self._dirs, ignore=existing_crash_files(self._dirs()))
watcher.start()
with self._lock:
self._open[id(conn)] = {"label": dict(self.label), "started": self.clock(), "watcher": watcher, "pid": getattr(conn._process, "pid", None)}
except Exception: # noqa: BLE001 - a probe never breaks a launch
pass
def _core_folders(self) -> list:
if self.core_folders is not None:
return list(self.core_folders() if callable(self.core_folders) else self.core_folders)
return list(core_dirs())
def _ended(self, conn) -> None:
with self._lock:
state = self._open.pop(id(conn), None)
if state is None:
return
entry = {"n": len(self.launches) + 1, "label": state["label"], "pid": state["pid"], "returncode": None}
try:
try:
entry["returncode"] = conn._process.poll()
except Exception as e: # noqa: BLE001
entry["probe_error"] = "poll failed: %s" % e
watched = state["watcher"].stop()
folders = [] if self.windows else self._core_folders()
cores = [] if self.windows else [c for c in find_cores(folders, state["started"]) if c.name not in self._claimed]
dmp = [f["name"] for f in watched.get("files", []) if f["name"].endswith(".dmp")]
self._claimed.update(c.name for c in cores)
# EVERY launch: what the browser wrote is saved, and the cores since it began (a content process can die and the parent still end with 0)
self._save_output(conn, entry)
entry["cores"], entry["dmp"] = [c.name for c in cores], dmp
if not cores:
entry["core_said"] = core_said(folders, kernel_core_pattern(), self.windows)
if entry["returncode"] != 0 or cores or dmp:
crash = collect(entry["returncode"], self.binary, watched=watched, core_folders=folders, since=state["started"], windows=self.windows,
run=self.run, which=self.which, cores=cores, strace_said="this oracle runs no strace (a trace slows the browser and would change the outcome it observes)")
if self.crash_dir is not None:
name = "%02d-%s" % (entry["n"], _safe("-".join(str(v) for v in state["label"].values()) or "launch"))
write_crash_files(crash, self.crash_dir / name)
entry["evidence"] = "%s/%s" % (self.crash_dir.name, name)
entry["said"] = crash["said"]
except Exception as e: # noqa: BLE001 - what could not be collected is said
entry["probe_error"] = "%s: %s" % (type(e).__name__, e)
with self._lock:
self.launches.append(entry)
# -
# What the browsers wrote.
def _record_of(self, conn) -> OutputRecord | None:
output = getattr(conn, "output", None)
if output is None:
return None
with self._lock:
return next((r for r in self.records if r.output is output), None)
def _output_file(self, record: OutputRecord, suffix: str = "") -> str:
return "%02d-%s%s.txt" % (record.n, _safe("-".join(str(v) for v in record.label.values()) or "launch"), suffix)
def _write_output(self, record: OutputRecord, code=None, suffix: str = "", said: str = "") -> str | None:
"""The browser's output of one launch, as a file of the artifact: `stderr/<NN>-<launch>.txt`, whatever the launch's end was."""
if self.crash_dir is None:
return None
folder = self.crash_dir / STDERR_DIR
folder.mkdir(parents=True, exist_ok=True)
name = self._output_file(record, suffix)
head = ["# launch %d: %s" % (record.n, ", ".join("%s %s" % kv for kv in record.label.items()) or "not named"),
"# stdout and stderr of the browser, merged on one pipe by the core, as the core's reader got them: %d bytes%s" % (
record.size, " (kept the first %d, then the rest was dropped)" % STDERR_LIMIT if record.truncated else ""),
"# the parent's exit code when this was written: %s" % (describe_exit(code, self.windows) if code is not None else "not seen")]
if said:
head.append("# " + said)
(folder / name).write_text("\n".join(head) + "\n" + record.text(), encoding="utf-8", newline="\n")
record.written = "%s/%s/%s" % (self.crash_dir.name, STDERR_DIR, name)
return record.written
def _save_output(self, conn, entry: dict) -> None:
record = self._record_of(conn)
if record is None:
entry["stderr_said"] = self.stderr_said or "this launch's output was not seen by the tee (the core's `ProcessOutput` of this connection was not made while the probe was installed)"
return
entry["stderr_bytes"] = record.size
path = self._write_output(record, entry["returncode"])
if path:
entry["stderr"] = path
def finish(self) -> None:
"""At the end of the dump: every launch's output once more, after its reader has had the time to read to the end (a launch's file is written when it closes, and again here),
and the output of a launch that never made a connection (it died while starting: the error said what it printed, the file says all of it)."""
for record in list(self.records):
try:
if record.output is not None:
record.output.settle()
except Exception: # noqa: BLE001
pass
connected = next((x for x in self.launches if x.get("stderr") == record.written and record.written), None)
if connected is not None:
self._write_output(record, connected.get("returncode"))
else:
path = self._write_output(record, suffix="-no-connection", said="no connection was made over this launch (it ended while starting, or was still open)")
if path:
self.unconnected.append({"label": record.label, "stderr": path, "bytes": record.size})
def document(self) -> dict:
return {"format": FORMAT, "core_limit": self.core_limit, "stderr_said": self.stderr_said, "launches": list(self.launches), "launches_without_connection": list(self.unconnected)}
def write(self, path=None) -> Path | None:
path = Path(path) if path else (self.crash_dir / "exits.json" if self.crash_dir else None)
if path is None:
return None
try:
self.finish()
except Exception as e: # noqa: BLE001 - said, not raised
self.stderr_said = (self.stderr_said or "") + " finish: %s: %s" % (type(e).__name__, e)
path.parent.mkdir(parents=True, exist_ok=True)
path.write_text(json.dumps(self.document(), indent=1, sort_keys=True) + "\n", encoding="utf-8", newline="\n")
return path
#: The probe of this process, when its oracle installed one (the page oracle's dump marks the launches it makes through `mark`).
PROBE: LaunchProbe | None = None
def start_probe(binary: str, crash_dir) -> LaunchProbe:
"""Installs the probe of this process (once) for the oracle run that has a crash folder."""
global PROBE
if PROBE is not None:
PROBE.uninstall()
PROBE = LaunchProbe(binary, crash_dir).install()
return PROBE
def stop_probe() -> LaunchProbe | None:
global PROBE
probe, PROBE = PROBE, None
if probe is not None:
probe.uninstall()
return probe
def mark(**label) -> None:
"""Names the launch the oracle is about to make (no probe installed: nothing happens)."""
if PROBE is not None:
PROBE.set_label(**label)
#: The file Glean's database writes on its first write, in the profile of a launch (the folder `db` is born when the database is opened, the file at the first write).
GLEAN_DB = Path("datareporting", "glean", "db", "data.safe.bin")
#: A safety net, not a measurement: the file is there at about +8 s in normal sessions, stock and ours (run 43649596941).
GLEAN_LIMIT_S = 60.0
class GleanNotReady(Exception):
"""Glean had not initialised (no database file in the profile) when the launch was to close."""
def wait_for_glean(profile: Path | None, limit_s: float = GLEAN_LIMIT_S, period: float = 0.25, sleep=time.sleep, now=time.monotonic) -> float:
"""The seconds waited until `GLEAN_DB` exists in `profile`, read again every `period` seconds; `GleanNotReady` when `limit_s` is over or the profile is not known.
Why: a session that closes before Glean has initialised normally makes Glean start inside the shutdown, where its `glean.init` thread can die with the panic "No database
found" and the parent exits with -11 (Mozilla's race, the same in the retail browser; the network A/A, Linux, run 45121964904). The oracles close only after this. It only
reads: nothing is written in the profile, and no preference of the browser changes."""
if profile is None:
raise GleanNotReady("Glean did not initialise in %g s: no %s in the profile of the launch: the profile of the launch is not known (the close would make it start inside the "
"shutdown, where it can crash: run 45121964904)" % (limit_s, GLEAN_DB.as_posix()))
target = Path(profile) / GLEAN_DB
start = now()
while not target.is_file():
waited = now() - start
if waited >= limit_s:
raise GleanNotReady("Glean did not initialise in %g s: no %s in the profile %s (the close would make it start inside the shutdown, where it can crash: run 45121964904)"
% (limit_s, GLEAN_DB.as_posix(), profile))
sleep(period)
return now() - start
#: Where a profile keeps what Glean and the data reporting policy write; its listing before the close is kept with the evidence of the launch (`save_datareporting`).
DATAREPORTING_DIR = "datareporting"
def datareporting_listing(profile) -> list:
"""The lines of the list of `<profile>/datareporting/`: `<path relative to it><TAB><size in bytes>` (a folder ends with `/` and has `-`), sorted. A line that starts with `# `
says what could not be read: the list never raises."""
if profile is None:
return ["# the profile of the launch is not known"]
root = Path(profile) / DATAREPORTING_DIR
if not root.is_dir():
return ["# %s is not a folder in the profile %s" % (DATAREPORTING_DIR, profile)]
rows, problems = [], []
for folder, names, files in os.walk(root, onerror=lambda e: problems.append("# cannot read %s: %s" % (getattr(e, "filename", "?"), e))):
base = Path(folder)
for name in names:
rows.append("%s/\t-" % (base / name).relative_to(root).as_posix())
for name in files:
path = base / name
try:
size = str(path.stat().st_size)
except OSError as exc:
size = "?"
problems.append("# cannot read the size of %s: %s" % (path.relative_to(root).as_posix(), exc))
rows.append("%s\t%s" % (path.relative_to(root).as_posix(), size))
return problems + sorted(rows)
def save_datareporting(profile) -> str | None:
"""Writes the list of `<profile>/datareporting/` of the launch the probe sees now, to `<crash dir>/datareporting/<NN>-<seed>-<launch>.tsv` (NN: the number of the launch, the
one of its file in `stderr/`), and returns the path as the evidence names it. None when no probe is installed or it has no folder. What it could not read is in the file; it
never raises. It is evidence for the next time a launch dies: it is not in the leaves that are compared."""
probe = PROBE
if probe is None or probe.crash_dir is None:
return None
try:
with probe._lock:
records = list(probe.records)
number = getattr(records[-1], "n", len(records)) if records else 0
name = "%02d-%s.tsv" % (number, _safe("-".join(str(v) for v in probe.label.values()) or "launch"))
folder = probe.crash_dir / DATAREPORTING_DIR
folder.mkdir(parents=True, exist_ok=True)
head = ["# launch %d: %s" % (number, ", ".join("%s %s" % kv for kv in probe.label.items()) or "not named"), "# path (relative to datareporting/)<TAB>size in bytes"]
(folder / name).write_text("\n".join(head + datareporting_listing(profile)) + "\n", encoding="utf-8", newline="\n")
return "%s/%s/%s" % (probe.crash_dir.name, DATAREPORTING_DIR, name)
except Exception: # noqa: BLE001 - the evidence never breaks a launch
return None
#: The line an oracle writes when it begins a launch (`launch_line`), and what reads it back (`last_launch`): the process that runs the oracle names, when the oracle does not end in
#: time, the launch that was alive.
LAUNCH_LINE = re.compile(r"^=== launch (?P<launch>\S+) seed (?P<seed>-?\d+) of (?P<label>.*?) began at (?P<at>\S+)\s*$", re.M)
def launch_line(seed, launch: str, label: str, at=None) -> str:
"""`=== launch <launch> seed <seed> of <label> began at <iso, UTC>`: what an oracle prints when `mark` names a launch."""
import datetime
at = at or datetime.datetime.now(datetime.timezone.utc)
return "=== launch %s seed %s of %s began at %s" % (launch, seed, label or "?", at.isoformat(timespec="seconds"))
def last_launch(text: str, now=None) -> dict | None:
"""The last launch line of `text` as {launch, seed, label, at, alive_s} (alive_s: seconds from `at` to `now`, None when `at` does not read), or None when there is none."""
import datetime
found = None
for found in LAUNCH_LINE.finditer(text or ""):
pass
if found is None:
return None
item = found.groupdict()
try:
began = datetime.datetime.fromisoformat(item["at"])
item["alive_s"] = ((now or datetime.datetime.now(datetime.timezone.utc)) - began).total_seconds()
except (ValueError, TypeError):
item["alive_s"] = None
return item
def kill_tree(pid: int) -> None:
"""Kills `pid` and everything that descends from it. With psutil the descendants are listed first (a parent that dies hides its children) and all are killed; without it
Windows has `taskkill /T /F` and Linux the process group (the child was started in its own session, `run_tree`)."""
try:
import psutil
except ImportError:
psutil = None
if psutil is not None:
try:
root = psutil.Process(pid)
victims = root.children(recursive=True) + [root]
except psutil.NoSuchProcess:
victims = []
for victim in victims:
with contextlib.suppress(psutil.Error):
victim.kill()
elif sys.platform == "win32":
subprocess.run(["taskkill", "/PID", str(pid), "/T", "/F"], capture_output=True, check=False)
if sys.platform != "win32":
import signal
with contextlib.suppress(OSError):
os.killpg(pid, signal.SIGKILL) # the group of the child, which is its own (start_new_session)
class TreeRun:
"""What `run_tree` saw: the code (None when the time ran out), the text of stdout and stderr, how long it ran and the launch line the oracle wrote last."""
def __init__(self, returncode, stdout: str, stderr: str, seconds: float, timed_out: bool) -> None:
self.returncode, self.stdout, self.stderr, self.seconds, self.timed_out = returncode, stdout, stderr, seconds, timed_out
self.launch = last_launch(stdout)
def timeout_message(self, who: str, limit_s: float) -> str:
"""The red of a run that did not end: the launch that was alive and for how long."""
if self.launch is None:
alive = "no launch had begun"
else:
alive = "the launch %s of seed %s (%s) was alive for %s s" % (self.launch["launch"], self.launch["seed"], self.launch["label"],
"%d" % self.launch["alive_s"] if self.launch["alive_s"] is not None else "?")
return "%s did not end within %d s: %s; its tree was killed" % (who, limit_s, alive)
def run_tree(command, out_dir, timeout_s: float, env=None, cwd=None, poll: float = 0.2) -> TreeRun:
"""Runs `command` with its output in FILES under `out_dir` (never a pipe), and at `timeout_s` kills the whole tree.
Why not `subprocess.run(capture_output=True, timeout=...)`: at the timeout it kills the child alone. The firefox that the child launched holds the write end of the pipe,
`communicate()` does not return until it exits, and the test went on to a pytest timeout 120 s later (run 45121964904, Windows, job.log 546-557). With files nothing waits
for a grandchild, and `kill_tree` ends them all."""
out_dir = Path(out_dir)
out_dir.mkdir(parents=True, exist_ok=True)
out_path, err_path = out_dir / "run-tree.stdout", out_dir / "run-tree.stderr"
start = time.monotonic()
with open(out_path, "wb") as out, open(err_path, "wb") as err:
extra = {"start_new_session": True} if sys.platform != "win32" else {}
child = subprocess.Popen(list(command), stdout=out, stderr=err, stdin=subprocess.DEVNULL, env=env, cwd=cwd, **extra)
timed_out = False
while child.poll() is None:
if time.monotonic() - start >= timeout_s:
timed_out = True
kill_tree(child.pid)
break
time.sleep(poll)
child.wait()
seconds = time.monotonic() - start
read = lambda path: path.read_bytes().decode("utf-8", "replace") # noqa: E731
return TreeRun(None if timed_out else child.returncode, read(out_path), read(err_path), seconds, timed_out)
def read_exits(path) -> dict | None:
"""The document a probe wrote, or None when there is none."""
try:
document = json.loads(Path(path).read_text(encoding="utf-8"))
except (OSError, ValueError):
return None
return document if document.get("format") == FORMAT else None
def exits_of_run(crash_dir, run: str, windows: bool | None = None, needed: bool = True) -> list:
"""The red lines of the launches a run process recorded in `crash_dir/exits.json`. No file, or no launch in it, is red when the run was to make some: an oracle
that did not see how its browsers ended did not see them."""
if not crash_dir:
return []
document = read_exits(Path(crash_dir) / "exits.json")
if document is None:
return ["the run %s left no record of how its browsers ended (%s/exits.json): the probe did not see them" % (run, Path(crash_dir).name)] if needed else []
if not document["launches"] and needed:
return ["the run %s recorded no launch in %s/exits.json: the probe did not see a browser" % (run, Path(crash_dir).name)]
problems = exit_problems(document["launches"], run, windows)
if document.get("stderr_said"):
problems.append("the run %s could not save what its browsers wrote: %s" % (run, document["stderr_said"]))
for launch in document["launches"]:
if launch.get("stderr_said"):
problems.append("the run %s did not save what the browser of launch %s wrote: %s" % (run, launch.get("n"), launch["stderr_said"]))
return problems
def current_label() -> dict:
"""The launch the oracle named last (`mark`), or {} when no probe is installed."""
return dict(PROBE.label) if PROBE is not None else {}
@contextlib.contextmanager
def environment(**values):
"""`os.environ` with `values` set for the length of the block, put back after it (None removes a variable)."""
old = {k: os.environ.get(k) for k in values}
try:
for k, v in values.items():
if v is None:
os.environ.pop(k, None)
else:
os.environ[k] = str(v)
yield
finally:
for k, v in old.items():
if v is None:
os.environ.pop(k, None)
else:
os.environ[k] = v
+446 -36
View File
@@ -41,6 +41,10 @@ legitimately differ on them and the retail reference does not record them.
compare() skips them by name; dump() prints them into the job log, so a run
tells why without its artifacts being downloaded.
Values under the ab. prefix are read for the A/B oracle: what a page reads of values a host may hold and the engine must never read
(ab.poison, with scripts/ci_poison_host.py) and, on the oracle's visits of seeds 0 and 63, the surfaces of every realm and window a page
can make (ab_visit). compare() skips them by name, as it skips diag.: the A/B compares them between the two engines.
Values under the state. prefix are the window in the states a page can drive
it to: state.normal, state.fullscreen (entered through a real click, a user
gesture) and state.after_fullscreen. The dump measures them after the page is
@@ -56,6 +60,12 @@ the same rule.
python ci_host_gate.py dump <firefox> --leg linux-x86_64 --out dumps/
python ci_host_gate.py compare dumps/ (reference: host_gate/reference/firefox-159)
python ci_host_gate.py compare dumps/ --junit gate-junit/host-gate.xml
--junit writes the verdict as a junit (xunit2) file, one testcase per invariant
(name `invariant:<name>`) and one per other check (`check:<name>`), classname
`scripts.ci_host_gate`: a failed check is a <failure>, a check with nothing to look at
(no dumps) is a <skipped/>, never a pass. The exit status is the gate's own.
"""
from __future__ import annotations
@@ -64,11 +74,19 @@ import base64
import fnmatch
import gzip
import json
import os
import shutil
import sys
import tempfile
import threading
import xml.etree.ElementTree as ET
from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer
from pathlib import Path
from typing import Callable, NamedTuple
from urllib.parse import parse_qs, urlsplit
sys.path.insert(0, str(Path(__file__).resolve().parent))
import ci_crash_evidence as crash # noqa: E402 (how each launch's parent ended: the A/B oracle of the page turns a code other than 0 into a red line)
HERE = Path(__file__).resolve().parent / "host_gate"
PAGE = HERE / "host_gate_page.html"
@@ -88,11 +106,31 @@ ANCHOR = "win-x86_64"
#: Keys under this prefix are information, never compared (see the module docstring).
DIAG = "diag."
#: The items of a visit's SECOND launch on a profile that a first launch already used (`--relaunch-seed`, the A/B oracle's) live under this prefix, next to the
#: items of the visit on a fresh profile: the retail comparison (`compare`) never reads a dump made without that option, and the oracle compares the two
#: sets of leaves apart. The diag. items of the second launch are not kept: what the page records about the host is information, never compared.
RELAUNCH = "relaunch."
def relaunch_items(items: dict) -> dict:
"""The items of a second launch as they are stored in the visit: every key under RELAUNCH, the diag. ones left out."""
return {RELAUNCH + k: v for k, v in items.items() if not is_diag(k)}
def is_diag(key: str) -> bool:
return key.startswith(DIAG)
#: Keys under this prefix are read for the A/B oracle (scripts/ci_ab_oracle.py compares them between two engines on one machine). The host gate
#: does not hold them to either of its properties: the retail reference does not record them, and they are made on the oracle's machine
#: (a poisoned host, a launch in another locale), not on the gate's.
AB = "ab."
def is_ab(key: str) -> bool:
return key.startswith(AB)
def diag_lines(items: dict, before: dict | None = None) -> list:
"""The diag. leaves of one visit as 'key = value' lines; with before (an
earlier visit's diag leaves), only the keys whose value changed."""
@@ -375,61 +413,363 @@ def reference_zone(reference: Path) -> str:
return reference_items(reference, 1.0)["surface.intl"]["DateTimeFormat"]["timeZone"]
def visit_options(firefox: str, seed: int, dpr: float, zone: str) -> dict:
def visit_options(firefox: str, seed: int, dpr: float | None, zone: str, profile_dir: str | None = None) -> dict:
"""The launch of one (dpr, seed) visit. The DPR is PINNED in the persona
(screen.dpr), so the core declares a screen, a work area and a window made
at that scale. It used to be forced through
extra_prefs={"layout.css.devPixelsPerPx": ...} on whatever persona the seed
drew: a 100% persona at 1.5 read innerWidth 1920 inside an outerWidth of
1291 (run 41325657085), an identity no machine has, which the engine now
refuses to start with."""
return {"seed": seed, "binary_path": firefox, "headless": True, "show_cursor": False,
"locale": "en-US", "timezone": zone, "pin": {"screen.dpr": dpr}}
refuses to start with. With dpr None nothing is pinned: the seed's own persona decides the scale.
With a profile_dir the launch is the wrapper's persistent context on that folder (the profile a user keeps between runs)."""
options = {"seed": seed, "binary_path": firefox, "headless": True, "show_cursor": False,
"locale": "en-US", "timezone": zone}
if dpr is not None:
options["pin"] = {"screen.dpr": dpr}
if profile_dir is not None:
options["profile_dir"] = str(profile_dir)
return options
def dump(firefox: str, leg: str, out: Path, reference: Path, timeout_ms: int = 180_000) -> int:
#: Which launch of the dump is being made, for the name of the leaf a tab that died is recorded under (`crash.tab.<launch>`): the visit, the two launches of the pair on one profile,
#: the ab visit. Set with the probe's own label (`_mark`), so that the leaf and the evidence of the launch have one name.
_LAUNCH = ["visit"]
def _mark(seed, dpr, launch: str) -> None:
_LAUNCH[0] = launch
crash.mark(seed=seed, dpr=dpr, launch=launch)
class Steps:
"""Which step of a launch is being made, so that a tab that dies says WHERE: `step` is the last one begun, and `failed` the (step, error) of the last call of `wrap` that raised."""
def __init__(self, step: str = "launch") -> None:
self.step, self.failed = step, None
def wrap(self, name: str, fn: Callable) -> Callable:
def run(*args, **kwargs):
self.step = "%s %s" % (name, ", ".join(str(a)[:60] for a in args))
try:
return fn(*args, **kwargs)
except Exception as e: # noqa: BLE001 - noted, and raised again
self.failed = (self.step, e)
raise
return run
def leaves_of_crash(items: dict) -> dict:
"""{key: {"error", "step"}} of the items that record a tab that died or a session that was lost (also those of the second launch, under RELAUNCH)."""
out = {}
for key, value in items.items():
bare = key[len(RELAUNCH):] if key.startswith(RELAUNCH) else key
if bare.startswith(crash.TAB_PREFIX) and isinstance(value, dict):
out[key] = value
return out
def tab_crash_lines(visit: str, items: dict) -> list:
"""The tab crashes a visit's items hold, as the lines a dump prints."""
return ["TAB CRASH %s %s: %s, at the step %s" % (visit, k, v.get("error"), v.get("step")) for k, v in sorted(leaves_of_crash(items).items())]
def read_page(options: dict, port: int, dpr: float, timeout_ms: int) -> dict:
"""One launch: the page's result (with the states driven when the page answered the format), the browser closed. With a profile_dir in
`options` the wrapper hands back a persistent context, not a browser, and the page is opened in it.
A tab that died, or a session that was lost, while the page was read (the error says it: `crash.tab_lost`) is not an exception of the dump: it is the leaf
`crash.tab.<launch>` of this visit, with the error and the step, and the dump goes on. It used to be a `{"error": ...}` in each state the drive had not reached, which the
comparison read as a cascade of leaves that were missing (candidate run: «cannot find session» in every `state.*`)."""
from invisible_playwright import InvisiblePlaywright
launch, trace, result = _LAUNCH[0], Steps("new page"), None
with InvisiblePlaywright(**options) as browser:
try:
page = browser.new_page() if "profile_dir" in options else browser.new_context().new_page()
# The same budget as the wait below: a cold Windows runner took
# more than goto's default 30 s to reach `load` on the first
# visit (candidate 42410156024), and passed locally 6/6.
trace.step = "goto"
page.goto("http://127.0.0.1:%d/?dpr%s" % (port, dpr), timeout=timeout_ms)
trace.step = "wait for the page's result"
page.wait_for_function("document.title === 'done'", timeout=timeout_ms)
trace.step = "read the page's result"
result = page.evaluate("window.__hostGate")
if result.get("format") == FORMAT:
result["items"].update(drive_states(trace.wrap("evaluate", page.evaluate), trace.wrap("mouse move", page.mouse.move), trace.wrap("mouse click", page.mouse.click)))
if trace.failed is not None and crash.tab_lost(trace.failed[1]):
result["items"].update(crash.tab_crash_item(launch, "states: " + trace.failed[0], trace.failed[1]))
except Exception as e: # noqa: BLE001 - only a tab that died is recorded; anything else is raised as it always was
if not crash.tab_lost(e):
raise
result = {"format": FORMAT, "items": dict(result["items"]) if isinstance(result, dict) and isinstance(result.get("items"), dict) else {}}
result["items"].update(crash.tab_crash_item(launch, trace.step, e))
return result
def second_launch(options: dict, port: int, dpr: float, timeout_ms: int, read=None) -> dict:
"""The page's result of a SECOND launch on a profile the first one used: the same options and the same seed, on a folder of this call
that is made, launched on once (what that launch leaves in it is the point: cookies, cache, prefs.js, the session seed), closed,
launched on again, and removed. A first launch that did not answer the format is what comes back, for the caller to refuse."""
read = read or read_page
profile = tempfile.mkdtemp(prefix="host-gate-profile-")
try:
with_profile = dict(options, profile_dir=profile)
_mark(options.get("seed"), dpr, "relaunch-first")
first = read(with_profile, port, dpr, timeout_ms)
if first.get("format") != FORMAT:
return first
_mark(options.get("seed"), dpr, "relaunch-second")
again = read(with_profile, port, dpr, timeout_ms)
if again.get("format") == FORMAT: # a tab that died in the first launch is not lost because the second one was read
again["items"].update(leaves_of_crash(first.get("items") or {}))
return again
finally:
shutil.rmtree(profile, ignore_errors=True)
def dump(firefox: str, leg: str, out: Path, reference: Path, timeout_ms: int = 180_000,
visits: list | None = None, pin_dpr: bool = True, relaunch_seeds: tuple = (), ab: bool = False) -> int:
"""`visits` is [(dpr, seed)] (default: every seed of SEEDS at every DPR of DPRS, the DPR pinned). With pin_dpr
False the DPR is not pinned: it is the one the seed's persona has, and `dpr` of a visit only names the file and
the page's query. A seed of `relaunch_seeds` is visited once more, launched twice on one profile folder, and the
items of that second launch are added to the visit under RELAUNCH (the visit's own items stay those of a fresh profile).
With `ab`, the seeds of AB_SEEDS also get the extra visit of the A/B oracle (ab_visit): its leaves join the visit's items.
When the oracle that runs this dump names a folder for it (`AB_CRASH_DIR`, scripts/ci_ab_oracle.py), a probe sees how each launch's parent ends (scripts/ci_crash_evidence.py)
and writes it to `exits.json` there, whatever the dump's own result: a launch that did not end with 0 is red in the oracle, and what it left is saved in that folder."""
out.mkdir(parents=True, exist_ok=True)
crash_dir = os.environ.get(crash.CRASH_DIR_ENV)
probe = crash.start_probe(firefox, crash_dir) if crash_dir else None
server = ThreadingHTTPServer(("127.0.0.1", 0), _Page)
threading.Thread(target=server.serve_forever, daemon=True).start()
port = server.server_address[1]
zone = reference_zone(reference)
first_diag = None
try:
for dpr in DPRS:
for seed in SEEDS:
with InvisiblePlaywright(**visit_options(firefox, seed, dpr, zone)) as browser:
page = browser.new_context().new_page()
# The same budget as the wait below: a cold Windows runner took
# more than goto's default 30 s to reach `load` on the first
# visit (candidate 42410156024), and passed locally 6/6.
page.goto("http://127.0.0.1:%d/?dpr%s" % (server.server_address[1], dpr),
timeout=timeout_ms)
page.wait_for_function("document.title === 'done'", timeout=timeout_ms)
result = page.evaluate("window.__hostGate")
if result.get("format") == FORMAT:
result["items"].update(drive_states(page.evaluate, page.mouse.move, page.mouse.click))
if result.get("format") != FORMAT:
print("the page answered format %r, not %r" % (result.get("format"), FORMAT))
for dpr, seed in (visits if visits is not None else [(d, sd) for d in DPRS for sd in SEEDS]):
options = visit_options(firefox, seed, dpr if pin_dpr else None, zone)
_mark(seed, dpr, "visit")
result = read_page(options, port, dpr, timeout_ms)
if result.get("format") != FORMAT:
print("the page answered format %r, not %r" % (result.get("format"), FORMAT))
return 2
if seed in relaunch_seeds:
again = second_launch(options, port, dpr, timeout_ms)
if again.get("format") != FORMAT:
print("the second launch on a reused profile: the page answered format %r, not %r" % (again.get("format"), FORMAT))
return 2
path = out / ("%s_dpr%s_seed%d.json" % (leg, dpr, seed))
path.write_text(json.dumps({"leg": leg, "dpr": dpr, "seed": seed, "result": result}),
encoding="utf-8")
print("dumped %s: %d items" % (path.name, len(result["items"])))
visit = "%s dpr %s seed %d" % (leg, dpr, seed)
for line in diag_report(visit, result["items"], first_diag):
print(line)
# told here too, so the job log says it without the compare step
for line in invariant_lines(visit, result["items"]):
print(line)
sys.stdout.flush()
if first_diag is None:
first_diag = {k: v for k, v in leaves(result["items"]).items() if is_diag(k)}
result["items"].update(relaunch_items(again["items"]))
print("second launch of seed %d on a reused profile: %d items" % (seed, len(again["items"])))
if ab and seed in AB_SEEDS:
_mark(seed, dpr, "ab-visit")
result["items"].update(ab_visit(firefox, seed, zone, dpr if pin_dpr else None))
path = out / ("%s_dpr%s_seed%d.json" % (leg, dpr, seed))
path.write_text(json.dumps({"leg": leg, "dpr": dpr, "seed": seed, "result": result}),
encoding="utf-8")
print("dumped %s: %d items" % (path.name, len(result["items"])))
visit = "%s dpr %s seed %d" % (leg, dpr, seed)
for line in tab_crash_lines(visit, result["items"]):
print(line)
for line in diag_report(visit, result["items"], first_diag):
print(line)
# told here too, so the job log says it without the compare step
for line in invariant_lines(visit, result["items"]):
print(line)
sys.stdout.flush()
if first_diag is None:
first_diag = {k: v for k, v in leaves(result["items"]).items() if is_diag(k)}
finally:
server.shutdown()
if probe is not None:
crash.stop_probe()
probe.write()
for line in crash.exit_problems(probe.launches, "this dump", windows=leg.startswith("win")):
print("EXIT " + line)
return 0
# -
# The A/B oracle's extra visit: every realm and every kind of window a page can make, in a launch of another locale and in a context of yet
# another, on seeds 0 and 63. Its leaves are under ab. (see is_ab): scripts/ci_ab_oracle.py compares them between the two engines. It is a
# separate launch per seed, with its own server and its own functions: nothing here changes how the visits above are made.
#
# Seed 63 is the CONTROL of seed 0: an identity that is not seed 0's must read other values, so the same block on both must differ on at least
# AB_CONTROL_MIN ab. leaves (ab_control). A block that answered the same for two identities would pass an engine that ignores the identity.
AB_DIR = HERE / "ab"
AB_SEEDS = (0, 63)
AB_LAUNCH_LOCALE = "ja-JP"
#: (name of the context, what the context is made with). The first is the launch's own default context (locale ja-JP); the second overrides
#: both the language and the zone.
AB_CONTEXTS = (("launch", {}), ("context", {"locale": "de-DE", "timezone_id": "America/Lima"}))
AB_BUDGET_MS = 240_000
#: How many ab. leaves seed 63 must differ from seed 0 on. PROVISIONAL, from the core's prefs and not from a run: the two personas differ in their core
#: count (12 and 32), their GPU, their screen and their DPR, so hardwareConcurrency alone differs in every realm that must have read (top, cross-site
#: iframe, srcdoc iframe, worker, in each of the 2 contexts: 8 leaves) and the page-read GPU, the screen and the canvas leaves come on top of them.
#: The first run on GitHub prints the measured count (ab_control's line in the oracle's log, and ab-control.json): this number then moves to a safe
#: fraction of it, written here with the run it came from.
AB_CONTROL_MIN = 8
AB_CONTROL_NAMESPACES = tuple("%s%s." % (AB, name) for name, _ in AB_CONTEXTS)
_AB_TYPES = {".html": "text/html; charset=utf-8", ".js": "text/javascript; charset=utf-8"}
#: A one-pixel GIF: what /ab/probe answers to a fetch and to an image alike.
_GIF = base64.b64decode("R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7")
class _AbSite(BaseHTTPRequestHandler):
"""The site of the ab visit: the files of scripts/host_gate/ab, /ab/probe (a pixel) and /ab/seen (the Accept-Language the server saw,
per context, by kind of request: `<Sec-Fetch-Dest>:<path>` -> the sorted distinct values)."""
def _send(self, status, content_type, body):
self.send_response(status)
self.send_header("Content-Type", content_type)
self.send_header("Content-Length", str(len(body)))
self.end_headers()
self.wfile.write(body)
def do_GET(self):
url = urlsplit(self.path)
ctx = (parse_qs(url.query).get("ctx") or [""])[0]
if url.path == "/ab/seen":
with self.server.ab_lock:
seen = {k: sorted(v) for k, v in self.server.ab_seen.get(ctx, {}).items()}
return self._send(200, "application/json", json.dumps(seen, sort_keys=True).encode())
if url.path.startswith("/ab/"):
with self.server.ab_lock:
kind = "%s:%s" % (self.headers.get("Sec-Fetch-Dest") or "none", url.path)
self.server.ab_seen.setdefault(ctx, {}).setdefault(kind, set()).add(self.headers.get("Accept-Language") or "<none>")
if url.path.startswith("/ab/probe"):
return self._send(200, "image/gif", _GIF)
name = url.path[len("/ab/"):] if url.path.startswith("/ab/") else ""
path = AB_DIR / name
if not name or "/" in name or "\\" in name or path.suffix not in _AB_TYPES or not path.is_file():
return self._send(404, "text/plain", b"not found")
return self._send(200, _AB_TYPES[path.suffix], path.read_bytes())
def log_message(self, *args):
pass
def ab_options(firefox: str, seed: int, dpr: float | None, zone: str) -> dict:
"""The launch of the ab visit: the host gate's own, in ja-JP."""
options = {"seed": seed, "binary_path": firefox, "headless": True, "show_cursor": False,
"locale": AB_LAUNCH_LOCALE, "timezone": zone}
if dpr is not None:
options["pin"] = {"screen.dpr": dpr}
return options
def ab_items(context: str, result, back) -> dict:
"""The items of one context of the ab visit: what the page recorded (ab.<context>.<step>...), what a page that came back from the history reads
again (ab.<context>.bfcache: whether it was restored from the back/forward cache is the engine's, not the identity's, and goes to diag.)."""
body = dict(result) if isinstance(result, dict) else {"result": result}
body["bfcache"] = back.get("data") if isinstance(back, dict) else back
return {AB + context: body, DIAG + AB + context: {"bfcache_persisted": back.get("persisted") if isinstance(back, dict) else None}}
def ab_visit(firefox: str, seed: int, zone: str, dpr: float | None = None, timeout_ms: int = AB_BUDGET_MS) -> dict:
"""Launch `firefox` with the seed in ja-JP, and read the ab site in its default context and in a context of de-DE and America/Lima;
returns {key: value} to add to the visit's items."""
from invisible_playwright import InvisiblePlaywright
server = ThreadingHTTPServer(("127.0.0.1", 0), _AbSite)
server.ab_seen, server.ab_lock = {}, threading.Lock()
threading.Thread(target=server.serve_forever, daemon=True).start()
base = "http://127.0.0.1:%d/ab/" % server.server_address[1]
items = {}
lost = None
try:
with InvisiblePlaywright(**ab_options(firefox, seed, dpr, zone)) as browser:
for name, options in AB_CONTEXTS:
context, step = None, "new context"
try:
context = browser.new_context(**options)
step = "new page"
page = context.new_page()
step = "goto surfaces"
page.goto(base + "surfaces.html?ctx=" + name, timeout=timeout_ms)
step = "wait for the page's result"
page.wait_for_function("document.title === 'ab-done'", timeout=timeout_ms)
step = "read the page's result"
result = page.evaluate("window.__abResult")
# away and back: the page that comes back reads again (pageshow), restored from the cache or loaded anew
step = "goto leave"
page.goto(base + "leave.html?ctx=" + name, timeout=timeout_ms)
step = "go back"
page.go_back(timeout=timeout_ms)
step = "wait for the page that came back"
page.wait_for_function("window.__abBf && window.__abBf.n >= 2", timeout=timeout_ms)
step = "read the page that came back"
back = page.evaluate("window.__abBf")
except Exception as e: # noqa: BLE001 - a tab that died is the leaf `crash.tab.ab-visit`; anything else is raised as it always was
if not crash.tab_lost(e):
raise
lost = crash.tab_crash_item("ab-visit", "%s (context %s)" % (step, name), e)
finally:
if context is not None:
try:
context.close()
except Exception: # noqa: BLE001 - closing a context whose tab died says nothing more
if lost is None:
raise
if lost is not None:
items.update(lost)
break
items.update(ab_items(name, result, back))
finally:
server.shutdown()
server.server_close()
return items
def ab_control(items_by_seed: dict, seeds: tuple = AB_SEEDS, minimum: int | None = None) -> dict:
"""The control of the ab visit: on how many leaves of the ab visit seeds[1] differs from seeds[0]. `items_by_seed` maps a seed to its items.
Returns {"status": "ok"|"too_few"|"not_visited", "differing", "compared", "minimum", "line"}; not_visited (a run that did not visit both,
the pull request's two seeds) is said, and the caller decides whether that is allowed."""
minimum = AB_CONTROL_MIN if minimum is None else minimum
a, b = seeds
mine = {}
for seed in seeds:
items = items_by_seed.get(seed)
mine[seed] = None if items is None else {k: v for k, v in leaves(items).items() if k.startswith(AB_CONTROL_NAMESPACES)}
if not mine[a] or not mine[b]:
missing = [s for s in seeds if not mine[s]]
return {"status": "not_visited", "differing": None, "compared": None, "minimum": minimum,
"line": "ab control: seed %s has no ab. leaves in this run" % " and ".join(map(str, missing))}
keys = sorted(set(mine[a]) | set(mine[b]))
differing = [k for k in keys if mine[a].get(k, "<missing>") != mine[b].get(k, "<missing>")]
status = "ok" if len(differing) >= minimum else "too_few"
return {"status": status, "differing": len(differing), "compared": len(keys), "minimum": minimum, "sample": differing[:12],
"line": "ab control: seed %d differs from seed %d on %d of %d ab. leaves (at least %d are required)%s"
% (b, a, len(differing), len(keys), minimum, "" if status == "ok" else ": an identity that is not seed %d's read the same" % a)}
#: The steps of the ab visit that must have read something in every context: a realm that answers `timeout` or an error says the page did not
#: read, and an A/B of two such answers compares nothing. The others (the service worker, the audio worklet, the popups) may be missing on a
#: host that has none of it; what they answered is compared like any leaf.
AB_REQUIRED_STEPS = ("top", "iframe_cross", "iframe_srcdoc", "worker", "accept_language")
def ab_coverage(items_by_seed: dict, seeds: tuple = AB_SEEDS) -> list:
"""What is missing from the ab visit of the seeds of this run that have one: [problem]. A seed of `seeds` that the run visited without an
ab visit, a context without its leaves, and a required step that did not read a dict are problems."""
problems = []
for seed in seeds:
items = items_by_seed.get(seed)
if items is None:
continue
for name, _ in AB_CONTEXTS:
body = items.get(AB + name)
if not isinstance(body, dict):
problems.append("seed %d: no %s%s leaves (the ab visit did not run, or the page recorded none)" % (seed, AB, name))
continue
for step in AB_REQUIRED_STEPS:
if not isinstance(body.get(step), dict):
problems.append("seed %d %s%s.%s: %s" % (seed, AB, name, step, json.dumps(body.get(step))[:160]))
return problems
# -
# Compare: every leg, every visit, against each other and against retail.
@@ -494,7 +834,7 @@ def compare(dumps: Path, reference: Path, exceptions: dict, notes: list | None =
for path in sorted(dumps.glob("*.json")):
d = json.loads(path.read_text(encoding="utf-8"))
items = d["result"]["items"]
visits[(d["leg"], d["dpr"], d["seed"])] = {k: v for k, v in leaves(items).items() if not is_diag(k)}
visits[(d["leg"], d["dpr"], d["seed"])] = {k: v for k, v in leaves(items).items() if not is_diag(k) and not is_ab(k)}
# the invariants: every leg, every visit, every state; no exception and no reference applies
failures += invariant_lines("%s dpr %s seed %d" % (d["leg"], d["dpr"], d["seed"]), items)
if not visits:
@@ -506,7 +846,7 @@ def compare(dumps: Path, reference: Path, exceptions: dict, notes: list | None =
items = reference_items(reference, dpr)
if items is None:
return ["no retail reference for dpr %s in %s" % (dpr, reference)]
refs[dpr] = {k: v for k, v in leaves(items).items() if not is_diag(k)}
refs[dpr] = {k: v for k, v in leaves(items).items() if not is_diag(k) and not is_ab(k)}
pending[dpr] = tuple(p for p in REFERENCE_PENDING if not any(k.startswith(p) for k in refs[dpr]))
for p in pending[dpr]:
if notes is not None:
@@ -578,6 +918,61 @@ def compare(dumps: Path, reference: Path, exceptions: dict, notes: list | None =
return failures
# -
# The junit: the verdict of compare() as one testcase per invariant and per
# other check, so a judge can ask "did this invariant pass" by name.
#: The classname is the script's path as a dotted module (the hook tests judge turns it back into
#: scripts/ci_host_gate.py, the file a hook names).
JUNIT_CLASSNAME = "scripts.ci_host_gate"
#: The checks of compare() other than the invariants, with the prefix of the
#: failure lines each one owns.
CHECKS = (
("dumps_complete", ("no dumps", "no retail reference")),
("host_independence", ("host ",)),
("retail_equality", ("retail ",)),
("exceptions_current", ("known defect",)),
)
def junit_cases(failures: list, dumps_seen: int) -> list:
"""The verdict as [(name, status, lines)], status being passed, failed or
skipped. Nothing to look at (no dump) skips an invariant; a failure line
is owned by the invariant or check it names."""
cases = []
for inv in INVARIANTS:
lines = [f for f in failures if f.startswith("invariant %s " % inv.name)]
cases.append(("invariant:" + inv.name, "failed" if lines else ("passed" if dumps_seen else "skipped"), lines))
no_dumps = any(f.startswith("no dumps") for f in failures)
no_reference = any(f.startswith("no retail reference") for f in failures)
for name, prefixes in CHECKS:
lines = [f for f in failures if f.startswith(prefixes) or (name == "dumps_complete" and ": no dump for seeds" in f)]
skipped = no_dumps or (no_reference and name != "dumps_complete")
cases.append(("check:" + name, "failed" if lines else ("skipped" if skipped else "passed"), lines))
return cases
def write_junit(path: Path, cases: list, suite: str = "host-gate") -> None:
"""cases: [(name, status, lines)] as a junit (xunit2) file at path."""
root = ET.Element("testsuites")
counts = {"failed": 0, "skipped": 0}
for _, status, _lines in cases:
if status in counts:
counts[status] += 1
ts = ET.SubElement(root, "testsuite", name=suite, tests=str(len(cases)), failures=str(counts["failed"]),
errors="0", skipped=str(counts["skipped"]), time="0")
for name, status, lines in cases:
tc = ET.SubElement(ts, "testcase", classname=JUNIT_CLASSNAME, name=name, time="0")
if status == "failed":
f = ET.SubElement(tc, "failure", message=lines[0][:300] if lines else "failed")
f.text = "\n".join(lines[:50])
elif status == "skipped":
ET.SubElement(tc, "skipped", message="nothing to check: the gate had no dumps or no reference")
path.parent.mkdir(parents=True, exist_ok=True)
ET.ElementTree(root).write(path, encoding="utf-8", xml_declaration=True)
def main(argv=None) -> int:
ap = argparse.ArgumentParser(description=__doc__.split("\n")[0])
sub = ap.add_subparsers(dest="cmd", required=True)
@@ -586,18 +981,33 @@ def main(argv=None) -> int:
d.add_argument("--leg", required=True)
d.add_argument("--out", type=Path, required=True)
d.add_argument("--reference", type=Path, default=REFERENCE)
d.add_argument("--visit", action="append", metavar="SEED:DPR",
help="visit this seed (repeatable; default: the host gate's own seeds at its own DPRs)")
d.add_argument("--ab", action="store_true",
help="the seeds of AB_SEEDS also get the A/B oracle's extra visit (ab. leaves)")
d.add_argument("--no-pin", action="store_true",
help="do not pin the DPR: the seed's persona has its own (the DPR of --visit only names the file)")
d.add_argument("--relaunch-seed", action="append", type=int, default=[], metavar="SEED",
help="also launch this seed twice on one profile folder and keep the second launch's items under relaunch. (repeatable)")
c = sub.add_parser("compare")
c.add_argument("dumps", type=Path)
c.add_argument("--reference", type=Path, default=REFERENCE)
c.add_argument("--junit", type=Path, help="also write the verdict as a junit (xunit2) file")
args = ap.parse_args(argv)
if args.cmd == "dump":
return dump(args.firefox, args.leg, args.out, args.reference)
visits = None
if args.visit:
visits = [(float(dpr), int(seed)) for seed, dpr in (v.split(":", 1) for v in args.visit)]
return dump(args.firefox, args.leg, args.out, args.reference, visits=visits, pin_dpr=not args.no_pin,
relaunch_seeds=tuple(args.relaunch_seed), ab=args.ab)
notes = []
failures = compare(args.dumps, args.reference, load_exceptions(), notes)
for n in notes:
print("NOTE " + n)
for f in failures:
print("FAIL " + f)
if args.junit:
write_junit(args.junit, junit_cases(failures, len(list(args.dumps.glob("*.json")))))
print("HOST GATE %s: %d failures" % ("OK" if not failures else "FAILED", len(failures)))
return 1 if failures else 0
+135
View File
@@ -0,0 +1,135 @@
#!/usr/bin/env python3
"""Writes ci/py-lock/playwright-browsers.json: the sha256 of every archive of Playwright's own Firefox that the engine series' gate installs (ci-03).
The rows of the gate that compare the engine with the stock Firefox install it from Playwright's CDN. A third-party download is checked by a hash pinned in a
repository, so the archives are pinned HERE, at the wrapper_ref the gate selects, for the Playwright of scripts/playwright_pin.txt: what
`python -m playwright install --dry-run firefox` lists on each platform (Firefox, FFmpeg, and winldd on Windows), each downloaded once and hashed.
python scripts/ci_playwright_browsers.py [--python python] [--out ci/py-lock/playwright-browsers.json]
The interpreter must have the pinned Playwright installed (the dry-run is what names the archives, so a different version names different ones). The output is
sorted by platform, entries in the order the dry-run lists them, LF, two-space indent, so the same input gives the same bytes.
tests/test_the_playwright_browsers_pin_follows_the_pin.py reads the committed file with `problems`, offline.
"""
from __future__ import annotations
import argparse
import hashlib
import json
import os
import re
import subprocess
import sys
import urllib.request
from pathlib import Path
ROOT = Path(__file__).resolve().parent.parent
OUT_PATH = ROOT / "ci" / "py-lock" / "playwright-browsers.json"
PLAYWRIGHT_PIN = ROOT / "scripts" / "playwright_pin.txt"
#: The CDN the dry-run is asked to name (the gate downloads from the same host).
DOWNLOAD_HOST = "https://cdn.playwright.dev/dbazure/download/playwright"
#: platform name in the file -> PLAYWRIGHT_HOST_PLATFORM_OVERRIDE of the dry-run.
PLATFORMS = {"ubuntu24.04-x64": "ubuntu24.04-x64", "win64": "win64"}
#: The archive kinds the dry-run lists for each platform (the first path segment after builds/).
KINDS = {"ubuntu24.04-x64": ["firefox", "ffmpeg"], "win64": ["firefox", "ffmpeg", "winldd"]}
PATH_RE = re.compile(r"^builds/([a-z0-9_-]+)/[0-9]+/[A-Za-z0-9._-]+\.zip$")
SHA_RE = re.compile(r"^[0-9a-f]{64}$")
def problems(data: object, pin: str) -> list:
"""What is wrong with a parsed playwright-browsers.json, given the Playwright pin; an empty list when it is sound."""
out = []
if not isinstance(data, dict) or set(data) != {"playwright", "platforms"}:
return ["the file is not an object with exactly `playwright` and `platforms`"]
if data["playwright"] != pin.strip():
out.append("playwright is %r but scripts/playwright_pin.txt pins %r: regenerate with scripts/ci_playwright_browsers.py" % (data["playwright"], pin.strip()))
platforms = data["platforms"]
if not isinstance(platforms, dict) or set(platforms) != set(PLATFORMS):
return out + ["platforms are %r, expected %r" % (sorted(platforms) if isinstance(platforms, dict) else platforms, sorted(PLATFORMS))]
for name in sorted(PLATFORMS):
entries = platforms[name]
if not isinstance(entries, list):
out.append("%s: not a list" % name)
continue
kinds = []
for e in entries:
path = e.get("path") if isinstance(e, dict) else None
m = PATH_RE.match(path) if isinstance(path, str) else None
if not m:
out.append("%s: %r is not a relative `builds/<kind>/<revision>/<archive>.zip` path" % (name, path))
continue
kinds.append(m.group(1))
if not isinstance(e.get("sha256"), str) or not SHA_RE.match(e["sha256"]):
out.append("%s: %s has no 64-hex sha256" % (name, path))
if "size" in e and not (isinstance(e["size"], int) and not isinstance(e["size"], bool) and e["size"] > 0):
out.append("%s: %s has a size that is not a positive integer" % (name, path))
if set(e) - {"path", "sha256", "size"}:
out.append("%s: %s has unknown fields %s" % (name, path, sorted(set(e) - {"path", "sha256", "size"})))
if sorted(kinds) != sorted(KINDS[name]):
out.append("%s: the archives are %s, the dry-run lists %s" % (name, sorted(kinds), sorted(KINDS[name])))
return out
def installed_version(py: str) -> str:
return subprocess.run([py, "-c", "import importlib.metadata as m; print(m.version('playwright'))"], capture_output=True, text=True, check=True).stdout.strip()
def dry_run_paths(py: str, platform: str) -> list:
env = dict(os.environ, PLAYWRIGHT_HOST_PLATFORM_OVERRIDE=PLATFORMS[platform], PLAYWRIGHT_DOWNLOAD_HOST=DOWNLOAD_HOST)
dry = subprocess.run([py, "-m", "playwright", "install", "--dry-run", "firefox"], capture_output=True, text=True, env=env, check=True).stdout
urls = re.findall(r"Download url:\s+(\S+)", dry)
prefix = DOWNLOAD_HOST + "/"
bad = [u for u in urls if not u.startswith(prefix)]
if bad or not urls:
raise SystemExit("%s: the dry-run names %r, not archives of %s" % (platform, bad or urls, DOWNLOAD_HOST))
return [u[len(prefix):] for u in urls]
def fetch_hash(path: str) -> tuple:
h, size = hashlib.sha256(), 0
with urllib.request.urlopen(DOWNLOAD_HOST + "/" + path, timeout=300) as r:
while chunk := r.read(1 << 20):
h.update(chunk)
size += len(chunk)
return h.hexdigest(), size
def render(data: object) -> str:
"""The bytes of the file for a parsed content: two-space indent, LF, one trailing newline (the same content always gives the same bytes)."""
return json.dumps(data, indent=2) + "\n"
def build(py: str, pin: str) -> str:
version = installed_version(py)
if version != pin.strip():
raise SystemExit("the interpreter has playwright %s, scripts/playwright_pin.txt pins %s: install the pinned one" % (version, pin.strip()))
platforms = {}
for name in sorted(PLATFORMS):
entries = []
for path in dry_run_paths(py, name):
sha, size = fetch_hash(path)
entries.append({"path": path, "sha256": sha, "size": size})
print(name, path, size, sha, flush=True)
platforms[name] = entries
data = {"playwright": version, "platforms": platforms}
bad = problems(data, pin)
if bad:
raise SystemExit("the generated file is not sound: " + "; ".join(bad))
return render(data)
def main(argv=None) -> int:
ap = argparse.ArgumentParser(description=__doc__.splitlines()[0])
ap.add_argument("--python", default=sys.executable, help="interpreter with the pinned playwright installed (default: this one)")
ap.add_argument("--out", default=str(OUT_PATH))
a = ap.parse_args(argv)
text = build(a.python, PLAYWRIGHT_PIN.read_text(encoding="utf-8"))
Path(a.out).write_text(text, encoding="utf-8", newline="\n")
print("%s written" % Path(a.out).name)
return 0
if __name__ == "__main__":
sys.exit(main())
+852
View File
@@ -0,0 +1,852 @@
#!/usr/bin/env python3
"""The poisoned host of the page A/B oracle.
The page oracle compares two engines on one machine, so a value both read from that machine passes the comparison. This puts values on the
machine that the engine must never read, for the run of the page oracle only (the job of that leg: the host oracle's parsers read
tracerpt and strace output and are not in it), and proves that they are there with a NEGATIVE CONTROL: Playwright's own Firefox on the
same runner reads them. The engine's dumps are then held to the identity the core declares, never to the poison.
poison where Firefox reads it what the engine declares instead
time zone Lima (UTC-5, no DST): Windows `tzutil`, Linux `TZ` the zone of the host gate's reference (Asia/Bangkok), by the launch
language ja-JP: Windows `Set-Culture` and the user language list, en-US, by the launch
Linux `LANG`
colour scheme dark: Windows AppsUseLightTheme=0, Linux `GTK_THEME` the scheme of the seed's persona (dark for 40% of them)
fonts a user-installed CANARY font, family `ZZHostCanary`: no such family: a user font is not the declared machine's
Windows machine-wide fonts (the Fonts folder of the system and HKLM; the runner is an administrator), Linux ~/.local/share/fonts
audio (Linux) a null sink at 96000 Hz and 6 channels, the default sink the persona's sample rate (44100 or 48000) and channel count
The canary is generated here, byte for byte the same every time (`canary_font()`: a TrueType font of three glyphs, written from the
specification, no third-party font and so no licence): every letter and digit is a box 1.5 em wide, so a page that reads the family
measures a text far wider than any fallback. Its sha256 is CANARY_SHA256 and the tests hold the two together.
python ci_poison_host.py apply [--state FILE] [--no-audio] put the poison on this machine (and verify it); writes the undo state
python ci_poison_host.py verify [--expect-env] the poison is in force (--expect-env: this process also inherited the variables)
python ci_poison_host.py undo --state FILE put back what apply found
python ci_poison_host.py control --out FILE the negative control: stock Firefox of Playwright reads the poison, or exit 2 (broken control)
python ci_poison_host.py font --out FILE write the canary font
Windows warning. `Set-Culture` changes the number and date formats of every process started after it. Every PowerShell this script runs
starts by forcing the invariant culture on its own thread, and the state it keeps is text it read before the change: nothing here
parses a formatted number or a date. The poison belongs to the page oracle's job and `undo` runs before that job's judge.
"""
from __future__ import annotations
import argparse
import hashlib
import json
import os
import re
import struct
import subprocess
import sys
from pathlib import Path
from typing import Callable
HERE = Path(__file__).resolve().parent
PAGE = HERE / "host_gate" / "host_gate_page.html"
FAMILY = "ZZHostCanary"
FONT_FILE = FAMILY + ".ttf"
#: Where Firefox must read Lima from, in the two spellings: the Windows id and the IANA name (the offsets are what a page tells apart).
WINDOWS_ZONE, IANA_ZONE = "SA Pacific Standard Time", "America/Lima"
LIMA_OFFSETS = [300, 300]
CULTURE, LINUX_LANG = "ja-JP", "ja_JP.UTF-8"
GTK_THEME = "Adwaita:dark"
SINK, SINK_RATE, SINK_CHANNELS = "hostcanary", 96000, 6
SINK_MAP = "front-left,front-right,front-center,lfe,rear-left,rear-right"
#: The variables a Linux poison puts in the environment of the later steps ($GITHUB_ENV), and the one that says it is on.
LINUX_ENV = {"TZ": IANA_ZONE, "LANG": LINUX_LANG, "LANGUAGE": "ja", "GTK_THEME": GTK_THEME}
#: A text of 12 'm' at 12px in the canary: 12 boxes of 1.5 em. A generic family that measures this is the canary.
CANARY_TEXT_WIDTH = 216.0
GENERICS = ("sans-serif", "serif", "monospace")
SWITCH = "AB_ORACLE_POISON"
#: The variable that names the file `apply` wrote its undo state to.
STATE_SWITCH = "AB_ORACLE_POISON_STATE"
THEME_KEY = r"HKCU:\Software\Microsoft\Windows\CurrentVersion\Themes\Personalize"
FONTS_KEY = r"HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts"
FONT_VALUE = FAMILY + " (TrueType)"
Run = Callable[[list], tuple]
# -
# The canary font.
def _checksum(data: bytes) -> int:
data += b"\0" * (-len(data) % 4)
return sum(struct.unpack(">%dI" % (len(data) // 4), data)) & 0xFFFFFFFF
def _pad(data: bytes) -> bytes:
return data + b"\0" * (-len(data) % 4)
def canary_font() -> bytes:
"""A TrueType font, family ZZHostCanary, of three glyphs: .notdef and every character of U+0021..U+007E are boxes, U+0020 is blank.
The advance of a box is 1500 units of 1000 per em, the space's 500. Deterministic: no clock, no randomness."""
upem, box_advance, space_advance = 1000, 1500, 500
box = struct.pack(">hhhhh", 1, 100, 0, 1400, 700) + struct.pack(">H", 3) + struct.pack(">H", 0) + bytes([1, 1, 1, 1]) \
+ struct.pack(">4h", 100, 0, 1300, 0) + struct.pack(">4h", 0, 700, 0, -700)
glyf = _pad(box) + _pad(box) # .notdef and the box: the same drawing
loca = struct.pack(">4I", 0, len(_pad(box)), 2 * len(_pad(box)), 2 * len(_pad(box))) # .notdef, box, space (empty)
hmtx = struct.pack(">HhHhHh", box_advance, 100, box_advance, 100, space_advance, 0)
head = struct.pack(">IIIIHHqqhhhhHHhhh", 0x00010000, 0x00010000, 0, 0x5F0F3CF5, 0x000B, upem,
3_700_000_000, 3_700_000_000, 0, 0, 1400, 700, 0, 8, 2, 1, 0)
hhea = struct.pack(">IhhhHhhhhhhhhhhhH", 0x00010000, 800, -200, 0, box_advance, 100, 100, 1400, 1, 0, 0, 0, 0, 0, 0, 0, 3)
maxp = struct.pack(">IHHHHHHHHHHHHHH", 0x00010000, 3, 4, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0)
os2 = struct.pack(">HhHHH11h", 4, 1500, 400, 5, 0, 650, 600, 0, 75, 650, 600, 0, 350, 50, 250, 0)
os2 += bytes(10) + struct.pack(">IIII", 1, 0, 0, 0) + b"NONE"
os2 += struct.pack(">HHHhhhHHII", 0x40, 0x20, 0x7E, 800, -200, 0, 800, 200, 1, 0) + struct.pack(">hhHHH", 500, 700, 0, 0x20, 1)
post = struct.pack(">IIhhIIIII", 0x00030000, 0, -100, 50, 0, 0, 0, 0, 0)
# cmap: format 4, one segment per character (a constant glyph needs no glyph-index array)
chars = [(0x20, 2)] + [(c, 1) for c in range(0x21, 0x7F)]
ends = [c for c, _ in chars] + [0xFFFF]
deltas = [(g - c) & 0xFFFF for c, g in chars] + [1]
seg = len(ends)
sub = (struct.pack(">HHHHHHH", 4, 16 + 8 * seg, 0, seg * 2, 128, 6, 2 * seg - 128)
+ struct.pack(">%dH" % seg, *ends) + struct.pack(">H", 0) + struct.pack(">%dH" % seg, *ends)
+ struct.pack(">%dH" % seg, *deltas) + struct.pack(">%dH" % seg, *([0] * seg)))
cmap = struct.pack(">HHHHI", 0, 1, 3, 1, 12) + sub
names = {1: FAMILY, 2: "Regular", 3: FAMILY + "-Regular-1.000", 4: FAMILY + " Regular", 5: "Version 1.000", 6: FAMILY + "-Regular"}
strings, records = b"", b""
for nid in sorted(names):
text = names[nid].encode("utf-16-be")
records += struct.pack(">HHHHHH", 3, 1, 0x409, nid, len(text), len(strings))
strings += text
name = struct.pack(">HHH", 0, len(names), 6 + 12 * len(names)) + records + strings
tables = {b"OS/2": os2, b"cmap": cmap, b"glyf": glyf, b"head": head, b"hhea": hhea, b"hmtx": hmtx,
b"loca": loca, b"maxp": maxp, b"name": name, b"post": post}
n = len(tables)
out = struct.pack(">IHHHH", 0x00010000, n, 128, 3, n * 16 - 128)
offset = 12 + 16 * n
body = b""
for tag in sorted(tables):
data = tables[tag]
out += struct.pack(">4sIII", tag, _checksum(data), offset + len(body), len(data))
body += _pad(data)
font = bytearray(out + body)
head_at = offset + sum(len(_pad(tables[t])) for t in sorted(tables) if t < b"head") + 8
struct.pack_into(">I", font, head_at, (0xB1B0AFBA - _checksum(bytes(font))) & 0xFFFFFFFF)
return bytes(font)
#: The sha256 of canary_font(): a font that changed is a different poison, said here and held by a test.
CANARY_SHA256 = "fc1a766e6253f2791fb422f241db7e14a9793a8975ebd867c13e1257110e4045"
def canary_sha256() -> str:
return hashlib.sha256(canary_font()).hexdigest()
def read_tables(font: bytes) -> dict:
"""{tag: bytes} of an sfnt, after checking the directory's checksums and the whole-file checksum (head.checkSumAdjustment)."""
n = struct.unpack_from(">H", font, 4)[0]
tables = {}
for i in range(n):
tag, csum, off, length = struct.unpack_from(">4sIII", font, 12 + 16 * i)
data = font[off:off + length]
if tag != b"head" and _checksum(data) != csum:
raise ValueError("table %r: bad checksum" % tag)
tables[tag.decode("latin-1")] = data
if _checksum(font) != 0xB1B0AFBA:
raise ValueError("the whole-file checksum is not the one head.checkSumAdjustment makes")
return tables
# -
# What the page reads: the probe lives in the page (host_gate_page.html, between the two markers) and the control evaluates the same text.
PROBE_BEGIN, PROBE_END = "// ab.poison:begin", "// ab.poison:end"
def probe_source(page: Path = PAGE) -> str:
"""The probe function of the page, `const abPoisonProbe = async () => {...};`, exactly as the page runs it."""
text = page.read_text(encoding="utf-8")
if text.count(PROBE_BEGIN) != 1 or text.count(PROBE_END) != 1 or text.index(PROBE_BEGIN) > text.index(PROBE_END):
raise SystemExit("%s must hold the probe between one %r and one %r" % (page.name, PROBE_BEGIN, PROBE_END))
return text.split(PROBE_BEGIN, 1)[1].split(PROBE_END, 1)[0]
# -
# The engine under the poison: what its dumps must say instead.
def declared(seed: int, reference=None, dpr: float = 1.0) -> dict:
"""What the identity of `seed` declares for each poisoned value: from the core's prefs of the seed (the dark scheme, the audio chain) and
from the retail reference of the host gate (the zone and the language the launch declares, the strings they make)."""
import ci_host_gate as gate
import persona_cover as personas
prefs = {k: json.loads(v) for k, v in personas.seed_features(seed)[1].items()}
intl = gate.reference_items(reference or gate.REFERENCE, dpr)["surface.intl"]
return {"timezone": intl["DateTimeFormat"]["timeZone"], "offsets": intl["offsets"], "locale": intl["DateTimeFormat"]["locale"],
"language": intl["languages"][0], "date_full": intl["strings"][4], "number": intl["strings"][3],
"dark": bool(prefs["ui.systemUsesDarkTheme"]),
"sample_rate": prefs[personas.P + "audio.sample_rate"], "max_channels": prefs[personas.P + "audio.max_channel_count"]}
def _is_canary_width(width) -> bool:
return isinstance(width, (int, float)) and abs(width - CANARY_TEXT_WIDTH) < 0.5
def findings(probe, want: dict) -> list:
"""What an engine's `ab.poison` leaves say about the host, against `want` (declared()): every line is a value that is the machine's
(or that is not what the persona declares), empty when the page read none of the poison. A page that dumped no probe is a finding too:
it would pass anything."""
if not isinstance(probe, dict) or not probe:
return ["the dump has no ab.poison leaves: the page did not read the poison, so nothing was checked"]
out = []
def expect(key, value, what):
if probe.get(key) != value:
out.append("%s: the page read %s, the identity declares %s" % (what, json.dumps(probe.get(key)), json.dumps(value)))
expect("timezone", want["timezone"], "time zone")
expect("offsets", want["offsets"], "UTC offsets of January and July")
if probe.get("offsets") == LIMA_OFFSETS and want["offsets"] != LIMA_OFFSETS:
out.append("time zone: the offsets are the host's Lima (UTC-5, no DST)")
expect("language", want["language"], "navigator.language")
expect("intl_locale", want["locale"], "the default Intl locale")
expect("date_full", want["date_full"], "a full date")
expect("number", want["number"], "a formatted number")
expect("dark", want["dark"], "prefers-color-scheme dark")
canary = probe.get("canary")
if not isinstance(canary, dict) or "present" not in canary:
out.append("canary font: the probe did not measure it")
elif canary["present"]:
out.append("canary font: a page measures the user-installed family %s (its text is %s wide, a fallback's %s)"
% (FAMILY, json.dumps(canary.get("with")), json.dumps(canary.get("without"))))
generic = probe.get("generic")
if not isinstance(generic, list) or len(generic) != len(GENERICS):
out.append("generic families: the probe did not measure them: %s" % json.dumps(generic))
else:
out += ["generic family %s: a page measures %s wide, the canary's width: the host's fontconfig chose it" % (g, w)
for g, w in zip(GENERICS, generic) if _is_canary_width(w)]
audio = probe.get("audio")
if not isinstance(audio, dict):
out.append("audio: the probe did not read the audio context: %s" % json.dumps(audio))
else:
if audio.get("sampleRate") != want["sample_rate"]:
out.append("audio: sampleRate %s, the persona declares %s" % (audio.get("sampleRate"), want["sample_rate"]))
if audio.get("maxChannelCount") != want["max_channels"]:
out.append("audio: maxChannelCount %s, the persona declares %s" % (audio.get("maxChannelCount"), want["max_channels"]))
return out
def dump_findings(dump: dict, wants: Callable = declared) -> list:
"""findings() of every visit of a packed dump (ci_ab_oracle.pack), as 'seed N dprD: line'."""
out = []
for visit in dump.get("visits", []):
probe = visit["items"].get("ab.poison")
out += ["seed %d dpr %s: %s" % (visit["seed"], visit["dpr"], line) for line in findings(probe, wants(visit["seed"]))]
return out
# -
# The by-product: what the published engine reads from the host that the poison changes.
#
# The same job dumps the published engine on the CLEAN runner (before the poison is applied) and, in the oracle's own run, on the POISONED one,
# the same seeds. Every leaf that differs is a host dependency the published engine ALREADY has: not a failure of the candidate and never red,
# a finding, kept in a file of its own and summarised in the job's summary.
def clean_file(engine_tag: str) -> str:
"""poison-clean-70.json for firefox-70: the published engine's dump on the clean runner (ci_ab_oracle.clean_name). The tag is the one the published set carries."""
return "poison-clean-%s.json" % engine_tag.rsplit("-", 1)[-1]
def dependence_file(engine_tag: str) -> str:
return "poison-host-dependence-%s.json" % engine_tag.rsplit("-", 1)[-1]
DEPENDENCE_FORMAT = "poison-host-dependence/1"
CLIP = 300
def _clip(value):
text = json.dumps(value, sort_keys=True, ensure_ascii=False)
return value if len(text) <= CLIP else {"clipped": text[:CLIP], "len": len(text)}
def host_dependence(clean: dict, poisoned: dict) -> dict:
"""The leaves of the published engine that differ between its dump on the clean runner and on the poisoned one (both packed dumps,
ci_ab_oracle.pack), over the visits both have: {"visits", "missing", "leaves_compared", "differences": [{seed, dpr, leaf, clean, poisoned}]}."""
import ci_host_gate as gate
def by_visit(dump):
return {(v["dpr"], v["seed"]): {k: x for k, x in gate.leaves(v["items"]).items() if not gate.is_diag(k)} for v in dump.get("visits", [])}
a, b = by_visit(clean), by_visit(poisoned)
both = sorted(set(a) & set(b), key=lambda k: (k[1], k[0]))
differences, compared = [], 0
for dpr, seed in both:
for leaf in sorted(set(a[(dpr, seed)]) | set(b[(dpr, seed)])):
compared += 1
x, y = a[(dpr, seed)].get(leaf, "<missing>"), b[(dpr, seed)].get(leaf, "<missing>")
if x != y:
differences.append({"seed": seed, "dpr": dpr, "leaf": leaf, "clean": _clip(x), "poisoned": _clip(y)})
return {"format": DEPENDENCE_FORMAT, "visits": ["seed %d dpr %s" % (s, d) for d, s in both],
"missing": ["seed %d dpr %s" % (s, d) for d, s in sorted(set(a) ^ set(b), key=lambda k: (k[1], k[0]))],
"leaves_compared": compared, "differences": differences}
def dependence_markdown(report: dict | None) -> str:
"""The summary section of the job: the count, the leaves by family and the first few with both values."""
lines = ["### Host dependencies of the published engine (clean runner against poisoned runner)", ""]
if report is None:
return "\n".join(lines + ["No dump of the published engine on the clean runner: the step before the poison did not write one, "
"so the by-product is not available in this run.", ""])
diffs = report["differences"]
lines.append("%d of %d leaves differ over %d visits (%s). Each is a value the engine read from the host that the poison changed: "
"a finding about the published engine, not a failure of the candidate." % (len(diffs), report["leaves_compared"], len(report["visits"]),
", ".join(report["visits"]) or "none"))
if report["missing"]:
lines.append("Visits that only one of the two dumps has: %s." % ", ".join(report["missing"]))
families = {}
for d in diffs:
families[".".join(d["leaf"].split(".")[:2])] = families.get(".".join(d["leaf"].split(".")[:2]), 0) + 1
if families:
lines += ["", "| family | leaves |", "|---|---|"] + ["| %s | %d |" % kv for kv in sorted(families.items(), key=lambda kv: (-kv[1], kv[0]))[:30]]
lines += ["", "| seed | leaf | clean | poisoned |", "|---|---|---|---|"]
for d in diffs[:40]:
lines.append("| %s | %s | %s | %s |" % (d["seed"], d["leaf"], json.dumps(d["clean"], ensure_ascii=False)[:80].replace("|", "/"),
json.dumps(d["poisoned"], ensure_ascii=False)[:80].replace("|", "/")))
return "\n".join(lines + [""])
def write_dependence(out: Path, summary: Path | None = None, engine_tag: str | None = None) -> dict | None:
"""Write the dependence file in `out` from the clean dump and the published engine's dump there (named for `engine_tag`, by default the tag the published set carries),
and the markdown to `summary` (the job's $GITHUB_STEP_SUMMARY). Returns the report, or None when there is no clean dump. Never a verdict."""
import ci_ab_oracle as oracle
engine_tag = engine_tag or oracle.default_tag()
clean, poisoned = out / clean_file(engine_tag), out / oracle.dump_name(engine_tag)
report = None
if clean.is_file() and poisoned.is_file():
report = host_dependence(json.loads(clean.read_text(encoding="utf-8")), json.loads(poisoned.read_text(encoding="utf-8")))
(out / dependence_file(engine_tag)).write_text(json.dumps(report, sort_keys=True, ensure_ascii=False), encoding="utf-8")
text = dependence_markdown(report)
if summary:
with open(summary, "a", encoding="utf-8", newline="\n") as f:
f.write(text + "\n")
print(text)
return report
# -
# The negative control: what stock Firefox must read on the poisoned runner.
#: The requirements of the control: what stock Firefox must read of the poison on the poisoned runner, or the control is broken.
REQUIRED = ("timezone", "dark", "canary", "audio", "generic", "language")
#: IN TRIAL: requirements whose reading by stock Firefox is not yet shown on GitHub. They are still measured and printed (poison-control.json, "in_trial",
#: and the job summary), never silently, but they do not make the control broken until a run shows that stock reads them. {requirement: the systems where
#: it is in trial}. Empty since the two causes of run 45026082150 were taken away (the theme pref of Playwright's cfg, see reference_firefox; the per-user
#: font, now machine-wide); a requirement that a run shows unread goes back here, never silently dropped.
IN_TRIAL: dict = {}
def in_trial(requirement: str, system: str) -> bool:
return system in IN_TRIAL.get(requirement, ())
def control_failures(probe, system: str) -> list:
"""[(requirement, message)] of what stock Firefox did NOT read of the poison and must have. `system` is 'linux' or 'windows' (audio is Linux's)."""
if not isinstance(probe, dict):
return [("probe", "the probe returned %s" % json.dumps(probe))]
return [(name, message) for name, message in _control_misses(probe, system) if name in REQUIRED and not in_trial(name, system)]
def _control_misses(probe: dict, system: str) -> list:
"""Every requirement stock Firefox did not read, whether required, in trial or neither."""
out = []
if probe.get("offsets") != LIMA_OFFSETS:
out.append(("timezone", "stock Firefox read the offsets %s, not Lima's %s" % (json.dumps(probe.get("offsets")), LIMA_OFFSETS)))
if not language_reads(probe)["japanese"]:
out.append(("language", "stock Firefox read no Japanese language, date or number format: %s" % json.dumps(language_reads(probe)["reads"], ensure_ascii=False)))
if probe.get("dark") is not True:
out.append(("dark", "stock Firefox read prefers-color-scheme dark = %s" % json.dumps(probe.get("dark"))))
canary = probe.get("canary")
if not isinstance(canary, dict) or canary.get("present") is not True:
out.append(("canary", "stock Firefox did not measure the user-installed family %s: %s" % (FAMILY, json.dumps(canary))))
if system == "linux":
generic = probe.get("generic")
if not isinstance(generic, list) or not generic or not all(_is_canary_width(w) for w in generic):
out.append(("generic", "stock Firefox measured the generic families %s, not the canary's %s: the user's fonts.conf was not read"
% (json.dumps(generic), CANARY_TEXT_WIDTH)))
audio = probe.get("audio")
if not isinstance(audio, dict) or audio.get("sampleRate") != SINK_RATE:
out.append(("audio", "stock Firefox read the audio %s, not the null sink's %d Hz" % (json.dumps(audio), SINK_RATE)))
return out
def control_trials(probe, system: str) -> list:
"""[(requirement, message)] of the requirements IN TRIAL that stock Firefox did not read: measured and told, never a verdict."""
if not isinstance(probe, dict):
return []
every = _control_misses(probe, system)
return [(name, message) for name, message in every if in_trial(name, system)]
def language_reads(probe) -> dict:
"""What stock read of the language, for the log: the leaves and whether any of them is Japanese."""
keys = ("language", "languages", "intl_locale", "date_full", "number")
reads = {k: probe.get(k) for k in keys} if isinstance(probe, dict) else {}
text = json.dumps(reads, ensure_ascii=False)
return {"reads": reads, "japanese": bool(re.search(r'"ja\b|"ja-|[぀-ヿ一-鿿]', text))}
def control_markdown(report: dict) -> str:
"""The control's section of the job summary: what stock Firefox read, the broken requirements, and the ones in trial that it did not read."""
lines = ["### Negative control (stock Firefox of Playwright on the poisoned %s runner)" % report["system"], "",
"Verdict: **%s**." % report["verdict"]]
lines += ["- BROKEN (%s): %s" % (f["requirement"], f["message"]) for f in report["failures"]]
trial = report["in_trial"]
lines.append("In trial (measured, not required): %s." % (", ".join("%s on %s" % (k, "/".join(v)) for k, v in sorted(trial["requirements"].items())) or "none"))
lines += ["- not read, in trial (%s): %s" % (f["requirement"], f["message"]) for f in trial["not_read"]]
if not trial["not_read"]:
lines.append("- every requirement in trial was read")
return "\n".join(lines) + "\n\n"
def system_name() -> str:
return "windows" if sys.platform == "win32" else "linux"
#: What Playwright's Firefox forces in its own playwright.cfg that the poison is about: a pref, set before anything reads the host, answers the scheme
#: whatever the system says (widget/nsXPLookAndFeel.cpp GetIntValue reads the pref first, NativeGetInt after). The reference is a Firefox WITHOUT it.
CFG_DARK_PREF = "ui.systemUsesDarkTheme"
def reference_firefox(executable: str, dest: Path) -> tuple:
"""A copy of Playwright's own Firefox in `dest` whose playwright.cfg does not force the colour scheme; returns (path of its executable,
[the lines taken out]). The copy is the same build with the same other prefs: only the pref that overrides the system's theme is gone, so the
reference is a Firefox that reads the machine. Raises when the cfg is not where Playwright puts it or has no such line (the reference would not
be what it is said to be)."""
import shutil
source = Path(executable).resolve().parent
shutil.copytree(source, dest / source.name, symlinks=True)
root = dest / source.name
cfgs = sorted(root.glob("playwright.cfg")) or sorted(root.rglob("playwright.cfg"))
if not cfgs:
raise RuntimeError("Playwright's Firefox has no playwright.cfg under %s: the reference cannot be made" % source.name)
removed, kept = [], []
text = cfgs[0].read_bytes().decode("utf-8")
for line in text.splitlines(keepends=True):
if re.match(r"\s*(pref|lockPref|defaultPref)\(\"%s\"" % re.escape(CFG_DARK_PREF), line):
removed.append(line.strip())
else:
kept.append(line)
if not removed:
raise RuntimeError("playwright.cfg does not force %s: the reference was expected to differ from it" % CFG_DARK_PREF)
cfgs[0].write_bytes("".join(kept).encode("utf-8"))
return str(root / Path(executable).name), removed
def control(out: Path, headless: bool = False) -> int:
"""Launch Playwright's own Firefox (headed: a headless Firefox has no theme to read) on this runner, read the probe, write `out`.
0 when it read the poison, 2 BROKEN CONTROL (the poison is not in force or the control cannot see it)."""
from playwright.sync_api import sync_playwright
out.parent.mkdir(parents=True, exist_ok=True)
probe = None
error = None
removed = []
try:
import tempfile
with sync_playwright() as p, tempfile.TemporaryDirectory(prefix="poison-control-", ignore_cleanup_errors=True) as work:
executable, removed = reference_firefox(p.firefox.executable_path, Path(work))
browser = p.firefox.launch(executable_path=executable, headless=headless, firefox_user_prefs={"intl.regional_prefs.use_os_locales": True})
try:
# Playwright's default is a LIGHT scheme (an emulation): the control must follow the system, as a user's browser does
page = browser.new_context(color_scheme="no-override").new_page()
page.goto("about:blank")
probe = page.evaluate("(async () => {%s; return await abPoisonProbe(); })()" % probe_source())
finally:
browser.close()
except Exception as e: # noqa: BLE001 - a control that could not run is a broken control, with the reason
error = "%s: %s" % (type(e).__name__, str(e)[:500])
failures = [("run", error)] if error else control_failures(probe, system_name())
trials = control_trials(probe, system_name())
report = {"format": "poison-control/1", "system": system_name(), "probe": probe, "language": language_reads(probe),
"failures": [{"requirement": n, "message": m} for n, m in failures], "verdict": "green" if not failures else "broken",
"in_trial": {"requirements": {k: list(v) for k, v in IN_TRIAL.items()}, "not_read": [{"requirement": n, "message": m} for n, m in trials]},
"reference": {"taken_out_of_playwright_cfg": removed}}
out.write_text(json.dumps(report, sort_keys=True, indent=1, ensure_ascii=False), encoding="utf-8")
print("stock Firefox read: %s" % json.dumps(probe, sort_keys=True, ensure_ascii=False))
print("language, informational: %s" % json.dumps(report["language"], sort_keys=True, ensure_ascii=False))
for name, message in failures:
print("BROKEN CONTROL (%s): %s" % (name, message))
for name, message in trials:
print("IN TRIAL, not required (%s): %s" % (name, message))
summary = os.environ.get("GITHUB_STEP_SUMMARY")
if summary:
with open(summary, "a", encoding="utf-8", newline="\n") as f:
f.write(control_markdown(report))
print("POISON CONTROL %s" % ("OK" if not failures else "BROKEN"))
return 0 if not failures else 2
# -
# Putting the poison on a machine, and taking it off.
def _run(cmd: list) -> tuple:
try:
done = subprocess.run(cmd, capture_output=True, text=True, encoding="utf-8", errors="replace", timeout=180)
except (OSError, subprocess.SubprocessError) as e: # the program is not on this machine, or did not answer
return 127, "%s: %s" % (type(e).__name__, e)
return done.returncode, (done.stdout or "") + (done.stderr if done.returncode else "")
#: Every PowerShell of this script: the invariant culture on its own thread first (the culture of the machine is what the poison changes).
PS_PRELUDE = ("[System.Threading.Thread]::CurrentThread.CurrentCulture = [System.Globalization.CultureInfo]::InvariantCulture; "
"$ErrorActionPreference = 'Stop'; ")
def ps(script: str) -> list:
return ["powershell.exe", "-NoProfile", "-NonInteractive", "-ExecutionPolicy", "Bypass", "-Command", PS_PRELUDE + script]
def _ok(run: Run, cmd: list, what: str) -> str:
rc, text = run(cmd)
if rc != 0:
raise SystemExit("the poison could not %s (exit %s): %s" % (what, rc, text.strip()[:400]))
return text.strip()
def _try(run: Run, cmd: list) -> str:
rc, text = run(cmd)
return text.strip() if rc == 0 else ""
def font_path_windows(env=None) -> Path:
"""Where the canary goes on Windows: the Fonts folder of the system, which every user and every process reads (HKLM lists it, FONTS_KEY)."""
env = env or os.environ
return Path(env.get("SystemRoot") or env.get("WINDIR") or "C:" + chr(92) + "Windows") / "Fonts" / FONT_FILE
def font_dir_linux(env=None) -> Path:
env = env or os.environ
base = env.get("XDG_DATA_HOME") or str(Path(env.get("HOME") or Path.home()) / ".local" / "share")
return Path(base) / "fonts"
def _reg_get(name: str) -> list:
return ps("$v = (Get-ItemProperty -Path '%s' -Name %s -ErrorAction SilentlyContinue).%s; if ($null -ne $v) { $v }" % (THEME_KEY, name, name))
def _reg_set(name: str, value) -> list:
if value in ("", None):
return ps("Remove-ItemProperty -Path '%s' -Name %s -ErrorAction SilentlyContinue" % (THEME_KEY, name))
return ps("New-ItemProperty -Path '%s' -Name %s -Value %s -PropertyType DWord -Force | Out-Null" % (THEME_KEY, name, int(value)))
def apply_windows(run: Run = _run, font_dir: Path | None = None) -> dict:
"""Put the poison on this Windows machine; returns the state `undo_windows` needs (what was there before, as text read before any change)."""
font = font_path_windows() if font_dir is None else Path(font_dir) / FONT_FILE
state = {"system": "windows", "font": str(font),
"timezone": _ok(run, ["tzutil", "/g"], "read the time zone"),
"culture": _ok(run, ps("(Get-Culture).Name"), "read the culture"),
"languages": _ok(run, ps("(Get-WinUserLanguageList | ForEach-Object { $_.LanguageTag }) -join ','"), "read the user languages"),
"theme": {n: _try(run, _reg_get(n)) for n in ("AppsUseLightTheme", "SystemUsesLightTheme")}}
_ok(run, ["tzutil", "/s", WINDOWS_ZONE], "set the time zone")
_ok(run, ps("Set-Culture -CultureInfo '%s'" % CULTURE), "set the culture")
_ok(run, ps("Set-WinUserLanguageList -LanguageList '%s' -Force" % CULTURE), "set the user language list")
for name in state["theme"]:
_ok(run, _reg_set(name, 0), "set " + name)
font.parent.mkdir(parents=True, exist_ok=True)
font.write_bytes(canary_font())
_ok(run, ps("New-ItemProperty -Path '%s' -Name '%s' -Value '%s' -PropertyType String -Force | Out-Null" % (FONTS_KEY, FONT_VALUE, font)),
"register the canary font")
_announce_font(str(font))
state["after"] = windows_reads(run)
return state
def primary_language(tag: str) -> str:
"""The language of a tag, whatever its form: 'ja', 'ja-JP' and 'ja_JP' are Japanese."""
return re.split(r"[-_]", (tag or "").strip(), maxsplit=1)[0].lower()
def windows_reads(run: Run = _run) -> dict:
"""What this Windows machine reports about the poison, in the form it reports it (Windows keeps the tag 'ja' for the list that was set from
'ja-JP'): the apply records it and verify holds the machine to it later, besides the semantic check that it is Japanese."""
return {"timezone": _try(run, ["tzutil", "/g"]),
"culture": _try(run, ps("(Get-Culture).Name")),
"languages": _try(run, ps("(Get-WinUserLanguageList | ForEach-Object { $_.LanguageTag }) -join ','")),
"theme": {n: _try(run, _reg_get(n)) for n in ("AppsUseLightTheme", "SystemUsesLightTheme")}}
def _announce_font(path: str) -> None:
"""Tell the running session about the font (AddFontResourceW and WM_FONTCHANGE); a process started later reads the registry anyway."""
try:
import ctypes
ctypes.windll.gdi32.AddFontResourceW(path)
ctypes.windll.user32.SendMessageTimeoutW(0xFFFF, 0x001D, 0, 0, 2, 1000, None)
except Exception: # noqa: BLE001 - best effort: the registry entry is what a new process reads
pass
def _forget_font(path: str) -> None:
try:
import ctypes
ctypes.windll.gdi32.RemoveFontResourceW(path)
except Exception: # noqa: BLE001 - best effort, as the announcement
pass
def undo_windows(state: dict, run: Run = _run) -> None:
font = Path(state["font"])
_try(run, ps("Remove-ItemProperty -Path '%s' -Name '%s' -ErrorAction SilentlyContinue" % (FONTS_KEY, FONT_VALUE)))
_forget_font(str(font))
try:
font.unlink()
except OSError:
pass
for name, value in state["theme"].items():
_try(run, _reg_set(name, value))
if state.get("languages"):
_try(run, ps("Set-WinUserLanguageList -LanguageList %s -Force" % ",".join("'%s'" % t for t in state["languages"].split(","))))
if state.get("culture"):
_try(run, ps("Set-Culture -CultureInfo '%s'" % state["culture"]))
if state.get("timezone"):
_try(run, ["tzutil", "/s", state["timezone"]])
def verify_windows(run: Run = _run, state: dict | None = None) -> list:
problems = []
font = Path(state["font"]) if state else font_path_windows()
tz = _try(run, ["tzutil", "/g"])
if tz != WINDOWS_ZONE:
problems.append("time zone is %r, not %r" % (tz, WINDOWS_ZONE))
reads = windows_reads(run)
recorded = (state or {}).get("after") or {}
for what, value in (("culture", reads["culture"]), ("first user language", reads["languages"].split(",")[0])):
if primary_language(value) != primary_language(CULTURE):
problems.append("the %s is %r, which is not Japanese" % (what, value))
for key, what in (("culture", "culture"), ("languages", "user language list")):
if recorded.get(key) and reads[key] != recorded[key]:
problems.append("the %s is %r, the apply recorded %r" % (what, reads[key], recorded[key]))
for name in ("AppsUseLightTheme", "SystemUsesLightTheme"):
value = _try(run, _reg_get(name))
if value != "0":
problems.append("%s is %r, not 0 (dark)" % (name, value))
registered = _try(run, ps("(Get-ItemProperty -Path '%s' -Name '%s' -ErrorAction SilentlyContinue).'%s'" % (FONTS_KEY, FONT_VALUE, FONT_VALUE)))
if os.path.normcase(registered) != os.path.normcase(str(font)):
problems.append("the canary font is registered at %r, not %r" % (registered, str(font)))
problems += _font_file_problems(font)
return problems
def _font_file_problems(font: Path) -> list:
if not font.is_file():
return ["the canary font file %s is missing" % font.name]
if hashlib.sha256(font.read_bytes()).hexdigest() != CANARY_SHA256:
return ["the canary font file is not the canary (sha256 differs from %s)" % CANARY_SHA256]
return []
def _sudo(cmd: list) -> list:
return cmd if getattr(os, "geteuid", lambda: 0)() == 0 else ["sudo", "-n"] + cmd
def _sink_server(info: str) -> str:
m = re.search(r"^Server String:\s*(\S+)", info, re.M)
return m.group(1) if m else ""
def fonts_conf() -> str:
"""The user's fontconfig file of the Linux poison: the canary is the first choice of the three generic families, and the rendering
settings are ones no desktop has (no antialiasing, full hinting, rgb subpixels, the light LCD filter). The engine's default FcConfig is
still the host's (FcConfigSubstitute(nullptr, ...) in gfxFcPlatformFontList and ScaledFontFontconfig), so a page that reads what this
changes read the host."""
aliases = "".join(' <alias binding="strong"><family>%s</family><prefer><family>%s</family></prefer></alias>\n' % (g, FAMILY) for g in GENERICS)
return ('<?xml version="1.0"?>\n<!DOCTYPE fontconfig SYSTEM "fonts.dtd">\n<fontconfig>\n' + aliases
+ ' <match target="font">\n'
' <edit name="antialias" mode="assign"><bool>false</bool></edit>\n'
' <edit name="hinting" mode="assign"><bool>true</bool></edit>\n'
' <edit name="hintstyle" mode="assign"><const>hintfull</const></edit>\n'
' <edit name="rgba" mode="assign"><const>rgb</const></edit>\n'
' <edit name="lcdfilter" mode="assign"><const>lcdlight</const></edit>\n'
' </match>\n</fontconfig>\n')
def fonts_conf_path(env=None) -> Path:
env = env or os.environ
base = env.get("XDG_CONFIG_HOME") or str(Path(env.get("HOME") or Path.home()) / ".config")
return Path(base) / "fontconfig" / "fonts.conf"
def apply_linux(run: Run = _run, font_dir: Path | None = None, audio: bool = True, conf_file: Path | None = None) -> dict:
"""Put the poison on this Linux machine; returns the state `undo_linux` needs. The environment part is for the later steps of the job
(state["env"], appended to $GITHUB_ENV by `apply`)."""
fonts = font_dir_linux() if font_dir is None else Path(font_dir)
state = {"system": "linux", "font": str(fonts / FONT_FILE), "env": dict(LINUX_ENV),
"before_env": {k: os.environ.get(k, "") for k in list(LINUX_ENV) + ["PULSE_SERVER"]}, "module": ""}
if "ja_jp.utf8" not in _try(run, ["locale", "-a"]).lower().replace("-", ""):
_ok(run, _sudo(["locale-gen", LINUX_LANG]), "generate the %s locale" % LINUX_LANG)
fonts.mkdir(parents=True, exist_ok=True)
(fonts / FONT_FILE).write_bytes(canary_font())
conf = fonts_conf_path() if conf_file is None else Path(conf_file)
state["fonts_conf"] = {"path": str(conf), "before": conf.read_text(encoding="utf-8") if conf.is_file() else None}
conf.parent.mkdir(parents=True, exist_ok=True)
conf.write_text(fonts_conf(), encoding="utf-8", newline="\n")
_ok(run, ["fc-cache", "-f", str(fonts)], "refresh the font cache")
if audio:
_try(run, ["pulseaudio", "--daemonize=yes", "--exit-idle-time=-1", "--disallow-exit"])
module = _ok(run, ["pactl", "load-module", "module-null-sink", "sink_name=" + SINK, "rate=%d" % SINK_RATE,
"channels=%d" % SINK_CHANNELS, "channel_map=" + SINK_MAP, "sink_properties=device.description=" + SINK],
"load the null sink")
state["module"] = module
_ok(run, ["pactl", "set-default-sink", SINK], "make the null sink the default")
server = _sink_server(_try(run, ["pactl", "info"]))
if server:
state["env"]["PULSE_SERVER"] = server if "://" in server or ":" in server.split("/")[0] else "unix:" + server
return state
def undo_linux(state: dict, run: Run = _run) -> None:
if state.get("module"):
_try(run, ["pactl", "unload-module", state["module"]])
_try(run, ["pulseaudio", "--kill"])
font = Path(state["font"])
try:
font.unlink()
except OSError:
pass
saved = state.get("fonts_conf")
if saved: # the file that was there comes back, or the one this wrote goes
conf = Path(saved["path"])
try:
if saved["before"] is None:
conf.unlink()
else:
conf.write_text(saved["before"], encoding="utf-8", newline="\n")
except OSError:
pass
_try(run, ["fc-cache", "-f", str(font.parent)])
def verify_linux(run: Run = _run, state: dict | None = None, expect_env: bool = False, audio: bool = True, env=None) -> list:
problems = []
font = Path(state["font"]) if state else font_dir_linux() / FONT_FILE
if "ja_jp.utf8" not in _try(run, ["locale", "-a"]).lower().replace("-", ""):
problems.append("the %s locale is not installed" % LINUX_LANG)
problems += _font_file_problems(font)
if FAMILY not in _try(run, ["fc-list", ":", "family"]):
problems.append("fontconfig does not list the family %s" % FAMILY)
conf = Path(state["fonts_conf"]["path"]) if state and state.get("fonts_conf") else fonts_conf_path()
if not conf.is_file() or conf.read_text(encoding="utf-8") != fonts_conf():
problems.append("the user's fonts.conf is not the poison's")
for generic in GENERICS:
picked = _try(run, ["fc-match", "-f", "%{family}", generic])
if FAMILY not in picked:
problems.append("fontconfig answers %r for %s, not the canary" % (picked, generic))
if audio:
sinks = _try(run, ["pactl", "list", "short", "sinks"])
line = next((ln for ln in sinks.splitlines() if SINK in ln), "")
if "%dch %dHz" % (SINK_CHANNELS, SINK_RATE) not in line:
problems.append("the null sink %s is not %d channels at %d Hz: %r" % (SINK, SINK_CHANNELS, SINK_RATE, line))
if SINK not in _try(run, ["pactl", "get-default-sink"]):
problems.append("the null sink is not the default sink")
if expect_env:
e = os.environ if env is None else env
problems += ["%s is %r in this process, not %r" % (k, e.get(k), v) for k, v in LINUX_ENV.items() if e.get(k) != v]
if audio and not e.get("PULSE_SERVER"):
problems.append("PULSE_SERVER is not set in this process: Firefox would not find the null sink's server")
return problems
def verify_here(expect_env: bool = False, run: Run = _run) -> list:
"""Is the poison in force on this machine, for a process that wants to know (the page oracle's test): what apply wrote in the state file
named by AB_ORACLE_POISON_STATE tells where the font is and whether there is a null sink."""
state_file = os.environ.get(STATE_SWITCH)
state = json.loads(Path(state_file).read_text(encoding="utf-8")) if state_file and Path(state_file).is_file() else None
if system_name() == "windows":
return verify_windows(run, state)
return verify_linux(run, state, expect_env, audio=bool(state and state.get("audio")))
def github_env_lines(env: dict) -> str:
return "".join("%s=%s\n" % (k, v) for k, v in env.items())
def apply(state_file: Path | None, audio: bool = True, run: Run = _run) -> int:
system = system_name()
state = apply_windows(run) if system == "windows" else apply_linux(run, audio=audio)
state["audio"] = audio and system == "linux"
if state_file:
state_file.parent.mkdir(parents=True, exist_ok=True)
state_file.write_text(json.dumps(state, sort_keys=True, indent=1), encoding="utf-8")
target = os.environ.get("GITHUB_ENV")
if target and state_file: # what was changed must be undoable even when it is not in force: the undo step reads this
with open(target, "a", encoding="utf-8", newline="\n") as f:
f.write(github_env_lines({STATE_SWITCH: str(state_file.resolve())}))
problems = verify_windows(run, state) if system == "windows" else verify_linux(run, state, audio=state["audio"])
for p in problems:
print("POISON NOT IN FORCE: " + p)
if problems:
return 2
env = dict(state.get("env", {}), **{SWITCH: "1"})
if state_file:
env[STATE_SWITCH] = str(state_file.resolve())
if target:
with open(target, "a", encoding="utf-8", newline="\n") as f:
f.write(github_env_lines(env))
print("the host is poisoned (%s): %s" % (system, json.dumps({k: v for k, v in state.items() if k not in ("before_env",)}, sort_keys=True)))
return 0
def undo(state_file: Path, run: Run = _run) -> int:
state = json.loads(state_file.read_text(encoding="utf-8"))
if state["system"] == "windows":
undo_windows(state, run)
else:
undo_linux(state, run)
target = os.environ.get("GITHUB_ENV")
if target: # the later steps of the job read what it was
with open(target, "a", encoding="utf-8", newline="\n") as f:
f.write(github_env_lines(dict(state["before_env"], **{SWITCH: "", STATE_SWITCH: ""})))
print("the poison is taken off (%s)" % state["system"])
return 0
def main(argv=None) -> int:
ap = argparse.ArgumentParser(description=__doc__.split("\n")[0])
sub = ap.add_subparsers(dest="cmd", required=True)
a = sub.add_parser("apply")
a.add_argument("--state", type=Path)
a.add_argument("--no-audio", action="store_true", help="Linux: no null audio sink")
v = sub.add_parser("verify")
v.add_argument("--state", type=Path)
v.add_argument("--expect-env", action="store_true")
v.add_argument("--no-audio", action="store_true")
u = sub.add_parser("undo")
u.add_argument("--state", type=Path, required=True)
c = sub.add_parser("control")
c.add_argument("--out", type=Path, required=True)
c.add_argument("--headless", action="store_true")
f = sub.add_parser("font")
f.add_argument("--out", type=Path, required=True)
args = ap.parse_args(argv)
if args.cmd == "apply":
return apply(args.state, audio=not args.no_audio)
if args.cmd == "undo":
return undo(args.state)
if args.cmd == "control":
return control(args.out, args.headless)
if args.cmd == "font":
args.out.write_bytes(canary_font())
print(canary_sha256())
return 0
state = json.loads(args.state.read_text(encoding="utf-8")) if args.state else None
system = system_name()
problems = verify_windows(_run, state) if system == "windows" else verify_linux(_run, state, args.expect_env, not args.no_audio)
for p in problems:
print("POISON NOT IN FORCE: " + p)
return 2 if problems else 0
if __name__ == "__main__":
sys.exit(main())
+442
View File
@@ -0,0 +1,442 @@
#!/usr/bin/env python3
"""The PUBLISHED SET: the control side of every A/B oracle, exactly as a user installs it.
An A/B oracle holds a candidate against the engine published before it. That engine is not a binary alone: it is launched by the core that declares the prefs it
requires (the engine refuses a launch whose declarations are not the ones it was built for), and that core is the one the published wrapper pins. So the control
side is a SET, and nothing in it is chosen by hand: the last published `invisible-playwright` on PyPI pins its core exactly, and that core's seal pins its engine.
ci/py-lock/published.txt the set as a lock (ci-03): the wrapper and the core it pins, each at an exact version with the sha256 of EVERY file of that
version on the index, and the requirements each declares (the headers), which the gate's own lock must satisfy.
python scripts/ci_published_set.py resolve [--write] reads PyPI (the only command that does), prints the lock, or writes it
python scripts/ci_published_set.py check PyPI's last release against the committed lock: red when they differ (.github/workflows/published-set.yml)
python scripts/ci_published_set.py install --house DIR --venv DIR [--lock FILE]
OFFLINE and hash-checked: a venv of its own with the gate's third-party lock (DIR/lock.txt), then the two wheels of the set by their hashes
(`--no-deps`, from DIR/published: the wheelhouse of the run, whose job downloaded the files this lock names there). Prints the venv's python.
DIR itself holds the candidate's wheels of the same two packages (built from core_ref and wrapper_ref, and at an equal version with the SAME
file names): the set never takes a file of invisible-core or invisible-playwright from DIR, only from DIR/published.
python scripts/ci_published_set.py verify --python PY what that python imports is the lock's set, from its own venv and from nowhere else
python scripts/ci_published_set.py fetch --work DIR (run BY the set's python) fetches the engine the way a user's core does: its own seal
python scripts/ci_published_set.py tag (run BY the set's python) the tag its seal names
Exit codes: 0 green, 1 red (a finding), 2 the command could not run.
The candidate's side is untouched: its core is core_ref's, its wrapper is wrapper_ref's, its engine is the candidate.
"""
from __future__ import annotations
import argparse
import base64
import hashlib
import json
import os
import re
import subprocess
import sys
import urllib.request
import zipfile
from pathlib import Path
ROOT = Path(__file__).resolve().parent.parent
LOCK_PATH = ROOT / "ci" / "py-lock" / "published.txt"
GATE_LOCK_PATH = ROOT / "ci" / "py-lock" / "gate.txt"
#: Where the wheelhouse of the run keeps the two wheels of the published set (the wheelhouse's own folder holds the candidate's wheels of the same names).
PUBLISHED_DIR = "published"
#: What install writes in the venv: which wheel of each package it installed (file name, sha256) and the digest of every file of the package as that wheel holds it. verify reads it
#: and holds it to the lock and to the disk: the lock and the candidate's lock can name the same package at the same version, so a version says nothing of WHICH file is installed.
RECORD_FILE = "published-set.json"
RECORD_FORMAT = "published-set-installed/1"
WRAPPER = "invisible-playwright"
CORE = "invisible-core"
INDEX = "https://pypi.org/pypi"
HASH_RE = re.compile(r"^--hash=sha256:([0-9a-f]{64})$")
PIN_RE = re.compile(r"^([A-Za-z0-9][A-Za-z0-9._-]*)==([0-9][A-Za-z0-9.!+_-]*)$")
HEADER = ("The PUBLISHED SET, the control side of the A/B oracles (scripts/ci_published_set.py): the last published invisible-playwright and the invisible-core it pins "
"(its seal pins the engine). Written by `python scripts/ci_published_set.py resolve --write`; .github/workflows/published-set.yml keeps it equal to the index.")
#: What a process of the published set must not inherit from the candidate's job: anything that makes its python import another wrapper or another core, or run
#: another engine's seal. The set is what its venv holds, as it is on a user's machine.
SET_LEAKS = ("PYTHONPATH", "PYTHONHOME", "PYTHONSTARTUP", "PYTHONUSERBASE", "VIRTUAL_ENV", "INVISIBLE_SEAL_FILE", "INVISIBLE_CORE_PIN", "INVISIBLE_CORE_AUTOFIX",
"INVISIBLE_PLAYWRIGHT_ENGINE_DIR")
def norm(name: str) -> str:
return re.sub(r"[-_.]+", "-", name).lower()
# -
# The lock: text <-> parts (pure, no network)
def _release_parts(release: dict, name: str) -> tuple:
"""(version, [sha256 of every file], [requirements without extras]) of a PyPI release document (`/pypi/<name>/<version>/json`)."""
info = release.get("info") or {}
if norm(info.get("name") or "") != norm(name):
raise ValueError("the document is of %r, not %s" % (info.get("name"), name))
files = [f for f in release.get("urls") or [] if not f.get("yanked")]
hashes = sorted({(f.get("digests") or {}).get("sha256", "") for f in files})
if not files or not all(re.fullmatch(r"[0-9a-f]{64}", h) for h in hashes):
raise ValueError("%s %s has no file with a sha256 on the index" % (name, info.get("version")))
if not any(f.get("packagetype") == "bdist_wheel" for f in files):
raise ValueError("%s %s has no wheel on the index" % (name, info.get("version")))
requires = [r for r in (info.get("requires_dist") or []) if "extra ==" not in r]
return info["version"], hashes, requires
def core_pin_of(requires: list) -> str:
"""The version of `invisible-core==X` among the requirements of the wrapper; ValueError when there is not exactly one exact pin."""
pins = []
for r in requires:
m = re.fullmatch(r"\s*invisible[-_.]core\s*==\s*([0-9][A-Za-z0-9.!+_-]*)\s*(?:;.*)?", r)
if m:
pins.append(m.group(1))
if len(pins) != 1:
raise ValueError("the published wrapper does not pin invisible-core exactly once with `==` (it declares %s)" % (requires or "nothing"))
return pins[0]
def lock_text(wrapper_release: dict, core_release: dict) -> str:
version, hashes, requires = _release_parts(wrapper_release, WRAPPER)
core_version, core_hashes, core_requires = _release_parts(core_release, CORE)
pin = core_pin_of(requires)
if pin != core_version:
raise ValueError("%s %s pins invisible-core==%s but the core document is of %s" % (WRAPPER, version, pin, core_version))
others = [r for r in requires if not re.match(r"\s*invisible[-_.]core\b", r, re.I)]
out = ["# " + HEADER,
"# wrapper-requires: " + " | ".join(sorted(others)),
"# core-requires: " + " | ".join(sorted(core_requires))]
for name, v, hs in ((CORE, core_version, core_hashes), (WRAPPER, version, hashes)):
out.append("%s==%s \\" % (name, v))
out.append(" \\\n".join(" --hash=sha256:" + h for h in hs))
return "\n".join(out) + "\n"
def parse_lock(text: str) -> dict:
"""{"wrapper": (version, hashes), "core": (version, hashes), "wrapper_requires": [...], "core_requires": [...]}; ValueError names what is wrong.
Every entry is `name==version` with at least one sha256: no range, no URL, no entry without a hash."""
meta, entries, current = {}, {}, None
joined = text.replace("\\\n", " ")
for raw in joined.splitlines():
line = raw.strip()
if not line:
continue
m = re.match(r"^#\s*(wrapper-requires|core-requires):\s*(.*)$", line)
if m:
meta[m.group(1)] = [r.strip() for r in m.group(2).split(" | ") if r.strip()]
continue
if line.startswith("#"):
continue
parts = line.split()
pin = PIN_RE.match(parts[0])
if not pin:
raise ValueError("a line that is not `name==version --hash=sha256:...`: %r" % line[:80])
hashes = []
for p in parts[1:]:
h = HASH_RE.match(p)
if not h:
raise ValueError("%s: %r is not a --hash=sha256:<64 hex>" % (parts[0], p[:40]))
hashes.append(h.group(1))
if not hashes:
raise ValueError("%s has no hash: an entry without a hash is an unchecked install" % parts[0])
current = norm(pin.group(1))
if current in entries:
raise ValueError("%s is listed twice" % current)
entries[current] = (pin.group(2), sorted(hashes))
if sorted(entries) != sorted([CORE, WRAPPER]):
raise ValueError("the lock holds %s, it must hold exactly %s and %s" % (sorted(entries), CORE, WRAPPER))
for key in ("wrapper-requires", "core-requires"):
if key not in meta:
raise ValueError("the header line `# %s:` is missing" % key)
return {"wrapper": entries[WRAPPER], "core": entries[CORE], "wrapper_requires": meta["wrapper-requires"], "core_requires": meta["core-requires"]}
def locked_versions(gate_text: str) -> dict:
"""{normalized name: version} of the pinned entries of a lock (ci/py-lock/gate.txt)."""
out = {}
for line in gate_text.replace("\\\n", " ").splitlines():
m = PIN_RE.match(line.split()[0]) if line.strip() and not line.lstrip().startswith("#") else None
if m:
out[norm(re.sub(r"\[.*\]", "", m.group(1)))] = m.group(2)
return out
def problems_of_lock(parsed: dict, gate_text: str) -> list:
"""What makes the set not installable, offline, over the gate's lock: the wrapper's pin of the core is not the core in the lock, or a requirement of either is
not met by the third-party package the gate's lock holds (the venv of the set is the gate's lock plus these two wheels, `--no-deps`)."""
from packaging.requirements import Requirement # the gate lock installs it (pytest needs it); resolve/check do not come here
problems = []
try:
pin = core_pin_of(parsed["wrapper_requires"] + ["%s==%s" % (CORE, parsed["core"][0])])
if pin != parsed["core"][0]:
problems.append("the lock names core %s" % parsed["core"][0])
except ValueError as e:
problems.append(str(e))
held = locked_versions(gate_text)
for owner, requires in (("the published wrapper", parsed["wrapper_requires"]), ("the published core", parsed["core_requires"])):
for text in requires:
req = Requirement(text)
if req.marker is not None and not req.marker.evaluate({"extra": ""}):
continue
version = held.get(norm(req.name))
if version is None:
problems.append("%s requires %s: the gate's lock (ci/py-lock/gate.txt) does not hold it, so the set cannot be installed offline" % (owner, text))
elif not req.specifier.contains(version, prereleases=True):
problems.append("%s requires %s: the gate's lock holds %s==%s" % (owner, text, req.name, version))
return problems
# -
# The index (the only network here)
def fetch_json(url: str) -> dict:
request = urllib.request.Request(url, headers={"User-Agent": "ci-published-set"})
with urllib.request.urlopen(request, timeout=60) as response: # noqa: S310 - the index of the package, https
return json.loads(response.read().decode("utf-8"))
def resolve(get=fetch_json) -> str:
"""The lock of the last published set: PyPI's latest release of the wrapper, and the core that wrapper pins."""
latest = get("%s/%s/json" % (INDEX, WRAPPER))
version = (latest.get("info") or {}).get("version")
if not version:
raise ValueError("the index names no latest version of %s" % WRAPPER)
wrapper = get("%s/%s/%s/json" % (INDEX, WRAPPER, version))
pin = core_pin_of(_release_parts(wrapper, WRAPPER)[2])
return lock_text(wrapper, get("%s/%s/%s/json" % (INDEX, CORE, pin)))
def check(get=fetch_json, path: Path = LOCK_PATH) -> list:
"""[] when the committed lock is the index's last release; else the lines that say how it differs (and how to fix it)."""
committed = path.read_text(encoding="utf-8") if path.is_file() else ""
try:
wanted = resolve(get)
except (ValueError, OSError) as e:
return ["the index could not be read or is not what a release is: %s" % e]
if committed == wanted:
return []
old = parse_lock(committed) if committed else None
new = parse_lock(wanted)
now = "%s %s + %s %s" % (WRAPPER, new["wrapper"][0], CORE, new["core"][0])
was = "%s %s + %s %s" % (WRAPPER, old["wrapper"][0], CORE, old["core"][0]) if old else "nothing"
return ["%s holds %s but the index's last release is %s. Fix: python scripts/ci_published_set.py resolve --write, and commit it. "
"Rule: the control side of an A/B is the last published set" % (path.name, was, now)]
# -
# The venv of the set (offline) and what it must be
def venv_python(venv: Path) -> Path:
return venv / ("Scripts/python.exe" if os.name == "nt" else "bin/python")
def clean_env(extra: dict | None = None) -> dict:
env = {k: v for k, v in os.environ.items() if k not in SET_LEAKS}
env.update(extra or {})
return env
def install(house: Path, venv: Path, lock: Path = LOCK_PATH, run=subprocess.run) -> Path:
"""A venv of its own: the gate's third-party lock from the wheelhouse (`house/lock.txt`, the lock of the run), then the two wheels of the set by their hashes, from
`house/published` ONLY. Offline: `--no-index` and `--require-hashes` on both; the two are installed `--no-deps` because the first step holds everything they need.
The wheelhouse's own folder holds the candidate's wheels of invisible-core and invisible-playwright, built from core_ref and wrapper_ref; at an equal version they have
the file names of the published ones, so the published ones live in their own folder and are the only place the second step looks: a wheel of ours taken from the wheelhouse
would be the candidate's core in the control's venv, or a hash refused. pip never sees the wheelhouse's folder and `published/` in one call: with two `--find-links` it takes
the first local file of a name and fails on a hash mismatch, it does not choose by hash. Then `pip check` over the venv: red, with what pip reports, when a requirement of
the two wheels is not met."""
parse_lock(lock.read_text(encoding="utf-8")) # a lock that does not read is no install
house_lock = house / "lock.txt"
if not house_lock.is_file():
raise FileNotFoundError("the wheelhouse %s has no lock.txt (the gate's lock): it is not a py-deps wheelhouse" % house)
published = house / PUBLISHED_DIR
if not published.is_dir():
raise FileNotFoundError("the wheelhouse %s has no %s/ folder: the two wheels of the published set (the files ci/py-lock/published.txt names) are kept there, "
"apart from the candidate's wheels of the same names" % (house, PUBLISHED_DIR))
parsed = parse_lock(lock.read_text(encoding="utf-8"))
chosen = {name: published_wheel(published, name, *parsed[key]) for key, name in (("core", CORE), ("wrapper", WRAPPER))}
run([sys.executable, "-m", "venv", str(venv)], check=True)
python = str(venv_python(venv))
base = [python, "-m", "pip", "install", "--quiet", "--no-index", "--require-hashes"]
run(base + ["--find-links", str(house), "-r", str(house_lock)], check=True, env=clean_env())
run(base + ["--find-links", str(published), "--no-deps", "-r", str(lock)], check=True, env=clean_env())
# `--no-deps` installs the two wheels without looking at what they declare: pip check does, over the whole venv (the third-party lock and the two wheels).
checked = run([python, "-m", "pip", "check"], capture_output=True, text=True, env=clean_env())
if checked.returncode != 0:
raise RuntimeError("pip check of the published set's venv %s is red (the requirements of the published wheels are not met by the wheelhouse's dependencies): %s"
% (venv, (checked.stdout + checked.stderr).strip()[-1500:]))
write_record(venv, chosen)
return venv_python(venv)
def file_digest(data: bytes) -> str:
"""The digest of a file as a wheel's RECORD writes it: `sha256=<urlsafe base64, no padding>`."""
return "sha256=" + base64.urlsafe_b64encode(hashlib.sha256(data).digest()).rstrip(b"=").decode()
def published_wheel(published: Path, name: str, version: str, hashes: list) -> tuple:
"""(path, sha256) of the wheel of `name` `version` in `published` whose sha256 is one the lock holds. FileNotFoundError names what was there and what the lock holds."""
stem = name.replace("-", "_").lower() + "-" + version + "-"
seen = []
for path in sorted(published.glob("*.whl")):
if path.name.lower().startswith(stem):
sha = hashlib.sha256(path.read_bytes()).hexdigest()
if sha in hashes:
return path, sha
seen.append("%s sha256 %s" % (path.name, sha))
raise FileNotFoundError("%s %s: no wheel in %s has a sha256 the lock (ci/py-lock/published.txt) holds (%s); there %s"
% (name, version, published, ", ".join(hashes), "is " + "; ".join(seen) if seen else "is none of that name"))
def package_digests(wheel: Path, package: str) -> dict:
"""{path: digest} of every file of the package `package` in the wheel, taken from the bytes of the wheel (its RECORD is not believed)."""
with zipfile.ZipFile(wheel) as z:
return {n: file_digest(z.read(n)) for n in sorted(z.namelist()) if n.startswith(package + "/") and not n.endswith("/")}
def write_record(venv: Path, chosen: dict) -> Path:
"""`chosen` is {distribution: (wheel path, sha256)}: what was installed into `venv`, written where verify reads it."""
packages = {name: {"wheel": path.name, "sha256": sha, "files": package_digests(path, name.replace("-", "_"))} for name, (path, sha) in chosen.items()}
target = Path(venv) / RECORD_FILE
Path(venv).mkdir(parents=True, exist_ok=True)
target.write_text(json.dumps({"format": RECORD_FORMAT, "packages": packages}, sort_keys=True, indent=1) + "\n", encoding="utf-8", newline="\n")
return target
def installed_problems(prefix: str, parsed: dict, site_files: dict) -> list:
"""What the record of the venv `prefix` says was installed, against the lock and against the disk. `site_files` is {distribution: the folder that holds its package}.
A package the record names with a sha256 the lock does not hold is red, naming the file and both hashes; so is a file of the package that is not, byte for byte, the wheel's."""
path = Path(prefix) / RECORD_FILE
if not path.is_file():
return ["%s has no %s: nothing says which wheel of invisible-core and invisible-playwright was installed (install writes it); the same version can be a "
"different file (the candidate's wheels have the names of the published ones)" % (prefix, RECORD_FILE)]
record = json.loads(path.read_text(encoding="utf-8"))
problems = []
for key, name in (("core", CORE), ("wrapper", WRAPPER)):
entry = (record.get("packages") or {}).get(name)
if not entry:
problems.append("%s: the record of the venv does not name the wheel it installed" % name)
continue
lock_hashes = parsed[key][1]
if entry["sha256"] not in lock_hashes:
problems.append("%s: the file installed is %s with sha256 %s, and ci/py-lock/published.txt holds %s (the published set is %s %s)"
% (name, entry["wheel"], entry["sha256"], ", ".join(lock_hashes), name, parsed[key][0]))
for rel, digest in sorted(entry["files"].items()):
target = Path(site_files[name]) / rel
actual = file_digest(target.read_bytes()) if target.is_file() else "missing"
if actual != digest:
problems.append("%s: %s on disk is %s, the wheel %s (sha256 %s) holds %s" % (name, rel, actual, entry["wheel"], entry["sha256"], digest))
break
return problems
IDENTITY_CODE = """
import importlib.metadata as md, json, sys
import invisible_core, invisible_playwright
from invisible_core.seal import active_seal
seal = active_seal()
print(json.dumps({"prefix": sys.prefix, "core": md.version("invisible-core"), "core_version": invisible_core.__version__, "core_file": invisible_core.__file__,
"wrapper": md.version("invisible-playwright"), "wrapper_file": invisible_playwright.__file__, "seal_tag": seal.tag, "seal_local": seal.is_local}))
"""
def identity(python: str, run=subprocess.run) -> dict:
"""What `python` is when it imports the set: versions, files and the tag of the seal its core carries (read in isolated mode, with no variable of the job)."""
done = run([python, "-I", "-c", IDENTITY_CODE], capture_output=True, text=True, env=clean_env(), timeout=120)
if done.returncode != 0:
raise RuntimeError("%s could not import the published set (exit %s): %s" % (python, done.returncode, (done.stderr or done.stdout)[-800:]))
return json.loads(done.stdout.strip().splitlines()[-1])
def verify(python: str, lock: Path = LOCK_PATH, run=subprocess.run) -> list:
"""[] when `python` runs the lock's wrapper and the lock's core, both from its own prefix, under the seal its core was published with, and the files they are made of
are the wheels the lock's sha256 name (read from the record install wrote and from the disk, never assumed from the version)."""
parsed = parse_lock(lock.read_text(encoding="utf-8"))
ident = identity(python, run)
problems = []
if ident["wrapper"] != parsed["wrapper"][0] or not ident["wrapper_file"].startswith(ident["prefix"]):
problems.append("the wrapper it runs is %s from %s, the set says %s from its own venv" % (ident["wrapper"], ident["wrapper_file"], parsed["wrapper"][0]))
if ident["core"] != parsed["core"][0] or ident["core_version"] != parsed["core"][0] or not ident["core_file"].startswith(ident["prefix"]):
problems.append("the core it runs is %s (reports %s) from %s, the set says %s from its own venv"
% (ident["core"], ident["core_version"], ident["core_file"], parsed["core"][0]))
if ident["seal_local"]:
problems.append("its core runs under a local seal: a published core carries a release seal")
problems += installed_problems(ident["prefix"], parsed, {CORE: str(Path(ident["core_file"]).parent.parent), WRAPPER: str(Path(ident["wrapper_file"]).parent.parent)})
return problems
# -
# What the set's own python does (the commands below are run BY it: they import the published core)
def fetch(work: Path) -> dict:
"""The engine of the core this python has, fetched the way a user's core fetches it: its own seal, its own download, its own verification."""
from invisible_core import download
from invisible_core.seal import active_seal
work = Path(work)
os.environ[download.ENGINE_DIR_ENV] = str(work / "engines")
seal = active_seal()
binary = download.ensure_binary()
return {"binary": str(binary), "tag": seal.tag, "describe": seal.describe()}
def main(argv=None) -> int:
ap = argparse.ArgumentParser(description=__doc__.split("\n")[0])
sub = ap.add_subparsers(dest="cmd", required=True)
r = sub.add_parser("resolve")
r.add_argument("--write", action="store_true")
sub.add_parser("check")
i = sub.add_parser("install")
i.add_argument("--house", type=Path, required=True)
i.add_argument("--venv", type=Path, required=True)
i.add_argument("--lock", type=Path, default=LOCK_PATH)
v = sub.add_parser("verify")
v.add_argument("--python", required=True)
v.add_argument("--lock", type=Path, default=LOCK_PATH)
f = sub.add_parser("fetch")
f.add_argument("--work", type=Path, required=True)
sub.add_parser("tag")
args = ap.parse_args(argv)
try:
if args.cmd == "resolve":
text = resolve()
if args.write:
LOCK_PATH.write_text(text, encoding="utf-8", newline="\n")
print("wrote %s" % LOCK_PATH)
else:
sys.stdout.write(text)
return 0
if args.cmd == "check":
problems = check()
print("\n".join("FAIL " + p for p in problems) if problems else "OK the committed published set is the index's last release")
return 1 if problems else 0
if args.cmd == "install":
python = install(args.house, args.venv, args.lock)
problems = verify(str(python), args.lock)
for name, entry in sorted(json.loads((args.venv / RECORD_FILE).read_text(encoding="utf-8"))["packages"].items()):
print("installed %s: %s sha256 %s" % (name, entry["wheel"], entry["sha256"]), file=sys.stderr)
if problems:
print("\n".join("FAIL " + p for p in problems))
return 1
print(python)
return 0
if args.cmd == "verify":
problems = verify(args.python, args.lock)
print("\n".join("FAIL " + p for p in problems) if problems else "OK")
return 1 if problems else 0
if args.cmd == "fetch":
print(json.dumps(fetch(args.work)))
return 0
if args.cmd == "tag":
from invisible_core.seal import active_seal
print(active_seal().tag)
return 0
except (ValueError, OSError, RuntimeError, subprocess.CalledProcessError) as e:
print("ERROR %s: %s" % (type(e).__name__, e))
return 2
return 2
if __name__ == "__main__":
sys.exit(main())
+208
View File
@@ -0,0 +1,208 @@
#!/usr/bin/env python3
"""Writes ci/py-lock/gate.in from its sources and compiles ci/py-lock/gate.txt, the lock of the `gate` environment (ci-03).
The engine series' gate installs the wrapper's environment from a wheelhouse resolved once per image, Python and lock, offline: no unpinned `pip install`
anywhere. The lock of that environment lives HERE, because what it must cover is declared here and is read at the wrapper_ref the gate selects. It holds every
THIRD-PARTY distribution the gate installs from the wrapper:
* the wrapper's dependencies (`[project].dependencies` of pyproject.toml, without `invisible_core`, which is built as a wheel of ours) and its `dev` extra;
* the dependencies of the core the wrapper pins (`invisible_core==X`: the `[project].dependencies` of the core's pyproject.toml at the tag vX);
* playwright at scripts/playwright_pin.txt (the stock client the gate drives the engine with) and cryptography at CRYPTOGRAPHY (the lab's PKI);
* the installer the install-from-index job needs beside pytest (HARNESS: `uv`, which the release test installs the package with and the wait asks), so that
job installs its test harness from this lock and from nothing else (tests/test_the_install_job_has_every_module_its_tests_import.py).
One command regenerates both files after a dependency change or a bump of the core pin:
python scripts/ci_py_lock.py --core-pyproject <pyproject.toml of the core at the tag vX> [--exclude-newer 2026-11-25T00:00:00Z] [--uv uv]
The resolver is the series' (`uv pip compile --universal --generate-hashes --no-build`, every file of every version hashed), so the same input gives the same
bytes there and here. tests/test_the_gate_lock_follows_the_sources.py reads the committed files with this module, offline.
"""
from __future__ import annotations
import argparse
import hashlib
import re
import subprocess
import sys
import tempfile
import tomllib
from pathlib import Path
ROOT = Path(__file__).resolve().parent.parent
LOCK_DIR = ROOT / "ci" / "py-lock"
IN_PATH = LOCK_DIR / "gate.in"
TXT_PATH = LOCK_DIR / "gate.txt"
PYPROJECT = ROOT / "pyproject.toml"
PLAYWRIGHT_PIN = ROOT / "scripts" / "playwright_pin.txt"
#: What the lab's PKI needs, as the series' gate installs it today.
CRYPTOGRAPHY = "cryptography==44.0.3"
#: Installers the install-from-index job (user-install.yml) needs and no dependency of the wrapper brings: the README's way in (`uv`) and the wait on the index.
HARNESS = ["uv>=0.5"]
#: The floor of the lock: the Python the unit job judges; `--universal` covers every Linux and Windows wheel of every Python from it.
PYTHON_VERSION = "3.11"
DEFAULT_EXCLUDE_NEWER = "2026-11-25T00:00:00Z"
#: The separator of the core's requirements in a header line (a requirement can contain commas).
SEP = " | "
HASH_RE = re.compile(r"^--hash=sha256:[0-9a-f]{64}$")
PIN_RE = re.compile(r"^([A-Za-z0-9][A-Za-z0-9._-]*(?:\[[A-Za-z0-9,._-]+\])?)==([A-Za-z0-9][A-Za-z0-9.!+_-]*)(?: ; (.+))?$")
CORE_PIN_RE = re.compile(r"^invisible[-_]core==([0-9][0-9A-Za-z.!+_-]*)$")
def norm(name: str) -> str:
return re.sub(r"[-_.]+", "-", name).lower()
def base_name(requirement: str) -> str:
return norm(re.split(r"[\[<>=!~ ;]", requirement, maxsplit=1)[0])
def sha256_text(text: str) -> str:
"""sha256 of the text with LF line ends: the bytes the index stores, whatever a Windows checkout did to them."""
return hashlib.sha256(text.replace("\r\n", "\n").encode("utf-8")).hexdigest()
def read_in(text: str) -> dict:
"""The input file: `# key: value` header lines, then one requirement per line."""
meta, reqs = {}, []
for line in text.replace("\r\n", "\n").splitlines():
line = line.strip()
if not line:
continue
m = re.match(r"^#\s*([a-z-]+):\s*(.*)$", line)
if m:
meta[m.group(1)] = m.group(2).strip()
elif not line.startswith("#"):
reqs.append(line)
return {"meta": meta, "requirements": reqs}
def parse_lock(text: str) -> list:
"""[(name, version, marker, [hashes])] of a lock. A line that is not `name==version [; marker]` with hashes under it is an error: a range, a URL, an
editable, an index option, an entry with no hash."""
entries, current = [], None
for lineno, raw in enumerate(text.replace("\r\n", "\n").splitlines(), 1):
line = raw.rstrip()
if not line.strip() or line.lstrip().startswith("#"):
continue
body = line.strip()
if body.endswith("\\"):
body = body[:-1].rstrip()
if body.startswith("--hash="):
if current is None or not HASH_RE.match(body):
raise ValueError("line %d: a hash that is not sha256:<64 hex>, or none to hold it: %r" % (lineno, body))
current[3].append(body.split(":", 1)[1])
continue
m = PIN_RE.match(body)
if not m or line[0] in " \t":
raise ValueError("line %d: not `name==version`: %r" % (lineno, body))
current = (m.group(1), m.group(2), m.group(3) or "", [])
entries.append(current)
for name, version, _, hashes in entries:
if not hashes:
raise ValueError("%s==%s has no --hash" % (name, version))
return entries
# ── the sources ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
def wrapper_sources(pyproject_text: str) -> dict:
"""What pyproject.toml declares: the core pin, the other dependencies, the dev extra."""
project = tomllib.loads(pyproject_text)["project"]
pins = [d for d in project["dependencies"] if CORE_PIN_RE.match(d.strip())]
if len(pins) != 1:
raise SystemExit("pyproject.toml must carry exactly one `invisible_core==X` pin, found %r" % pins)
return {
"core_version": CORE_PIN_RE.match(pins[0].strip()).group(1),
"dependencies": [d for d in project["dependencies"] if d != pins[0]],
"dev": list(project["optional-dependencies"]["dev"]),
}
def core_dependencies(core_pyproject_text: str) -> list:
return list(tomllib.loads(core_pyproject_text)["project"]["dependencies"])
def expected_requirements(pyproject_text: str, core_requires: list, playwright_pin: str) -> list:
"""The requirements the lock must cover, in the order the input prints them."""
src = wrapper_sources(pyproject_text)
reqs = set(src["dependencies"]) | set(src["dev"]) | set(core_requires) | set(HARNESS) | {"playwright==%s" % playwright_pin.strip(), CRYPTOGRAPHY}
return sorted(reqs, key=lambda r: (base_name(r), r))
def make_in(pyproject_text: str, core_pyproject_text: str, playwright_pin: str, exclude_newer: str) -> str:
src = wrapper_sources(pyproject_text)
core_requires = core_dependencies(core_pyproject_text)
head = [
"# Input of the gate lock; `python scripts/ci_py_lock.py` writes it and gate.txt from the sources below. Wrapper-owned (ci-03), read at the wrapper_ref.",
"# python-version: %s" % PYTHON_VERSION,
"# exclude-newer: %s" % exclude_newer,
"# wrapper: pyproject.toml sha256 %s (at generation); its dependencies without invisible_core, and its `dev` extra" % sha256_text(pyproject_text),
"# core: invisible_core==%s, tag v%s, pyproject.toml sha256 %s (at generation); the core is a wheel of ours, only what it depends on is locked" % (
src["core_version"], src["core_version"], sha256_text(core_pyproject_text)),
"# core-requires: %s" % SEP.join(core_requires),
"# playwright: %s from scripts/playwright_pin.txt (the stock client the gate drives the engine with)" % playwright_pin.strip(),
"# cryptography: %s (the lab's PKI)" % CRYPTOGRAPHY.split("==")[1],
"# harness: %s (the installers of the install-from-index job)" % SEP.join(HARNESS),
]
return "\n".join(head + expected_requirements(pyproject_text, core_requires, playwright_pin)) + "\n"
# ── the lock ─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
def lock_header(in_text: str, meta: dict) -> str:
return "\n".join([
"# Generated by `python scripts/ci_py_lock.py`: do not edit. Wrapper-owned (ci-03).",
"# input: ci/py-lock/gate.in sha256 %s" % sha256_text(in_text),
"# resolver: uv pip compile --universal --generate-hashes --no-build --python-version %s --exclude-newer %s" % (meta["python-version"], meta["exclude-newer"]),
"# Every file of each version is hashed (Linux and Windows wheels of every Python from %s, and the sdist): one lock for every OS." % meta["python-version"],
"# A consumer installs it with: pip install --no-index --find-links <wheelhouse> --require-hashes -r <this file>",
]) + "\n"
def normalise(raw: str, header: str) -> str:
"""What uv printed (no header, no annotations) as a lock: entries by name, hashes sorted, the given header. Same input, same bytes."""
entries = sorted(parse_lock(raw), key=lambda e: (norm(e[0]), e[1], e[2]))
lines = [header.rstrip("\n")]
for name, version, marker, hashes in entries:
lines.append("%s==%s%s \\" % (name, version, (" ; " + marker) if marker else ""))
hs = sorted(set(hashes))
lines += [" --hash=sha256:%s%s" % (h, " \\" if i < len(hs) - 1 else "") for i, h in enumerate(hs)]
return "\n".join(lines) + "\n"
def compile_lock(in_text: str, uv: str = "uv") -> str:
parsed = read_in(in_text)
meta = parsed["meta"]
with tempfile.TemporaryDirectory() as tmp:
src = Path(tmp) / "in.txt"
src.write_text("\n".join(parsed["requirements"]) + "\n", encoding="utf-8")
out = subprocess.run([uv, "pip", "compile", str(src), "--universal", "--generate-hashes", "--no-build", "--no-header", "--no-annotate", "--quiet",
"--python-version", meta["python-version"], "--exclude-newer", meta["exclude-newer"]],
check=True, capture_output=True, text=True).stdout
return normalise(out, lock_header(in_text, meta))
def main(argv=None) -> int:
ap = argparse.ArgumentParser(description=__doc__.splitlines()[0])
ap.add_argument("--core-pyproject", required=True, help="pyproject.toml of the core at the tag of the pin (invisible_core==X -> tag vX)")
ap.add_argument("--exclude-newer", default=None, help="ignore releases newer than this (default: the one of the committed gate.in, else %s)" % DEFAULT_EXCLUDE_NEWER)
ap.add_argument("--uv", default="uv", help="the uv executable")
a = ap.parse_args(argv)
exclude = a.exclude_newer
if exclude is None:
exclude = read_in(IN_PATH.read_text(encoding="utf-8"))["meta"].get("exclude-newer") if IN_PATH.exists() else None
in_text = make_in(PYPROJECT.read_text(encoding="utf-8"), Path(a.core_pyproject).read_text(encoding="utf-8"),
PLAYWRIGHT_PIN.read_text(encoding="utf-8"), exclude or DEFAULT_EXCLUDE_NEWER)
LOCK_DIR.mkdir(parents=True, exist_ok=True)
IN_PATH.write_text(in_text, encoding="utf-8", newline="\n")
txt = compile_lock(in_text, a.uv)
TXT_PATH.write_text(txt, encoding="utf-8", newline="\n")
print("ci/py-lock/gate.in and gate.txt written (%d direct requirements, %d locked distributions)" % (len(read_in(in_text)["requirements"]), len(parse_lock(txt))))
return 0
if __name__ == "__main__":
sys.exit(main())
+116
View File
@@ -0,0 +1,116 @@
#!/usr/bin/env python3
"""Run ONE row of the whole-e2e suite against a binary, for the candidate's gate, and write ONE junit for the judge.
ci_suite_run.py --required ci/required-suites.json --suite wrapper.e2e.suite.linux.1 --os linux --binary FF --junit result/x.xml
The run is the run of ``scripts/run_e2e.py`` (``invisible_core.testing.e2e``: the two passes, ``-m "e2e and not wall_clock"`` with 4 browsers at once and then
``-m "e2e and wall_clock"`` alone, ``--dist loadfile``, the deadline per test, no rerun) on the files and node ids of the row; this script does not copy it, it calls it.
What it adds is the end: that run writes one junit per pass, and the judge (``scripts/ci_verdict.py judge``) reads one. The two are merged into ONE xunit2 file, every
testcase as pytest wrote it (``classname`` kept, no ``file``/``line``).
The exit code is 0 when the passes reached their end, red tests included: the verdict is the judge's, and a failed test is a line of its list, not a reason to lose the
junit. It is not 0 when a pass did not run to its end (interrupted, an internal error, a usage error: the code of that pass) or when no junit was written at all.
"""
from __future__ import annotations
import argparse
import copy
import os
import sys
import tempfile
import xml.etree.ElementTree as ET
from pathlib import Path
from typing import Callable, Optional, Sequence
sys.path.insert(0, str(Path(__file__).resolve().parent))
import ci_verdict # noqa: E402 (the judge: the row is read the way it reads it)
#: pytest's exit codes that mean "the pass reached its end": all passed, some failed, nothing collected (a client with no `wall_clock` test has an empty pass).
_REACHED_THE_END = (0, 1, 5)
def row_arguments(required: str, suite: str, os_name: str) -> list:
"""The files and node ids of the row, in its order (what ``ci_verdict.py args`` prints, without the marker: the passes bring their own)."""
return list(ci_verdict.find_suite(ci_verdict.load_required(required), suite, os_name)["tests"])
def pass_junits(directory: Path, procs: str = "4") -> list:
"""The junit file of each pass of the run, in the order of the passes (``invisible_core.testing.e2e`` names them)."""
from invisible_core.testing import e2e
return [e2e.junit_file(Path(directory), selection) for _width, selection in e2e.passes(procs)]
def merge_junits(paths: Sequence, out: Path) -> int:
"""Write ONE xunit2 junit with every testcase of the junit files that exist, in the order given. -> the number of testcases.
The counts of the testsuite are those of the testcases written, not the sum of the headers read: a header that disagrees with its own cases is not copied.
A path that does not exist is a pass that wrote nothing (it is not an error here: the judge counts what is in the file)."""
cases = []
for path in paths:
if not Path(path).is_file():
continue
cases += [copy.deepcopy(c) for c in ET.parse(path).getroot().iter("testcase")]
tags = [{child.tag for child in c} for c in cases]
failures = sum(1 for t in tags if "failure" in t and "error" not in t)
errors = sum(1 for t in tags if "error" in t)
skipped = sum(1 for t in tags if "skipped" in t and not ({"failure", "error"} & t))
seconds = sum(float(c.get("time") or 0) for c in cases)
suite = ET.Element("testsuite", {"name": "pytest", "errors": str(errors), "failures": str(failures), "skipped": str(skipped),
"tests": str(len(cases)), "time": "%.3f" % seconds})
suite.extend(cases)
root = ET.Element("testsuites", {"name": "pytest tests"})
root.append(suite)
out = Path(out)
out.parent.mkdir(parents=True, exist_ok=True)
ET.ElementTree(root).write(out, encoding="utf-8", xml_declaration=True)
return len(cases)
def run(required: str, suite: str, os_name: str, binary: str, junit: str, *, repo: Path, procs: Optional[str] = None,
run_e2e: Optional[Callable] = None, junit_directory: Optional[Path] = None) -> int:
"""Run the row and write the merged junit. ``run_e2e`` is ``invisible_core.testing.e2e.main`` (a fake in the unit tests)."""
from invisible_core.testing import e2e
run_e2e = run_e2e or e2e.main
arguments = row_arguments(required, suite, os_name)
directory = Path(junit_directory or tempfile.mkdtemp(prefix="invpw-suite-junit-"))
# the core reads the directory of the junit from the environment (its own order: this variable, the watchdog's folder, the checkout): one name, set for this run
before = os.environ.get(e2e.JUNIT_DIR_ENV)
os.environ[e2e.JUNIT_DIR_ENV] = str(directory)
try:
code = run_e2e([binary] + (["-n", procs] if procs else []) + arguments, repo)
finally:
if before is None:
os.environ.pop(e2e.JUNIT_DIR_ENV, None)
else:
os.environ[e2e.JUNIT_DIR_ENV] = before
written = merge_junits(pass_junits(directory, procs or "4"), Path(junit))
print("[ci_suite_run] %s on %s: %d test(s) in %s" % (suite, os_name, written, junit), flush=True)
if code not in _REACHED_THE_END:
print("[ci_suite_run] a pass did not run to its end (exit %s)" % code, file=sys.stderr)
return code
if not written:
print("[ci_suite_run] no pass wrote a junit", file=sys.stderr)
return 3
return 0
def main(argv: Optional[Sequence[str]] = None) -> int:
parser = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter)
parser.add_argument("--required", required=True, help="ci/required-suites.json")
parser.add_argument("--suite", required=True, help="the id of the row")
parser.add_argument("--os", required=True, choices=ci_verdict.OSES)
parser.add_argument("--binary", required=True, help="the engine under test")
parser.add_argument("--junit", required=True, help="the one junit written for the judge")
parser.add_argument("--procs", default=None, help="browsers at once, for the first pass (default: the run's own, 4)")
ns = parser.parse_args(argv)
try:
return run(ns.required, ns.suite, ns.os, ns.binary, ns.junit, repo=Path(__file__).resolve().parent.parent, procs=ns.procs)
except ci_verdict.Usage as exc:
print("ci_suite_run.py: %s" % exc, file=sys.stderr)
return 2
if __name__ == "__main__":
sys.exit(main())
+177 -16
View File
@@ -24,6 +24,11 @@ pytest wrote and fails on every one of them.
The one exception is `retired-tests.json` NEXT TO main's list (read from main, never from the judged branch): a file it names that
no longer exists in the checkout may leave the rows, and the minimum of a row may go down by the tests main counted for it in that
row (`tests: {row id: n}`), and by no more. A retired file still on disk, or any other lost test, stays red.
The same file may also retire single tests whose file stays: {"nodeid": "<file>::<test>", "suite": <row id>, "count": n, "reason",
"decided_by", "date", "from_min_tests"}. The minimum of that row may go down by the sum of the `count` of its entries and by no more, and
only for a nodeid whose file the row of main lists, and only while main's minimum of that row still equals `from_min_tests` (once the removal
is on main and its floor is lower, the entry is inert); a declared nodeid that the judged leg still collects is red, and so is any test that
goes without an entry.
What the file of main is can be said only by the gate, which checks main out (a failed download is not
"main has no list"): the file exists -> it is compared; it does not exist and the gate passed
--main-has-no-list (main was checked out and has no such file) -> passed, declared; it does not exist
@@ -44,6 +49,23 @@ The list is validated by all three commands (a malformed one is exit 2, with the
row `os` a non-empty subset of {linux, windows}, `tests` a non-empty list of unique strings, `min_tests` an integer > 0,
`exact` a bool, `marker` a string, `needs_root` a bool or a list of the row's OSes.
Optional fields of a row, read by the gate to build the leg of the row (absent = the plain behaviour; a field that is
present with a wrong type or value is a malformed list, exit 2, naming the row and the field; a name that is not listed
here is ignored as it always was):
runner_image object OS -> runner image name, only OSes of the row, e.g. {"windows": "windows-2022"}
(default: ubuntu-24.04 on Linux, windows-latest on Windows)
timeout_minutes integer 1..360, the timeout of the job (default 25)
needs_userns bool or list of the row's OSes: user namespaces for a normal user (the sandbox suite)
core_dumps false, "cores" or "invpw-cores" (Linux only): where the kernel writes the cores of a crashed
browser, $RUNNER_TEMP/cores or $RUNNER_TEMP/invpw-cores
stock_firefox bool or list of the row's OSes: Playwright's own Firefox is installed for the leg
location_service bool or list of the row's OSes: the Windows location service is turned on
run "pytest" (default) or "suite_run" (scripts/ci_suite_run.py, two passes)
extra_steps list of names from the closed set {fakeweb_profiles, keep_oracle_files}
moz_log string of MOZ_LOG modules appended to the suite's MOZ_LOG, no space
juggler_trace bool: the Juggler's own trace is kept with the result
artifact name of the artifact that keeps the oracle files (default: the suite id)
A required entry of "tests" is a file (at least one test of it must exist and EVERY one collected must pass) or a node
id `tests/x.py::name` (that test must pass; a parametrized test is matched on the name before `[`, and every one of its
parameters must pass).
@@ -69,6 +91,12 @@ import xml.etree.ElementTree as ET
from pathlib import Path
OSES = ("linux", "windows")
#: The optional row fields of the form "bool or a list of the row's OSes" (besides needs_root).
OS_FLAGS = ("needs_userns", "stock_firefox", "location_service")
CORE_DUMPS = ("cores", "invpw-cores")
RUN_MODES = ("pytest", "suite_run")
#: The closed set of the extra steps a row may ask of the gate (a name here is a step the gate knows how to run).
EXTRA_STEPS = ("fakeweb_profiles", "keep_oracle_files")
class Usage(Exception):
@@ -122,14 +150,70 @@ def validate_list(data):
problems.append("%s: exact must be true or false, not %r" % (where, row.get("exact")))
if not isinstance(row.get("marker"), str) or not row.get("marker").strip():
problems.append("%s: marker must be a non-empty string, not %r" % (where, row.get("marker")))
root = row.get("needs_root", False)
if not isinstance(root, bool):
if not (isinstance(root, list) and all(isinstance(o, str) for o in root) and set(root) <= set(OSES)
and (not oses_ok or set(root) <= set(oses))):
problems.append("%s: needs_root must be a bool or a list of the OSes of the row, not %r" % (where, root))
for name in ("needs_root",) + OS_FLAGS:
if name in row or name == "needs_root":
value = row.get(name, False)
if not _is_os_flag(value, oses, oses_ok):
problems.append("%s: %s must be a bool or a list of the OSes of the row, not %r" % (where, name, value))
problems.extend(_row_field_problems(row, where, oses, oses_ok))
return problems
def _is_os_flag(value, oses, oses_ok):
"""A bool, or a list of OSes that are all OSes of the row."""
if isinstance(value, bool):
return True
return (isinstance(value, list) and all(isinstance(o, str) for o in value) and set(value) <= set(OSES)
and (not oses_ok or set(value) <= set(oses)))
def _row_field_problems(row, where, oses, oses_ok):
"""The optional fields of a row that tell the gate how to build the leg (see the docstring): absent is the plain
behaviour; a field that is present with a value outside its type or its closed set is a problem, named."""
out = []
if "runner_image" in row:
image = row["runner_image"]
if not (isinstance(image, dict) and image and all(isinstance(k, str) and isinstance(v, str) and v.strip()
for k, v in image.items())):
out.append("%s: runner_image must be a non-empty object of OS -> image name, not %r" % (where, image))
else:
wrong = sorted(k for k in image if k not in OSES or (oses_ok and k not in oses))
if wrong:
out.append("%s: runner_image names an OS the row does not have: %s" % (where, ", ".join(wrong)))
if "timeout_minutes" in row:
minutes = row["timeout_minutes"]
if not _is_int(minutes) or not 0 < minutes <= 360:
out.append("%s: timeout_minutes must be an integer between 1 and 360, not %r" % (where, minutes))
if "core_dumps" in row:
dumps = row["core_dumps"]
if dumps is not False and dumps not in CORE_DUMPS:
out.append("%s: core_dumps must be false or one of %s, not %r" % (where, "/".join(CORE_DUMPS), dumps))
elif dumps is not False and oses_ok and "linux" not in oses:
out.append("%s: core_dumps is a Linux setting and the row has no linux leg" % where)
if "run" in row and (row["run"] not in RUN_MODES):
out.append("%s: run must be one of %s, not %r" % (where, "/".join(RUN_MODES), row["run"]))
if "extra_steps" in row:
steps = row["extra_steps"]
if not (isinstance(steps, list) and all(isinstance(x, str) for x in steps) and len(set(steps)) == len(steps)):
out.append("%s: extra_steps must be a list of distinct names, not %r" % (where, steps))
else:
unknown = sorted(set(steps) - set(EXTRA_STEPS))
if unknown:
out.append("%s: extra_steps names %s, outside the closed set %s"
% (where, ", ".join(unknown), ", ".join(EXTRA_STEPS)))
if "moz_log" in row:
modules = row["moz_log"]
if not (isinstance(modules, str) and modules and not any(c.isspace() for c in modules)):
out.append("%s: moz_log must be a non-empty string of MOZ_LOG modules with no space, not %r" % (where, modules))
if "juggler_trace" in row and not isinstance(row["juggler_trace"], bool):
out.append("%s: juggler_trace must be true or false, not %r" % (where, row["juggler_trace"]))
if "artifact" in row:
name = row["artifact"]
if not (isinstance(name, str) and name and all(c.isalnum() or c in "._-" for c in name)):
out.append("%s: artifact must be a non-empty name of letters, digits, '.', '_' and '-', not %r" % (where, name))
return out
def _read_json_list(path):
try:
return json.loads(Path(path).read_text(encoding="utf-8"))
@@ -254,17 +338,25 @@ def _int(value):
RETIRED_NAME = "retired-tests.json"
def validate_retired(data):
"""-> the reasons why `data` is not a well-formed list of retired files (empty if it is). An entry: the file, why it went, the date, and
for each row id the number of tests the file had in that row on main (counted with the row's marker)."""
def validate_retired(data, suite_ids=None):
"""-> the reasons why `data` is not a well-formed list of retired tests (empty if it is). Two kinds of entry, in one list:
a FILE that is gone ({file, reason, date, tests: {row id: number of tests the file had in that row on main, counted with the row's marker}}), and
a single TEST whose file stays ({nodeid: "<file>::<test>", suite: row id, count > 0, reason, decided_by, date, from_min_tests: the minimum of
the row on main when the entry was written, an integer >= count, the same for every entry of a suite}). `suite_ids`, when given, are the row
ids of main's list: the suite of a nodeid entry must be one of them."""
if not isinstance(data, list):
return ["the retired list must be a JSON list"]
problems, seen = [], set()
problems, seen, seen_nodes, froms = [], set(), set(), {}
for i, e in enumerate(data):
where = "retired entry %d" % i
if not isinstance(e, dict):
problems.append("%s is not an object" % where)
continue
if "nodeid" in e or "suite" in e:
problems += _validate_retired_node(e, where, suite_ids, seen_nodes)
if isinstance(e.get("suite"), str) and _is_int(e.get("from_min_tests")):
froms.setdefault(e["suite"], set()).add(e["from_min_tests"])
continue
f = e.get("file")
if not isinstance(f, str) or not f.strip():
problems.append("%s has no file" % where)
@@ -279,12 +371,44 @@ def validate_retired(data):
counts = e.get("tests")
if not (isinstance(counts, dict) and counts and all(isinstance(k, str) and _is_int(v) and v > 0 for k, v in counts.items())):
problems.append("%s: tests must be {row id: number of tests of the file in that row (> 0)}" % where)
for suite, values in sorted(froms.items()):
if len(values) > 1:
problems.append("the retired tests of %s disagree on from_min_tests (%s): one suite, one floor of main" % (suite, sorted(values)))
return problems
def _validate_retired_node(e, where, suite_ids, seen):
problems = []
nid, suite = e.get("nodeid"), e.get("suite")
if "file" in e or "tests" in e:
problems.append("%s: an entry is a retired file (file, tests) or a retired test (nodeid, suite, count), not both" % where)
parts = nid.split("::", 1) if isinstance(nid, str) else []
if len(parts) != 2 or not parts[0].strip() or not parts[1].strip():
problems.append("%s: nodeid must be \"<file>::<test>\"" % where)
else:
where = "retired test %s" % nid
if not isinstance(suite, str) or not suite.strip():
problems.append("%s: suite must be a non-empty string (the id of a row)" % where)
elif suite_ids is not None and suite not in suite_ids:
problems.append("%s: the suite %s is not a row of main's required list" % (where, suite))
if isinstance(nid, str) and isinstance(suite, str):
if (nid, suite) in seen:
problems.append("%s: appears more than once for the suite %s" % (where, suite))
seen.add((nid, suite))
if not _is_int(e.get("count")) or e.get("count") < 1:
problems.append("%s: count must be an integer >= 1 (the tests the suite loses)" % where)
for key in ("reason", "decided_by", "date"):
if not isinstance(e.get(key), str) or not e.get(key).strip():
problems.append("%s: %s must be a non-empty string" % (where, key))
frm = e.get("from_min_tests")
if not _is_int(frm) or frm < 1 or (_is_int(e.get("count")) and frm < e["count"]):
problems.append("%s: from_min_tests must be an integer >= count (the minimum of the suite on main when the entry was written)" % where)
return problems
def retired_of_main(main_required):
"""The retired files of main: ``ci/retired-tests.json`` next to main's list, read from main and never from the judged branch. It may not
exist (main older than the format): nothing is retired. A malformed one is a problem, never an empty list. -> (entries, problems)."""
"""The retired files and tests of main: ``ci/retired-tests.json`` next to main's list, read from main and never from the judged branch. It may
not exist (main older than the format): nothing is retired. A malformed one is a problem, never an empty list. -> (entries, problems)."""
path = Path(main_required).with_name(RETIRED_NAME)
if not path.is_file():
return [], []
@@ -292,22 +416,55 @@ def retired_of_main(main_required):
data = json.loads(path.read_text(encoding="utf-8"))
except (OSError, ValueError) as exc:
return [], ["the retired list of main %s cannot be read: %s" % (path, exc)]
bad = validate_retired(data)
try:
rows = json.loads(Path(main_required).read_text(encoding="utf-8"))
suite_ids = {r.get("id") for r in rows if isinstance(r, dict)} if isinstance(rows, list) else None
except (OSError, ValueError):
suite_ids = None # the list of main itself is read (and refused) by the caller
bad = validate_retired(data, suite_ids)
if bad:
return [], ["the retired list of main %s is malformed: %s" % (path, "; ".join(bad))]
return data, []
def against_main(current, main, retired=(), exists=os.path.exists):
def _retired_tests_of(row, retired, collected, judged):
"""-> (the number of tests the row may lose because main retired them one by one, problems). An entry counts only if the file of its nodeid is
in the row of main (a nodeid that the row does not run is not a test the row loses). The judge has the junit of the leg it judges and only
counts of main, so a declared nodeid that the judged leg still collects is red (and counts for nothing), and the nodeid of another row is taken
on its count, the leg of that row checking it. An entry counts only while the minimum of the row on main is still its `from_min_tests`: once
the removal is on main the floor is lower and the entry is inert (it allows nothing and asks nothing)."""
allowed, problems = 0, []
listed = row.get("tests", [])
for e in retired:
if not (isinstance(e, dict) and isinstance(e.get("nodeid"), str) and e.get("suite") == row.get("id")):
continue
nid = e["nodeid"]
if _int(row.get("min_tests")) != e.get("from_min_tests"):
continue
if nid not in listed and nid.split("::", 1)[0] not in listed:
continue
if collected is not None and judged == row.get("id") and any(n == nid or _base(n) == nid for n in collected):
problems.append("the test %s is declared retired for %s, but the suite still collects it: it did not leave" % (nid, row.get("id")))
continue
allowed += _int(e.get("count"))
return allowed, problems
def against_main(current, main, retired=(), exists=os.path.exists, collected=None, judged=None):
"""The list only grows: every suite of main is still here, with no lower minimum, no exact turned off, no lost
test or OS and the same marker. `main` is read leniently (it may be older than the current format).
The one way a test leaves a row is `retired` (the list of MAIN, never of the branch): a file that main retired and that no longer exists
(`exists`, in the checkout judged) is not a lost test, and the minimum of the row may go down by exactly the tests main counted for that file
in that row (``tests[row id]``), and by no more. A retired file that is still on disk is not excused: it must stay in its rows."""
in that row (``tests[row id]``), and by no more. A retired file that is still on disk is not excused: it must stay in its rows.
The other way is a single retired test (``nodeid``, ``suite``, ``count``) whose file stays in the row: the minimum of the suite may go down by
the ``count`` of its entries, and by no more. ``collected`` (the node ids of the junit of the judged leg) and ``judged`` (that leg's suite) let
the judge see that a declared nodeid is gone from the leg; of the collection of main it has only the count."""
problems = []
if not isinstance(main, list):
return ["the list of main is not a JSON list: it cannot be compared"]
retired = list(retired)
gone = {e["file"]: e["tests"] for e in retired if isinstance(e, dict) and isinstance(e.get("file"), str)
and isinstance(e.get("tests"), dict) and not exists(e["file"])}
by_id = {s.get("id"): s for s in current if isinstance(s, dict)}
@@ -323,10 +480,13 @@ def against_main(current, main, retired=(), exists=os.path.exists):
excused = [t for t in lost if t in gone]
lost = [t for t in lost if t not in gone]
allowed = sum(_int(gone[t].get(sid)) for t in excused)
by_test, why = _retired_tests_of(old, retired, collected, judged)
allowed += by_test
problems += why
if _int(new.get("min_tests")) < _int(old.get("min_tests")) - allowed:
problems.append("the minimum of %s went down: %s on main, %s here%s"
% (sid, old.get("min_tests"), new.get("min_tests"),
" (retired files account for %d of it)" % allowed if allowed else ""))
" (retired files and tests account for %d of it)" % allowed if allowed else ""))
if old.get("exact") is True and new.get("exact") is not True:
problems.append("the suite %s is no longer exact, as it is on main" % sid)
if lost:
@@ -468,7 +628,8 @@ def cmd_judge(ns):
try:
retired, retired_problems = retired_of_main(ns.main_required)
problems += retired_problems
problems += against_main(suites, _read_json_list(ns.main_required), retired)
problems += against_main(suites, _read_json_list(ns.main_required), retired,
collected={n for n, _o in cases}, judged=ns.suite)
except Usage as exc:
problems.append(str(exc))
elif ns.main_has_no_list:
+122
View File
@@ -0,0 +1,122 @@
r"""Read the full user-mode dumps Windows Error Reporting left for a python.exe that died, and say what each one holds (CI evidence, no debugger needed).
The Windows e2e jobs set ``HKLM\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps\python.exe`` (full dump, folder ``<evidence>/dumps/python``)
before their tests; when a pytest-xdist worker dies from an unhandled exception ("node down: Not properly terminated", "Windows fatal exception: access violation")
WER writes ``python.exe.<pid>.dmp`` there and the evidence artifact carries it. This script runs after the tests (``if: always()``): it lists every dump with its size
and reads the header of the MINIDUMP file, with ``struct`` only, to name what a debugger would name first: the thread that raised, the exception code, the faulting
address and the module that holds it (with the offset in it), plus the access that failed for an access violation. The summary goes to stdout and to
``summary.txt`` beside the dumps. It never fails the job: no dump is the normal case.
Format of the file: https://learn.microsoft.com/windows/win32/api/minidumpapiset/ (MINIDUMP_HEADER, MINIDUMP_DIRECTORY, MINIDUMP_EXCEPTION_STREAM,
MINIDUMP_MODULE). Dump types and the LocalDumps key: https://learn.microsoft.com/windows/win32/wer/collecting-user-mode-dumps
"""
from __future__ import annotations
import shutil
import struct
import sys
import time
from pathlib import Path
SIGNATURE = b"MDMP"
MODULE_LIST_STREAM = 4
EXCEPTION_STREAM = 6
MODULE_SIZE = 108 # sizeof(MINIDUMP_MODULE)
EXCEPTION_NAMES = {
0xC0000005: "EXCEPTION_ACCESS_VIOLATION",
0xC0000374: "STATUS_HEAP_CORRUPTION",
0xC0000409: "STATUS_STACK_BUFFER_OVERRUN (fail fast)",
0xC00000FD: "EXCEPTION_STACK_OVERFLOW",
0xC000001D: "EXCEPTION_ILLEGAL_INSTRUCTION",
0xC0000094: "EXCEPTION_INT_DIVIDE_BY_ZERO",
0xC0000026: "STATUS_INVALID_DISPOSITION",
0xC0000096: "EXCEPTION_PRIV_INSTRUCTION",
0xC0000006: "EXCEPTION_IN_PAGE_ERROR",
0x80000003: "EXCEPTION_BREAKPOINT",
0xE06D7363: "C++ exception",
}
ACCESS = {0: "read", 1: "write", 8: "execute (DEP)"}
def read_dump(path: Path) -> dict:
"""The facts of one minidump: thread id, exception code and address, the module holding the address. Raises ValueError on a file that is not a minidump."""
with open(path, "rb") as f:
head = f.read(32)
if len(head) < 32 or head[:4] != SIGNATURE:
raise ValueError("not a minidump (no MDMP signature)")
_sig, _version, n_streams, dir_rva = struct.unpack_from("<4sIII", head, 0)
f.seek(dir_rva)
directory = [struct.unpack("<III", f.read(12)) for _ in range(n_streams)]
out: dict = {"streams": n_streams}
modules: list[tuple[int, int, str]] = []
for kind, size, rva in directory:
if kind == MODULE_LIST_STREAM:
f.seek(rva)
(count,) = struct.unpack("<I", f.read(4))
records = f.read(count * MODULE_SIZE)
for i in range(count):
base, image_size, _cs, _ts, name_rva = struct.unpack_from("<QIIII", records, i * MODULE_SIZE)
here = f.tell()
f.seek(name_rva)
(nbytes,) = struct.unpack("<I", f.read(4))
name = f.read(nbytes).decode("utf-16-le", "replace")
f.seek(here)
modules.append((base, image_size, name))
elif kind == EXCEPTION_STREAM:
f.seek(rva)
raw = f.read(8 + 8 + 8 + 8 + 8 + 15 * 8)
tid, _pad, code, flags, _chain, address, n_params, _pad2 = struct.unpack_from("<IIIIQQII", raw, 0)
params = struct.unpack_from("<15Q", raw, 8 + 32)
out.update(thread_id=tid, code=code, flags=flags, address=address, params=list(params[:n_params]))
out["module_count"] = len(modules)
if "address" in out:
for base, image_size, name in modules:
if base <= out["address"] < base + image_size:
out["module"] = name
out["offset"] = out["address"] - base
break
return out
def describe(path: Path) -> str:
size = path.stat().st_size
head = "%s: %.1f MB" % (path.name, size / 1e6)
try:
d = read_dump(path)
except (ValueError, OSError, struct.error) as e:
return "%s, unreadable header: %s" % (head, e)
if "code" not in d:
return "%s, %d modules, no exception stream (a dump taken on request, not on a fault)" % (head, d["module_count"])
name = EXCEPTION_NAMES.get(d["code"], "unknown")
lines = [
head,
" exception 0x%08X %s on thread %d" % (d["code"], name, d["thread_id"]),
" at 0x%016X in %s" % (d["address"], ("%s+0x%X" % (d["module"], d["offset"])) if "module" in d else "no module of the dump (JIT or freed code)"),
]
p = d["params"]
if d["code"] in (0xC0000005, 0xC0000006) and len(p) >= 2:
lines.append(" failed access: %s of 0x%016X" % (ACCESS.get(p[0], str(p[0])), p[1]))
return "\n".join(lines)
def summarize(folder: Path) -> str:
dumps = sorted(folder.glob("*.dmp")) if folder.is_dir() else []
cdb = shutil.which("cdb") or shutil.which("windbg")
lines = ["WER dumps of python.exe in %s: %d" % (folder, len(dumps)), "debugger on the runner: %s" % (cdb or "none (the header reader above is all there is)")]
for p in dumps:
lines.append(describe(p) + "\n written %s" % time.strftime("%Y-%m-%d %H:%M:%S", time.gmtime(p.stat().st_mtime)))
return "\n".join(lines) + "\n"
def main(argv: list[str]) -> int:
folder = Path(argv[1]) if len(argv) > 1 else Path(".")
text = summarize(folder)
sys.stdout.write(text)
if folder.is_dir():
(folder / "summary.txt").write_text(text, encoding="utf-8", newline="\n")
return 0
if __name__ == "__main__":
sys.exit(main(sys.argv))
+227
View File
@@ -0,0 +1,227 @@
#!/usr/bin/env python3
"""Extracts, from Mozilla's own sources at a release tag, the names a chrome-scope script of a test may call, into ci/mozilla-chrome-api.json.
A twin of the retail Firefox runs chrome JS (through Marionette) on a Firefox that is NOT ours. A call to a name that this Firefox does not have fails there only, at the run:
``win.windowUtils.sendMouseEvent`` is not in Firefox 159 (its chrome input is ``Window.synthesizeMouseEvent``), and nothing red said so before the twins ran. The names are therefore read
from the source of the release the twins use, never typed:
* ``dom/interfaces/base/nsIDOMWindowUtils.idl``: the methods, attributes and constants of ``nsIDOMWindowUtils`` (what ``win.windowUtils.<name>`` reaches);
* ``dom/webidl/Window.webidl``: the members of ``interface Window`` and ``partial interface Window`` (with the parameter types and whether the member is ``ChromeOnly``), and every
dictionary with its fields, parents included (what the options of ``win.synthesizeMouseEvent`` may carry).
The same two files of OUR engine tree are read the same way, and what they carry that Mozilla's do not is written apart, under ``ours``: ``jugglerSendMouseEvent``, the fields of the
latency line. A call to one of those from code that runs on retail Firefox is red (tests/test_the_chrome_calls_of_the_tests_exist_in_firefox.py).
The file records, for every source, its path, the tag or commit and the sha256 of the bytes read. The wrapper's CI has no Firefox source, so the test reads the committed file and this
module's functions are tested on a small sample (tests/test_the_extractor_of_the_chrome_names_reads_idl_and_webidl.py). One command regenerates the file:
python scripts/extract_mozilla_chrome_api.py --mozilla-repo <git repository with the Mozilla tag> --tag FIREFOX_159_0_RELEASE --ours-repo <our engine tree> --ours-ref <commit> --write
"""
from __future__ import annotations
import argparse
import hashlib
import json
import re
import subprocess
import sys
from pathlib import Path
from typing import Any, Dict, List, Optional, Tuple
ROOT = Path(__file__).resolve().parent.parent
DATA_PATH = ROOT / "ci" / "mozilla-chrome-api.json"
WINDOW_UTILS_IDL = "dom/interfaces/base/nsIDOMWindowUtils.idl"
WINDOW_WEBIDL = "dom/webidl/Window.webidl"
SOURCES = (WINDOW_UTILS_IDL, WINDOW_WEBIDL)
_BLOCK_COMMENT = re.compile(r"/\*.*?\*/", re.S)
_LINE_COMMENT = re.compile(r"//[^\n]*")
_LEADING_ATTRS = re.compile(r"^\s*(?:\[[^\]]*\]\s*)*")
_WORD = re.compile(r"[A-Za-z_]\w*")
def strip_comments(text: str) -> str:
"""The text without comments and without preprocessor lines."""
text = _BLOCK_COMMENT.sub(" ", text)
text = _LINE_COMMENT.sub("", text)
return "\n".join(line for line in text.splitlines() if not line.lstrip().startswith("#"))
def _bodies(text: str, header: "re.Pattern[str]") -> List[Tuple[re.Match, str]]:
"""Every ``header { body }`` of ``text`` (braces matched), with the header's match."""
out: List[Tuple[re.Match, str]] = []
for m in header.finditer(text):
depth, i = 1, m.end()
while i < len(text) and depth:
depth += {"{": 1, "}": -1}.get(text[i], 0)
i += 1
out.append((m, text[m.end():i - 1]))
return out
def _statements(body: str) -> List[str]:
"""The ``;``-terminated statements at the top level of ``body`` (a nested ``{}`` or ``()`` does not end one)."""
out, depth, cur = [], 0, []
for ch in body:
if ch in "{(":
depth += 1
elif ch in "})":
depth -= 1
if ch == ";" and depth == 0:
out.append("".join(cur).strip())
cur = []
else:
cur.append(ch)
return [s for s in out if s]
def _split_params(text: str) -> List[str]:
out, depth, cur = [], 0, []
for ch in text:
if ch in "<([":
depth += 1
elif ch in ">)]":
depth -= 1
if ch == "," and depth == 0:
out.append("".join(cur).strip())
cur = []
else:
cur.append(ch)
tail = "".join(cur).strip()
return out + [tail] if tail else out
def _params(signature: str) -> List[List[str]]:
"""``[[name, type], ...]`` of the parameters of the call in ``signature`` (``optional`` and defaults dropped, ``in`` of the IDL dropped)."""
start = signature.index("(")
depth, i = 0, start
while i < len(signature):
depth += {"(": 1, ")": -1}.get(signature[i], 0)
if depth == 0:
break
i += 1
out = []
for raw in _split_params(signature[start + 1:i]):
raw = re.sub(r"\[[^\]]*\]", " ", raw.split("=")[0])
words = [w for w in raw.replace("<", " < ").replace(">", " > ").split() if w not in ("optional", "in", "out", "inout", "required")]
text = " ".join(words).replace(" < ", "<").replace(" > ", ">").replace(" ,", ",")
if not text:
continue
m = re.search(r"(\w+)$", text)
out.append([m.group(1), text[:m.start()].strip()])
return out
def window_utils(idl_text: str) -> Dict[str, List[str]]:
"""The methods, attributes and constants of ``nsIDOMWindowUtils`` in the text of its IDL file."""
text = strip_comments(idl_text)
methods, attributes, constants = set(), set(), set()
for _m, body in _bodies(text, re.compile(r"interface\s+nsIDOMWindowUtils\b[^{;]*\{")):
for statement in _statements(body):
rest = _LEADING_ATTRS.sub("", statement).strip()
if rest.startswith("const "):
constants.add(_WORD.findall(rest.split("=")[0])[-1])
elif re.search(r"\battribute\b", rest):
attributes.add(_WORD.findall(rest.split("=")[0])[-1])
elif "(" in rest:
methods.add(_WORD.findall(rest.split("(")[0])[-1])
return {"methods": sorted(methods), "attributes": sorted(attributes), "constants": sorted(constants)}
def window(webidl_text: str) -> Dict[str, Any]:
"""The members of ``Window`` (``interface`` and ``partial interface``) and every dictionary, parents folded in, from the text of a WebIDL file."""
text = strip_comments(webidl_text)
methods: Dict[str, Dict[str, Any]] = {}
attributes: Dict[str, Dict[str, Any]] = {}
for _m, body in _bodies(text, re.compile(r"(?:partial\s+)?interface\s+Window\b[^{;]*\{")):
for statement in _statements(body):
attrs = re.match(r"^\s*((?:\[[^\]]*\]\s*)*)", statement).group(1)
rest = _LEADING_ATTRS.sub("", statement).strip()
chrome_only = bool(re.search(r"\bChromeOnly\b", attrs))
if re.search(r"\battribute\b", rest):
attributes[_WORD.findall(rest.split("=")[0])[-1]] = {"chrome_only": chrome_only}
elif "(" in rest and not rest.startswith("constructor"):
name = _WORD.findall(rest.split("(")[0])[-1]
methods[name] = {"chrome_only": chrome_only, "params": _params(rest)}
own: Dict[str, Tuple[Optional[str], List[str]]] = {}
for m, body in _bodies(text, re.compile(r"dictionary\s+(\w+)\s*(?::\s*(\w+))?\s*\{")):
fields = []
for statement in _statements(body):
rest = _LEADING_ATTRS.sub("", statement.split("=")[0]).strip()
if rest:
fields.append(_WORD.findall(rest)[-1])
own[m.group(1)] = (m.group(2), fields)
def flat(name: str) -> List[str]:
parent, fields = own[name]
return sorted(set(fields) | (set(flat(parent)) if parent in own else set()))
return {
"methods": {k: methods[k] for k in sorted(methods)},
"attributes": {k: attributes[k] for k in sorted(attributes)},
"dictionaries": {k: flat(k) for k in sorted(own)},
}
def extract(idl_text: str, webidl_text: str) -> Dict[str, Any]:
return {"window_utils": window_utils(idl_text), "window": window(webidl_text)}
def only_in_ours(mozilla: Dict[str, Any], ours: Dict[str, Any]) -> Dict[str, Any]:
"""What the extraction of our tree carries and Mozilla's does not."""
out: Dict[str, Any] = {"window_utils": {}, "window": {"methods": [], "attributes": [], "dictionaries": {}}}
for kind in ("methods", "attributes", "constants"):
out["window_utils"][kind] = sorted(set(ours["window_utils"][kind]) - set(mozilla["window_utils"][kind]))
for kind in ("methods", "attributes"):
out["window"][kind] = sorted(set(ours["window"][kind]) - set(mozilla["window"][kind]))
for name, fields in ours["window"]["dictionaries"].items():
extra = sorted(set(fields) - set(mozilla["window"]["dictionaries"].get(name, [])))
if extra:
out["window"]["dictionaries"][name] = extra
return out
def _git_show(repo: Path, ref: str, path: str) -> bytes:
return subprocess.run(["git", "-C", str(repo), "show", "%s:%s" % (ref, path)], check=True, capture_output=True).stdout
def _read_source(repo: Path, ref: str) -> Tuple[Dict[str, Any], Dict[str, Any]]:
blobs = {path: _git_show(repo, ref, path) for path in SOURCES}
parsed = extract(blobs[WINDOW_UTILS_IDL].decode("utf-8"), blobs[WINDOW_WEBIDL].decode("utf-8"))
sources = [{"path": path, "sha256": hashlib.sha256(blobs[path]).hexdigest()} for path in SOURCES]
commit = subprocess.run(["git", "-C", str(repo), "rev-parse", "%s^{commit}" % ref], check=True, capture_output=True, text=True).stdout.strip()
return parsed, {"ref": ref, "commit": commit, "files": sources}
def build(mozilla_repo: Path, tag: str, ours_repo: Path, ours_ref: str) -> Dict[str, Any]:
mozilla, mozilla_source = _read_source(mozilla_repo, tag)
ours, ours_source = _read_source(ours_repo, ours_ref)
return {
"about": "Names a chrome-scope script of a test may call on the retail Firefox of the twins, extracted by scripts/extract_mozilla_chrome_api.py. Never edited by hand.",
"mozilla": dict(mozilla_source, **mozilla),
"ours": dict(ours_source, **only_in_ours(mozilla, ours)),
}
def main(argv: Optional[List[str]] = None) -> int:
ap = argparse.ArgumentParser(description=__doc__.split("\n")[0])
ap.add_argument("--mozilla-repo", type=Path, required=True)
ap.add_argument("--tag", required=True)
ap.add_argument("--ours-repo", type=Path, required=True)
ap.add_argument("--ours-ref", required=True)
ap.add_argument("--write", action="store_true", help="write ci/mozilla-chrome-api.json; without it the file is compared and the exit is 1 when it differs")
args = ap.parse_args(argv)
data = build(args.mozilla_repo, args.tag, args.ours_repo, args.ours_ref)
text = json.dumps(data, indent=2, sort_keys=True) + "\n"
if args.write:
DATA_PATH.write_text(text, encoding="utf-8", newline="\n")
print("wrote %s" % DATA_PATH)
return 0
same = DATA_PATH.read_text(encoding="utf-8") == text
print("%s %s" % (DATA_PATH, "is what the sources give" if same else "DIFFERS from what the sources give: regenerate it with --write"))
return 0 if same else 1
if __name__ == "__main__":
sys.exit(main())
+4
View File
@@ -0,0 +1,4 @@
<!doctype html>
<meta charset=utf-8>
<title>not controlled</title>
<p>The service worker did not answer this navigation.</p>
+14
View File
@@ -0,0 +1,14 @@
<!doctype html>
<meta charset=utf-8>
<title>frame</title>
<script>
document.write('<script src="/ab/realm.js' + location.search + '"><\/script>');
</script>
<script>
(async () => {
const q = new URLSearchParams(location.search);
const data = await abRealm();
data.host = location.hostname;
parent.postMessage({id: q.get('id'), data}, '*');
})();
</script>
+4
View File
@@ -0,0 +1,4 @@
<!doctype html>
<meta charset=utf-8>
<title>leave</title>
<p>The page of the back and forward step.</p>
+16
View File
@@ -0,0 +1,16 @@
<!doctype html>
<meta charset=utf-8>
<title>opened</title>
<script>
document.write('<script src="/ab/realm.js' + location.search + '"><\/script>');
</script>
<script>
(async () => {
const q = new URLSearchParams(location.search);
const data = await abRealm();
const bar = n => { try { return window[n].visible; } catch (e) { return 'ERR'; } };
data.geometry = {innerWidth, innerHeight, outerWidth, outerHeight, screenX, screenY, screen: [screen.width, screen.height, screen.availWidth, screen.availHeight],
bars: ['menubar', 'toolbar', 'locationbar', 'statusbar', 'scrollbars', 'personalbar'].map(bar), hasOpener: !!window.opener, name: window.name};
try { opener.postMessage({id: q.get('id'), data}, '*'); } catch (e) {}
})();
</script>
+95
View File
@@ -0,0 +1,95 @@
// The surface subset one realm reads: the same text is loaded by the page, a cross-site iframe, a srcdoc iframe, a worker, a shared worker, a
// service worker and an audio worklet, so that a value the engine declares for one realm and forgets for another shows as a difference.
// Everything here is a plain read of what the realm exposes; a realm that lacks an API says 'absent'.
(function (root) {
'use strict';
const errs = e => 'ERR ' + ((e && e.name) || '') + ': ' + ((e && e.message) || String(e));
const bytesHash = u8 => {
let a = 0x811c9dc5, b = 0xdeadbeef;
for (let i = 0; i < u8.length; i++) { a = Math.imul(a ^ u8[i], 0x01000193) >>> 0; b = Math.imul(b ^ u8[i], 0x5bd1e995) >>> 0; b ^= b >>> 13; }
return u8.length + ':' + a.toString(16) + b.toString(16);
};
// A PNG of Firefox carries a per-launch "deBG" chunk (the host gate's noise.png_deBG): the bytes are hashed without it, so that two launches of one engine agree.
const pngHash = u8 => {
const keep = [u8.subarray(0, 8)];
for (let i = 8; i + 12 <= u8.length;) {
const n = (u8[i] << 24 | u8[i + 1] << 16 | u8[i + 2] << 8 | u8[i + 3]) >>> 0, t = String.fromCharCode(u8[i + 4], u8[i + 5], u8[i + 6], u8[i + 7]);
if (t !== 'deBG') keep.push(u8.subarray(i, i + 12 + n));
i += 12 + n;
}
const out = new Uint8Array(keep.reduce((a, x) => a + x.length, 0)); let o = 0; for (const k of keep) { out.set(k, o); o += k.length; }
return bytesHash(out);
};
const dataUrlHash = url => pngHash(Uint8Array.from(atob(url.split(',')[1]), ch => ch.charCodeAt(0)));
const TEXT = 'Hamburgefonstiv 0123 ZZ';
const draw = g => {
g.fillStyle = '#fff'; g.fillRect(0, 0, 160, 40); g.fillStyle = '#036'; g.font = '16px sans-serif'; g.fillText(TEXT, 4, 16);
g.font = '14px serif'; g.fillText('\u65e5\u672c\u8a9e Stra\u00dfe', 4, 34);
};
const measure = g => ['sans-serif', 'serif', 'monospace', 'ZZHostCanary, sans-serif'].map(f => { g.font = '16px ' + f; return g.measureText(TEXT).width; });
const scene = c => {
const gl = c.getContext('webgl');
if (!gl) return 'no webgl';
const sh = (type, src) => { const s = gl.createShader(type); gl.shaderSource(s, src); gl.compileShader(s); return s; };
const p = gl.createProgram();
gl.attachShader(p, sh(gl.VERTEX_SHADER, 'attribute vec2 a;void main(){gl_Position=vec4(a,0.,1.);}'));
gl.attachShader(p, sh(gl.FRAGMENT_SHADER, 'precision mediump float;void main(){gl_FragColor=vec4(.9,.3,.1,1.);}'));
gl.linkProgram(p); gl.useProgram(p);
const buf = gl.createBuffer(); gl.bindBuffer(gl.ARRAY_BUFFER, buf);
gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([-0.8, -0.8, 0.8, -0.8, 0, 0.8]), gl.STATIC_DRAW);
const a = gl.getAttribLocation(p, 'a'); gl.enableVertexAttribArray(a); gl.vertexAttribPointer(a, 2, gl.FLOAT, false, 0, 0);
gl.viewport(0, 0, 32, 32); gl.clearColor(0.2, 0.4, 0.6, 1); gl.clear(gl.COLOR_BUFFER_BIT); gl.drawArrays(gl.TRIANGLES, 0, 3);
const px = new Uint8Array(32 * 32 * 4); gl.readPixels(0, 0, 32, 32, gl.RGBA, gl.UNSIGNED_BYTE, px);
const dbg = gl.getExtension('WEBGL_debug_renderer_info');
return {pixels: bytesHash(px), vendor: gl.getParameter(gl.VENDOR), renderer: gl.getParameter(gl.RENDERER),
unmasked: dbg ? [gl.getParameter(dbg.UNMASKED_VENDOR_WEBGL), gl.getParameter(dbg.UNMASKED_RENDERER_WEBGL)] : 'absent'};
};
// What needs no await: the only part an audio worklet can read.
const readSync = () => {
const o = {};
const t = (k, f) => { try { o[k] = f(); } catch (e) { o[k] = errs(e); } };
const nav = root.navigator;
if (nav) {
t('language', () => nav.language); t('languages', () => Array.from(nav.languages)); t('platform', () => nav.platform);
t('hardwareConcurrency', () => nav.hardwareConcurrency); t('userAgent', () => nav.userAgent);
} else { o.navigator = 'absent'; }
t('intl', () => { const r = new Intl.DateTimeFormat().resolvedOptions(); return [r.locale, r.timeZone, r.calendar, r.numberingSystem]; });
const d = new Date(Date.UTC(2026, 0, 15, 12)), s = new Date(Date.UTC(2026, 6, 15, 12));
t('dates', () => [d.toString(), s.toString(), d.toLocaleString(), d.toLocaleDateString(undefined, {dateStyle: 'full'}), (1234567.891).toLocaleString(),
d.getTimezoneOffset(), s.getTimezoneOffset()]);
t('sampleRate', () => typeof root.sampleRate === 'number' ? root.sampleRate : 'absent');
return o;
};
const read = async () => {
const o = readSync();
const ta = async (k, f) => { try { o[k] = await f(); } catch (e) { o[k] = errs(e); } };
if (root.document && root.document.createElement) {
await ta('canvas', async () => {
const c = root.document.createElement('canvas'); c.width = 160; c.height = 40; const g = c.getContext('2d'); draw(g);
return {toDataURL: dataUrlHash(c.toDataURL()), pixels: bytesHash(g.getImageData(0, 0, 160, 40).data), measure: measure(g)};
});
await ta('webgl', async () => { const c = root.document.createElement('canvas'); c.width = 32; c.height = 32; return scene(c); });
} else { o.canvas = 'absent'; }
if (typeof root.OffscreenCanvas === 'function') {
await ta('offscreen', async () => {
const c = new root.OffscreenCanvas(160, 40), g = c.getContext('2d'); draw(g);
const m = measure(g), blob = await c.convertToBlob();
return {measure: m, png: pngHash(new Uint8Array(await blob.arrayBuffer()))};
});
await ta('offscreen_webgl', async () => scene(new root.OffscreenCanvas(32, 32)));
} else { o.offscreen = 'absent'; }
return o;
};
root.abRealm = read;
root.abRealmSync = readSync;
// An audio worklet runs this file as a module: its processor reports what the worklet's own realm reads, when it is created.
if (typeof root.registerProcessor === 'function' && typeof root.AudioWorkletProcessor === 'function') {
root.registerProcessor('ab-probe', class extends root.AudioWorkletProcessor {
constructor() { super(); this.port.postMessage(readSync()); }
process() { return false; }
});
}
})(typeof globalThis !== 'undefined' ? globalThis : self);
+5
View File
@@ -0,0 +1,5 @@
importScripts('/ab/realm.js' + location.search);
onconnect = e => {
const port = e.ports[0];
port.onmessage = async () => { port.postMessage(await abRealm()); };
};
+89
View File
@@ -0,0 +1,89 @@
<!doctype html>
<meta charset=utf-8>
<title>ab</title>
<body>
<script>
// The A/B oracle's visit of the surfaces a plain read of the top window does not reach: every realm and every kind of window a page can make
// reads the same subset (realm.js), and the server says which Accept-Language it saw for each kind of request. The page is served from
// http://127.0.0.1 (a secure context: service workers and the audio worklet need one); `?ctx=` names the context it runs in.
// What it records goes to window.__abResult; the title says when it is done. A step that does not answer says 'timeout: <step>' after its own
// budget, never silence, so that the two engines of an A/B compare the same leaves.
document.write('<script src="/ab/realm.js' + location.search + '"><\/script>');
</script>
<script>
(async () => {
const Q = new URLSearchParams(location.search), CTX = Q.get('ctx') || 'none', ID = '?ctx=' + encodeURIComponent(CTX);
const errs = e => 'ERR ' + ((e && e.name) || '') + ': ' + ((e && e.message) || String(e));
const within = (p, ms, what) => Promise.race([p, new Promise(res => setTimeout(() => res('timeout: ' + what), ms))]);
const step = async (R, k, f, ms = 15000) => { try { R[k] = await within(Promise.resolve().then(f), ms, k); } catch (e) { R[k] = errs(e); } };
const waiting = {};
addEventListener('message', e => { const m = e.data; if (m && typeof m.id === 'string' && waiting[m.id]) { waiting[m.id](Object.assign({origin: e.origin.replace(/:\d+$/, ':<port>')}, m.data)); delete waiting[m.id]; } });
const popups = [];
const pop = (id, name, features) => new Promise(res => {
waiting[id] = res;
const url = '/ab/opened.html' + ID + '&id=' + id;
const w = features === undefined ? window.open(url, name) : window.open(url, name, features);
if (w) popups.push(w); else res('blocked');
});
addEventListener('pageshow', async e => {
let n = 1;
try { n = (Number(sessionStorage.getItem('abPs')) || 0) + 1; sessionStorage.setItem('abPs', String(n)); } catch (x) {}
let data; try { data = JSON.parse(JSON.stringify(await abRealm())); } catch (x) { data = errs(x); }
window.__abBf = {n, persisted: e.persisted, data};
});
let done = false;
try { done = sessionStorage.getItem('abDone') === '1'; } catch (x) {}
if (done) { document.title = 'ab-done'; return; }
const R = {};
await step(R, 'top', () => abRealm());
await step(R, 'iframe_cross', () => new Promise(res => {
waiting.cross = res;
const f = document.createElement('iframe'); f.src = 'http://localhost:' + location.port + '/ab/frame.html' + ID + '&id=cross'; document.body.appendChild(f); }));
await step(R, 'iframe_srcdoc', () => new Promise((res, rej) => {
const f = document.createElement('iframe');
f.srcdoc = '<!doctype html><script src="/ab/realm.js' + ID + '"><\/script>';
f.onload = async () => { try { res(await f.contentWindow.abRealm()); } catch (e) { rej(e); } };
document.body.appendChild(f); }));
await step(R, 'worker', () => new Promise((res, rej) => {
const w = new Worker('/ab/worker.js' + ID); w.onmessage = e => { res(e.data); w.terminate(); }; w.onerror = () => { rej(new Error('worker error')); w.terminate(); }; w.postMessage('go'); }));
await step(R, 'shared_worker', () => new Promise((res, rej) => {
const w = new SharedWorker('/ab/shared.js' + ID); w.port.onmessage = e => res(e.data); w.onerror = () => rej(new Error('shared worker error')); w.port.postMessage('go'); }));
await step(R, 'service_worker', async () => {
if (!navigator.serviceWorker) return 'absent';
const reg = await navigator.serviceWorker.register('/ab/sw.js' + ID, {scope: '/ab/'});
try {
await navigator.serviceWorker.ready;
const f = document.createElement('iframe'), loaded = new Promise(r => { f.onload = r; });
f.src = '/ab/controlled.html' + ID; document.body.appendChild(f); await loaded;
const el = f.contentDocument.getElementById('sw');
return el ? JSON.parse(el.textContent) : 'the worker did not answer the navigation';
} finally { try { await reg.unregister(); } catch (e) {} }
}, 20000);
await step(R, 'audio_worklet', async () => {
const ac = new AudioContext();
try {
await ac.audioWorklet.addModule('/ab/realm.js' + ID);
const node = new AudioWorkletNode(ac, 'ab-probe');
const got = new Promise(res => { node.port.onmessage = e => res(e.data); });
ac.resume().catch(() => {});
return await got;
} finally { try { await ac.close(); } catch (e) {} }
}, 8000);
await step(R, 'popup_plain', () => pop('plain', 'abPlain'));
await step(R, 'popup_features', () => pop('features', 'abFeatures', 'popup,width=500,height=420,left=40,top=30'));
for (const w of popups) { try { w.close(); } catch (e) {} }
// two more kinds of request, so that the server has seen a fetch and an image next to the documents, scripts and workers
await step(R, 'requests', async () => {
await fetch('/ab/probe' + ID + '&k=fetch');
await new Promise(res => { const i = new Image(); i.onload = i.onerror = res; i.src = '/ab/probe' + ID + '&k=image'; });
return 'made'; }, 5000);
await step(R, 'accept_language', async () => (await fetch('/ab/seen' + ID)).json(), 5000);
window.__abResult = JSON.parse(JSON.stringify(R));
try { sessionStorage.setItem('abDone', '1'); } catch (e) {}
document.title = 'ab-done';
})();
</script>
+17
View File
@@ -0,0 +1,17 @@
// A service worker that answers one navigation itself: the page it builds carries what the worker's own realm reads and the headers the
// worker saw on the request, so a controlled navigation is read through the worker, not around it.
importScripts('/ab/realm.js' + location.search);
self.addEventListener('install', () => self.skipWaiting());
self.addEventListener('activate', e => e.waitUntil(self.clients.claim()));
self.addEventListener('fetch', e => {
const u = new URL(e.request.url);
if (u.pathname !== '/ab/controlled.html') return;
e.respondWith((async () => {
const data = await abRealm();
data.request = {acceptLanguage: e.request.headers.get('accept-language'), mode: e.request.mode, destination: e.request.destination};
try { data.own_fetch = (await fetch('/ab/probe' + u.search)).status; } catch (x) { data.own_fetch = 'ERR ' + ((x && x.name) || ''); }
const json = JSON.stringify(data).replace(/</g, '\\u003c');
return new Response('<!doctype html><meta charset=utf-8><title>controlled</title><script type="application/json" id="sw">' + json + '</script>',
{headers: {'Content-Type': 'text/html; charset=utf-8'}});
})());
});
+2
View File
@@ -0,0 +1,2 @@
importScripts('/ab/realm.js' + location.search);
onmessage = async () => { postMessage(await abRealm()); };
+38
View File
@@ -281,6 +281,44 @@ await safe('surface.branding', () => Promise.all(['chrome://branding/locale/bran
noise('history_length', history.length);
noise('main_loop_ms', await new Promise(r => { const t = performance.now(); setTimeout(() => r(Math.round(performance.now() - t)), 20); }));
// ================================================================= AB (read by the A/B oracle only, never by the retail comparison)
// ab.poison: what the page reads of values a host may hold and the engine must never read: the zone, the language, the colour scheme, a
// user-installed canary font (scripts/ci_poison_host.py puts them on the oracle's runner and holds the engine's dumps to the declared identity).
// The probe between the two markers is self-contained: the negative control evaluates the same text in Playwright's own Firefox.
// ab.poison:begin
const abPoisonProbe = async () => {
const o = {}, f = (k, g) => { try { o[k] = g(); } catch (e) { o[k] = 'ERR ' + ((e && e.name) || ''); } };
const jan = new Date(Date.UTC(2026, 0, 15, 12)), jul = new Date(Date.UTC(2026, 6, 15, 12));
f('timezone', () => Intl.DateTimeFormat().resolvedOptions().timeZone);
f('offsets', () => [jan.getTimezoneOffset(), jul.getTimezoneOffset()]);
f('language', () => navigator.language);
f('languages', () => Array.from(navigator.languages));
f('intl_locale', () => Intl.DateTimeFormat().resolvedOptions().locale);
f('date_full', () => jan.toLocaleDateString(undefined, {dateStyle: 'full'}));
f('number', () => (1234567.891).toLocaleString());
f('dark', () => matchMedia('(prefers-color-scheme: dark)').matches);
// document.fonts.check answers true for a family nobody has (the specification: nothing to load), so it is recorded and the WIDTH decides
f('canary_check', () => document.fonts.check('12px ZZHostCanary'));
f('canary', () => {
const box = document.createElement('div'); box.style.cssText = 'position:absolute;left:-9999px;top:0;visibility:hidden;white-space:nowrap';
document.documentElement.appendChild(box);
const width = fam => { const e = document.createElement('span'); e.style.cssText = 'font:12px ' + fam; e.textContent = 'mmmmmmmmmmmm'; box.appendChild(e); const w = e.getBoundingClientRect().width; e.remove(); return w; };
const out = {with: [width('ZZHostCanary, monospace'), width('ZZHostCanary, serif')], without: [width('monospace'), width('serif')]};
box.remove(); out.present = out.with.some(w => Math.abs(w - 216) < 1); return out; }); // 12 boxes of 1.5 em at 12px: the canary's own width, whatever the fallbacks are
// the width of a text in each generic family: a host whose fontconfig prefers a user font for them answers that font's width
f('generic', () => {
const box = document.createElement('div'); box.style.cssText = 'position:absolute;left:-9999px;top:0;visibility:hidden;white-space:nowrap';
document.documentElement.appendChild(box);
const out = ['sans-serif', 'serif', 'monospace'].map(fam => { const e = document.createElement('span'); e.style.cssText = 'font:12px ' + fam; e.textContent = 'mmmmmmmmmmmm';
box.appendChild(e); const w = e.getBoundingClientRect().width; e.remove(); return w; });
box.remove(); return out; });
try { const c = new AudioContext(); o.audio = {sampleRate: c.sampleRate, maxChannelCount: c.destination.maxChannelCount}; try { c.close(); } catch (e) {} }
catch (e) { o.audio = 'ERR ' + ((e && e.name) || ''); }
return o;
};
// ab.poison:end
await safe('ab.poison', abPoisonProbe);
// ================================================================= DIAG (information, never compared)
// diag.*: why this host's WebGL is what it is (no WebGL2, no MSAA). Last, so its extra contexts
// cannot disturb anything measured above; each is lost again once read.
+386
View File
@@ -0,0 +1,386 @@
#!/usr/bin/env python3
"""The seeds that cover the personas the core can declare.
The core turns a seed into an identity (invisible_core._fpforge.profile.generate_profile) and the identity into
the prefs the engine is launched with (invisible_core.prefs.translate_profile_to_prefs). A page can only see what
those prefs make it see, so the values a seed can make a page read are the values of the prefs that VARY across
seeds. This computes them from the prefs themselves, never from a list of the tables:
* every seed 0..MAX_SEED-1 goes through generate_profile and translate_profile_to_prefs (en-US, one zone: neither
is a seed dimension);
* every pref whose value differs between two seeds must belong to a DIMENSION below (a group of prefs read
together: the renderer, the screen panel, the audio chain...) or be named in EXCLUDED with its reason. A pref
that varies and is in neither is an error, so a new pref of a later core cannot go uncovered unnoticed. A pref that
is a function of a dimension (the bar of a maximized window is of the panel) is in DERIVED instead: it is checked to
take one value per value of its dimension, and it is no part of the stored features;
* a dimension's value for a seed is the joint value of its prefs; the reachable values of a dimension are the
ones some seed in range produces.
From that, two sets of seeds (a greedy set cover, ties to the smallest seed, then a reverse delete of every seed
the rest does without):
final covers every reachable value of every dimension: the whole persona space the core declares;
candidate the smallest set that covers every webgl renderer and every DPR (exact: every set of that size is
searched, the smallest seeds win): what the candidate run of the A/B oracle visits.
The result is ci/persona-seeds.json, with the sha256 of the canonical JSON of its dimensions and features.
`check` recomputes everything and exits 1 with what changed: a change of the core's tables (or of the code that
reads them) is red until `write` has been run again.
python persona_cover.py write [--path ci/persona-seeds.json] [--max-seed 100000]
python persona_cover.py check [--path ...]
python persona_cover.py show [--path ...]
"""
from __future__ import annotations
import argparse
import hashlib
import itertools
import json
import os
import sys
from concurrent.futures import ProcessPoolExecutor
from pathlib import Path
ROOT = Path(__file__).resolve().parent.parent
DEFAULT_PATH = ROOT / "ci" / "persona-seeds.json"
FORMAT = "persona-seeds/1"
MAX_SEED = 100_000
#: Neither is a seed dimension (locale and zone come from the exit), so one value of each is used for every seed.
LOCALE = "en-US"
ZONE = "America/New_York"
P = "zoom.stealth."
#: dimension -> the prefs that are read together. A pref may be in more than one dimension (the DPR is in the panel and
#: in the scale). "webgl_renderer" is every webgl.* pref: they must be a function of the renderer (checked).
DIMENSIONS = {
"webgl_renderer": (P + "webgl.renderer",),
"gfx_feature_status": (P + "gfx.feature_status",),
"screen_panel": (P + "screen.width", P + "screen.height", P + "screen.avail_device_width",
P + "screen.avail_device_height", "layout.css.devPixelsPerPx"),
"dpr": ("layout.css.devPixelsPerPx", P + "screen.frame_border", P + "screen.popup_ui", P + "screen.popup_client_top"),
"cores": (P + "hw_concurrency",),
"audio": (P + "audio.sample_rate", P + "audio.output_latency_ms", P + "audio.max_channel_count"),
"codecs": ("media.av1.enabled", "media.encoder.webm.enabled", "media.mp4.enabled", "media.webm.enabled",
P + "media.decode_support"),
"dark_theme": ("ui.systemUsesDarkTheme", "layout.css.prefers-color-scheme.content-override"),
"render_noise": (P + "fpp.hw_seed",),
}
#: Dimensions that are not prefs: the label of the device the persona declares (the prefs carry only its blocklist
#: outcome, gfx_feature_status, which has fewer values than there are devices).
PROFILE_DIMENSIONS = ("gfx_device",)
ALL_DIMENSIONS = tuple(DIMENSIONS) + PROFILE_DIMENSIONS
#: Prefs that vary and are not covered, with the reason: a dimension with hundreds of values cannot be visited.
EXCLUDED = {
P + "media.enumeration_ms": "the time of the first enumerateDevices(): a draw from its own stream, hundreds of values, "
"no class of seeds to cover",
}
#: Prefs that are a function of a dimension: {pref: the dimension}. They are not part of the dimension's value (so the
#: stored features do not depend on which core emits them) and compute() CHECKS that, across the seeds, each takes exactly
#: one value per value of its dimension, like the webgl prefs per renderer. A derived pref the core does not emit at all is
#: fine: it is the pref of a core that comes later than the one in use (or earlier than the one that added it), and the pair
#: of cores must give the same file. maximized_ui is of the panel because the core declares the bar from the work area's
#: height as well as from the scale (declared_maximized_ui: compact when the work area is short in CSS px).
DERIVED = {
P + "screen.maximized_ui": "screen_panel",
}
#: What the candidate run visits: the smallest set that reaches every one of these dimensions' values.
CANDIDATE_DIMENSIONS = ("webgl_renderer", "dpr")
WEBGL = P + "webgl."
#: A value longer than this is shown as its sha256 prefix.
LONG = 40
def _short(value) -> str:
text = json.dumps(value, sort_keys=True)
if isinstance(value, str) and len(value) > LONG:
return "sha:" + hashlib.sha256(value.encode("utf-8")).hexdigest()[:10]
return text
def _dimension_value(prefs: dict, keys: tuple) -> str:
return "|".join("%s=%s" % (k.removeprefix(P), _short(prefs.get(k, "<absent>"))) for k in keys)
# -
# One seed, and a range of seeds (a worker computes a range).
def seed_features(seed: int) -> tuple:
"""(features of the seed, {pref: its value as JSON}). The features are {dimension: value}."""
from invisible_core._fpforge.profile import generate_profile
from invisible_core.prefs import translate_profile_to_prefs
profile = generate_profile(seed)
prefs = translate_profile_to_prefs(profile, locale=LOCALE, timezone=ZONE)
features = {dim: _dimension_value(prefs, keys) for dim, keys in DIMENSIONS.items()}
features["webgl_renderer"] = prefs[P + "webgl.renderer"] # readable: the whole string
features["gfx_device"] = profile.gpu.device or "<none>"
webgl = {k: json.dumps(v, sort_keys=True) for k, v in prefs.items() if k.startswith(WEBGL)}
features["_webgl"] = hashlib.sha256(json.dumps(webgl, sort_keys=True).encode()).hexdigest()[:12]
features["_derived"] = {k: json.dumps(prefs.get(k, "<absent>"), sort_keys=True) for k in DERIVED}
return features, {k: json.dumps(v, sort_keys=True) for k, v in prefs.items()}
def _range(bounds: tuple) -> tuple:
"""(features per seed, {pref: up to 3 distinct values}) for seeds lo..hi-1."""
lo, hi = bounds
features, seen = {}, {}
for seed in range(lo, hi):
f, prefs = seed_features(seed)
features[seed] = f
for k, v in prefs.items():
s = seen.setdefault(k, set())
if len(s) < 3:
s.add(v)
for k in set(seen) - set(prefs): # a pref this seed does not have varies too
seen[k].add("<absent>")
return features, seen
def check_derived(features: dict) -> None:
"""Raises when a DERIVED pref takes two values within one value of its dimension. features: {seed: {dimension: value,
"_derived": {pref: value}}}. A pref no seed has is skipped (a core that does not emit it)."""
for pref, dim in DERIVED.items():
seen = {}
for seed in sorted(features):
value = features[seed]["_derived"][pref]
if seen.setdefault(features[seed][dim], (value, seed))[0] != value:
first = seen[features[seed][dim]]
raise SystemExit("the derived pref %s is not a function of the dimension %s (seed %d: %s, seed %d: %s, "
"both with %s): it belongs to a wider dimension" % (
pref, dim, first[1], first[0], seed, value, features[seed][dim]))
def compute(max_seed: int = MAX_SEED, workers: int | None = None) -> dict:
"""The features of every seed 0..max_seed-1: {seed: {dimension: value}} (the dimensions of ALL_DIMENSIONS).
Raises when a pref varies across the seeds and is in no dimension and not in EXCLUDED or DERIVED, when a DERIVED
pref is not a function of its dimension, or when the webgl prefs are not a function of the renderer."""
workers = workers or max(1, min(os.cpu_count() or 1, 8))
step = max(1, -(-max_seed // (workers * 4)))
bounds = [(lo, min(lo + step, max_seed)) for lo in range(0, max_seed, step)]
if workers == 1:
parts = [_range(b) for b in bounds]
else:
with ProcessPoolExecutor(max_workers=workers) as pool:
parts = list(pool.map(_range, bounds))
features, seen = {}, {}
for f, s in parts:
features.update(f)
for k, vs in s.items():
seen.setdefault(k, set()).update(vs)
covered = {k for keys in DIMENSIONS.values() for k in keys}
varying = sorted(k for k, vs in seen.items() if len(vs) > 1)
loose = [k for k in varying if k not in covered and k not in EXCLUDED and k not in DERIVED and not k.startswith(WEBGL)]
if loose:
raise SystemExit("prefs that vary across seeds and belong to no dimension and are not excluded: %s\n"
"add each to a DIMENSION, to DERIVED (a function of one) or to EXCLUDED (with the reason) in "
"scripts/persona_cover.py" % loose)
check_derived(features)
byrenderer = {}
for seed in sorted(features):
f = features[seed]
if byrenderer.setdefault(f["webgl_renderer"], f["_webgl"]) != f["_webgl"]:
raise SystemExit("the webgl prefs are not a function of the renderer (seed %d, %s): split the dimension"
% (seed, f["webgl_renderer"]))
del f["_webgl"]
for f in features.values():
del f["_derived"]
stale = [k for k in EXCLUDED if k not in seen or len(seen[k]) < 2]
if stale:
raise SystemExit("excluded prefs that no longer vary: %s: remove them from EXCLUDED" % stale)
return features
# -
# The covers.
def reachable(features: dict, dims=ALL_DIMENSIONS) -> dict:
"""{dimension: sorted reachable values}."""
out = {d: set() for d in dims}
for f in features.values():
for d in dims:
out[d].add(f[d])
return {d: sorted(v) for d, v in out.items()}
def counts(features: dict) -> dict:
out = {d: {} for d in ALL_DIMENSIONS}
for f in features.values():
for d in ALL_DIMENSIONS:
out[d][f[d]] = out[d].get(f[d], 0) + 1
return {d: dict(sorted(c.items())) for d, c in out.items()}
def _elements(f: dict, dims) -> frozenset:
return frozenset((d, f[d]) for d in dims)
def greedy_cover(features: dict, dims=ALL_DIMENSIONS) -> list:
"""Greedy set cover over the (dimension, value) pairs, ties to the smallest seed. Seeds that produce the same
pairs are one candidate (their smallest)."""
first = {}
for seed in sorted(features):
first.setdefault(_elements(features[seed], dims), seed)
todo = set().union(*first)
chosen = []
while todo:
best = max(sorted(first.items(), key=lambda kv: kv[1]), key=lambda kv: len(kv[0] & todo))
chosen.append(best[1])
todo -= best[0]
return chosen
def reverse_delete(features: dict, seeds: list, dims=ALL_DIMENSIONS) -> list:
"""Drops, last chosen first, every seed whose pairs the others cover."""
keep = list(seeds)
for seed in reversed(seeds):
rest = [s for s in keep if s != seed]
if rest and _elements(features[seed], dims) <= set().union(*(_elements(features[s], dims) for s in rest)):
keep = rest
return sorted(keep)
def final_cover(features: dict) -> list:
return reverse_delete(features, greedy_cover(features))
def candidate_cover(features: dict, dims=CANDIDATE_DIMENSIONS) -> list:
"""The smallest set covering every value of dims: the exact minimum (every combination of the seeds that are the
smallest of their kind is tried, size by size), the lexicographically smallest seeds of that size."""
kinds = {}
for seed in sorted(features):
kinds.setdefault(_elements(features[seed], dims), seed)
todo = set().union(*kinds)
seeds = sorted(kinds.values())
for size in range(1, len(seeds) + 1):
for combo in itertools.combinations(seeds, size):
if set().union(*(_elements(features[s], dims) for s in combo)) >= todo:
return list(combo)
raise AssertionError("unreachable: all the seeds cover everything")
def covers(features: dict, seeds, dims=ALL_DIMENSIONS) -> list:
"""The (dimension, value) pairs of the reachable space that `seeds` do not reach."""
want = set().union(*(_elements(f, dims) for f in features.values()))
got = set().union(*(_elements(features[s], dims) for s in seeds)) if seeds else set()
return sorted(want - got)
# -
# The file.
def canonical(document) -> str:
return json.dumps(document, sort_keys=True, separators=(",", ":"), ensure_ascii=True)
def build(features: dict, max_seed: int) -> dict:
import invisible_core
final, candidate = final_cover(features), candidate_cover(features)
stored = sorted(set(final) | set(candidate))
dimensions = reachable(features)
kept = {str(s): features[s] for s in stored}
dpr = {str(s): float(json.loads(features[s]["dpr"].split("|")[0].split("=", 1)[1])) for s in stored}
sha = hashlib.sha256(canonical({"dimensions": dimensions, "features": kept}).encode("utf-8")).hexdigest()
return {
"format": FORMAT, "core_version": invisible_core.__version__, "max_seed": max_seed,
"candidate": candidate, "final": final, "dpr": dpr, "features": kept, "dimensions": dimensions,
"counts": counts(features), "excluded": dict(sorted(EXCLUDED.items())), "sha256": sha,
}
def render(document: dict) -> bytes:
return (json.dumps(document, sort_keys=True, indent=1, ensure_ascii=True) + "\n").encode("utf-8")
def write(path: Path = DEFAULT_PATH, max_seed: int = MAX_SEED, workers: int | None = None) -> dict:
document = build(compute(max_seed, workers), max_seed)
Path(path).write_bytes(render(document))
return document
def differences(stored: dict, fresh: dict) -> list:
"""What differs between the file and a recompute, as lines (empty when they agree). core_version alone is no
difference: the same values from another version of the core are the same personas."""
out = []
for key in sorted(set(stored) | set(fresh)):
if key == "core_version" or stored.get(key) == fresh.get(key):
continue
a, b = stored.get(key), fresh.get(key)
if key == "dimensions" and isinstance(a, dict) and isinstance(b, dict):
for dim in sorted(set(a) | set(b)):
gone = sorted(set(a.get(dim, [])) - set(b.get(dim, [])))
new = sorted(set(b.get(dim, [])) - set(a.get(dim, [])))
if gone or new:
out.append("dimension %s: %d values no seed reaches any more %s; %d new %s"
% (dim, len(gone), gone[:3], len(new), new[:3]))
elif key == "features" and isinstance(a, dict) and isinstance(b, dict):
for seed in sorted(set(a) | set(b), key=int):
if a.get(seed) != b.get(seed):
moved = sorted(d for d in set(a.get(seed) or {}) | set(b.get(seed) or {})
if (a.get(seed) or {}).get(d) != (b.get(seed) or {}).get(d))
out.append("seed %s: %s changed" % (seed, ", ".join(moved) or "is not in one of the two"))
else:
out.append("%s: %s -> %s" % (key, json.dumps(a)[:160], json.dumps(b)[:160]))
return out
def check(path: Path = DEFAULT_PATH, workers: int | None = None) -> list:
stored = json.loads(Path(path).read_text(encoding="utf-8"))
fresh = build(compute(stored["max_seed"], workers), stored["max_seed"])
lines = differences(stored, fresh)
if not lines and Path(path).read_bytes() != render(fresh):
lines.append("the file is not the canonical rendering of its own content: run `write`")
return lines
def load(path: Path = DEFAULT_PATH) -> dict:
return json.loads(Path(path).read_text(encoding="utf-8"))
def load_seeds(kind: str = "candidate", path: Path = DEFAULT_PATH) -> list:
"""The seeds of `kind` ("candidate" or "final"), ascending."""
document = load(path)
if kind not in ("candidate", "final"):
raise ValueError("kind must be 'candidate' or 'final', not %r" % (kind,))
return sorted(document[kind])
def load_visits(kind: str = "candidate", path: Path = DEFAULT_PATH) -> list:
"""[(seed, the seed's own DPR)] of `kind`, ascending."""
document = load(path)
return [(s, document["dpr"][str(s)]) for s in load_seeds(kind, path)]
def show(document: dict) -> str:
lines = ["core %s, seeds 0..%d, sha256 %s" % (document["core_version"], document["max_seed"] - 1, document["sha256"][:16])]
for kind in ("candidate", "final"):
lines.append("%s (%d): %s" % (kind, len(document[kind]), document[kind]))
for dim, values in document["dimensions"].items():
lines.append("%-20s %2d values" % (dim, len(values)))
return "\n".join(lines)
def main(argv=None) -> int:
ap = argparse.ArgumentParser(description=__doc__.split("\n")[0])
ap.add_argument("cmd", choices=("write", "check", "show"))
ap.add_argument("--path", type=Path, default=DEFAULT_PATH)
ap.add_argument("--max-seed", type=int, default=MAX_SEED)
ap.add_argument("--workers", type=int)
args = ap.parse_args(argv)
if args.cmd == "show":
print(show(load(args.path)))
return 0
if args.cmd == "write":
print(show(write(args.path, args.max_seed, args.workers)))
return 0
lines = check(args.path, args.workers)
for line in lines:
print("CHANGED " + line)
print("PERSONA SEEDS %s" % ("OK" if not lines else "STALE: run `python scripts/persona_cover.py write` and commit ci/persona-seeds.json"))
return 1 if lines else 0
if __name__ == "__main__":
sys.exit(main())
+25 -4
View File
@@ -10,6 +10,12 @@ red when our engine does not idle where stock does. Profile P4: a user journey o
(tests/fakeweb/journey_site.py); stock Firefox runs first, then our engine, and the verdict compares every step field by
field (ok, url, title, marker, cookies, history length, open pages, idle, the step's own values). --repetitions is the
number of walks (P4: default 1). The stock client drives both.
The bound of a P2 wait: a P2 page is finite (MAX_DELAY_MS, 3000 ms, is its longest response) and networkidle needs 500 ms of quiet,
so the 10 s default is a cap with margin, never to be read as a cause. A stock cell that does not idle is a broken control or, by
pages.json `stock_firefox_may_lose` (a request the page itself aborts, which stock may never report the end of), stock unsettled:
not red, and ours is then judged against the outcome the page declares. The report keeps `stock_unsettled`, `platform` and the
`stock_unsettled_rate` per pattern, so the rate per platform can be followed across runs from the artifacts.
"""
from __future__ import annotations
@@ -101,16 +107,31 @@ def main(argv=None):
if args.no_stock: # stock is what pages.json says it is
stock = [dict(c, idle=declared.get(c["pattern"], "idle") == "idle") for c in candidate]
fails, broken = profile_p2.verdict(candidate, stock, declared)
report = {"profile": args.profile, "patterns": patterns, "repetitions": args.repetitions,
"candidate": candidate, "stock": stock, "fails": fails, "broken_control": broken}
may_lose = pages.get("stock_firefox_may_lose", {})
fails, broken, unsettled = profile_p2.verdict(candidate, stock, declared, may_lose)
return finish_p2(args, patterns, candidate, stock, fails, broken, unsettled, may_lose)
def finish_p2(args, patterns, candidate, stock, fails, broken, unsettled, may_lose):
"""The report of a P2 run (written to --out), the lines printed, and the exit code: 1 on a fail or a broken control, never on unsettled alone."""
by_key = {(c["round"], c["pattern"], c["canary"], c["after"]): c for c in stock}
unsettled_cells = [{"round": key[0], "pattern": key[1], "in_flight": [r.get("url") for r in by_key[key].get("in_flight") or []]}
for key, _err in unsettled]
rate = {pattern: {"unsettled": sum(1 for u in unsettled_cells if u["pattern"] == pattern),
"rounds": sum(1 for c in stock if c["pattern"] == pattern and not c["canary"])}
for pattern in may_lose}
report = {"profile": args.profile, "patterns": patterns, "repetitions": args.repetitions, "platform": sys.platform,
"candidate": candidate, "stock": stock, "fails": fails, "broken_control": broken,
"stock_unsettled": unsettled_cells, "stock_unsettled_rate": rate}
if args.out:
pathlib.Path(args.out).write_text(json.dumps(report, indent=1), encoding="utf-8")
for key, err in fails:
print("FAIL round %d %s%s: %s" % (key[0], key[1], " (canary after %s)" % key[3] if key[2] else "", err))
for key, err in broken:
print("BROKEN CONTROL stock did not idle on %s round %d: %s" % (key[1], key[0], err))
print("cells: %d, fails: %d, broken controls: %d" % (len(candidate), len(fails), len(broken)))
for cell in unsettled_cells:
print("STOCK UNSETTLED %s round %d: %s (pages.json stock_firefox_may_lose)" % (cell["pattern"], cell["round"], ", ".join(map(str, cell["in_flight"]))))
print("cells: %d, fails: %d, broken controls: %d, stock unsettled: %d" % (len(candidate), len(fails), len(broken), len(unsettled_cells)))
return 1 if (fails or broken) else 0
@@ -0,0 +1,415 @@
"""The argument of `page.evaluate(fn, arg)` and its kin, on its way into the page.
The client sends `{"value": <tagged>, "handles": [{guid}, ...]}`. THE ONE PLACE it is read for the caller's code: `_run_callers_code`, the element-scoped
calls, `wait_for_function` and the result of an exposed function all take it through `Argument`.
⛔ UNTIL THIS MODULE, THE SERVER KEPT A NUMBER, A STRING, A BOOLEAN, AN ARRAY AND AN OBJECT AND MADE EVERYTHING ELSE `null`: a handle (`h`), a date
(`d`), a URL (`u`), a regular expression (`r`), an error (`e`), a typed array (`ta`), a BigInt (`bi`), a reference to an object already seen (`ref`:
a repeat and a cycle), `undefined`, and `-0` (the Python client sends `-0` for EVERY float `0.0`). A bare Python `nan` went into the JSON. The call
went on with the wrong argument and answered.
What stock Playwright 1.61 does (driver bundle `coreBundle.js`, by function name):
* NODE SIDE. `parseArgument` -> `parseSerializedValue` builds the real values; `evaluateExpression` serialises them again with `serializeAsCallArgument`
(a number, a string and a boolean lose their tag, a Date is `{d: toJSON()}`, which is milliseconds, an Error's stack is normalised) and takes each
handle through `adoptIfNeeded`. A primitive handle falls through as its value (`fallThrough: handle._value`).
* The handle errors are thrown there: a handle that is not an element and is of another context or world is `JSHandles can be evaluated only in the
context they were created!`; an element of another frame or world is adopted (`Page.adoptNode`), and if the adoption answers nothing it is `Unable to
adopt element handle from a different document`; a disposed or unknown guid is `arg.handles[0]: no object with guid <guid>` (the path starts with the
parameter's name).
* PAGE SIDE. `UtilityScript.evaluate` runs `parseEvaluationResultValue` on every argument, BEFORE it evaluates the caller's text.
HERE, the same two steps. A tree of plain JSON (number, string, boolean, null, array, object; no reference, no handle, nothing special) goes as the
protocol value it always went as. A top-level NaN, Infinity, -Infinity or -0 is the engine's `unserializableValue`; a top-level `undefined` is an
argument with no `value`; a top-level object handle is its `objectId`. EVERYTHING ELSE is decoded in the page by one extra `Runtime.callFunction` in the
same caller context, whose declaration is stock's own `parseEvaluationResultValue` (below, verbatim: a test compares it with the text the core ships
and the bundle's), called with the spec and the handles' objects; what it made is the ONE argument of the unchanged `(f, ...a) => f(...a)` and is
released after the call. The decoder runs before the caller's function and leaves no global.
LIMITS, SAID. A BigInt as the WHOLE argument cannot be decoded here: the decoder would have to return a BigInt, and the protocol's JSON has no BigInt
(inside an array or an object it is fine). A utility-world value that is not a node (the properties `get_property` and `get_property_list` hand back)
cannot cross to the caller's world, which stock never needed because its handles are all of one world.
"""
from __future__ import annotations
import re
from typing import Any, Callable, Dict, List, Optional
from .dispatcher import ProtocolException
#: The text stock throws, node side.
NOT_IN_THE_CONTEXT = "JSHandles can be evaluated only in the context they were created!"
NOT_ADOPTED = "Unable to adopt element handle from a different document"
#: Playwright's `parseEvaluationResultValue`, `base64ToTypedArray` and the typed-array table, VERBATIM from the utility script the core ships
#: (`invisible_core/juggler/injected.js`, the same text as the driver bundle's `packages/isomorphic/utilityScriptSerializers.ts`).
_STOCK = r'''const typedArrayConstructors = {
i8: Int8Array,
ui8: Uint8Array,
ui8c: Uint8ClampedArray,
i16: Int16Array,
ui16: Uint16Array,
i32: Int32Array,
ui32: Uint32Array,
// TODO: add Float16Array once it's in baseline
f32: Float32Array,
f64: Float64Array,
bi64: BigInt64Array,
bui64: BigUint64Array
};
function base64ToTypedArray(base64, TypedArrayConstructor) {
const binary = atob(base64);
const bytes = new Uint8Array(binary.length);
for (let i = 0; i < binary.length; i++)
bytes[i] = binary.charCodeAt(i);
return new TypedArrayConstructor(bytes.buffer);
}
function parseEvaluationResultValue(value, handles = [], refs = /* @__PURE__ */ new Map()) {
if (Object.is(value, void 0))
return void 0;
if (typeof value === "object" && value) {
if ("ref" in value)
return refs.get(value.ref);
if ("v" in value) {
if (value.v === "undefined")
return void 0;
if (value.v === "null")
return null;
if (value.v === "NaN")
return NaN;
if (value.v === "Infinity")
return Infinity;
if (value.v === "-Infinity")
return -Infinity;
if (value.v === "-0")
return -0;
return void 0;
}
if ("d" in value) {
return new Date(value.d);
}
if ("u" in value)
return new URL(value.u);
if ("bi" in value)
return BigInt(value.bi);
if ("e" in value) {
const error = new Error(value.e.m);
error.name = value.e.n;
error.stack = value.e.s;
return error;
}
if ("r" in value)
return new RegExp(value.r.p, value.r.f);
if ("a" in value) {
const result = [];
refs.set(value.id, result);
for (const a of value.a)
result.push(parseEvaluationResultValue(a, handles, refs));
return result;
}
if ("o" in value) {
const result = {};
refs.set(value.id, result);
for (const { k, v } of value.o) {
if (k === "__proto__")
continue;
result[k] = parseEvaluationResultValue(v, handles, refs);
}
return result;
}
if ("h" in value)
return handles[value.h];
if ("ta" in value)
return base64ToTypedArray(value.ta.b, typedArrayConstructors[value.ta.k]);
if ("ab" in value)
return base64ToTypedArray(value.ab.b, Uint8Array).buffer;
}
return value;
}'''
#: The declaration of the one extra call: the spec first, then the objects of the handles, in the order the spec names them (`{"h": i}` is the
#: i-th). Run in the caller's context, by reference.
DECODER = "(spec, ...handles) => {\n" + _STOCK + "\nreturn parseEvaluationResultValue(spec, handles);\n}"
#: THE VALUE TAGS THIS MODULE HANDLES, each one a node `_to_spec` knows. They are the keys of the driver's protocol validator for a serialized value (`scheme.SerializedValue`
#: in `coreBundle.js`: `n b s v d u bi ta e r a o h ref`; `id` only marks an array or an object and is no value) and one more, `ab` (an ArrayBuffer): the validator
#: does not list it, the page side of stock (`parseEvaluationResultValue`, embedded above) decodes it, so it is passed to the decoder as it came. A test reads the
#: validator from the installed driver and compares it with this set.
VALUE_TAGS = ("n", "b", "s", "v", "d", "u", "bi", "ab", "ta", "e", "r", "a", "o", "h", "ref")
_SPECIAL_NUMBERS = ("NaN", "Infinity", "-Infinity", "-0")
_ISO_MILLISECONDS = re.compile(r"^(\d{4,6}-\d\d-\d\dT\d\d:\d\d:\d\d)(?:\.(\d+))?Z$")
_BIGINT_REMOTE = re.compile(r"^-?\d+n$")
def split(raw: Any):
"""`(tagged value, handle channels)` of what the client sent: the envelope `{value, handles}`, or a bare tagged value, or nothing."""
if isinstance(raw, dict) and "value" in raw and "handles" in raw:
return raw["value"], list(raw.get("handles") or [])
return raw, []
def refuse_handles(raw: Any, what: str, where: str) -> None:
"""A call whose argument stays a plain value (it goes into the page as JSON, through a command that has no object to carry) says so when
the caller passed a handle, instead of sending `null` in its place."""
handles = split(raw)[1]
if handles:
raise ProtocolException(
"%s cannot carry a JSHandle: it is read in %s, where the handle's object does not exist, and used to arrive as null. Pass the "
"handle's value (json_value) or its properties instead" % (what, where))
def _is_plain(node: Any) -> bool:
if not isinstance(node, dict):
return True
if "ref" in node or "h" in node:
return False
for tag in ("n", "s", "b"):
if tag in node:
value = node[tag]
return not (isinstance(value, float) and (value != value or value in (float("inf"), float("-inf"))))
if "v" in node:
return node["v"] == "null"
if "a" in node:
return all(_is_plain(x) for x in node["a"])
if "o" in node:
return all(entry["k"] != "__proto__" and _is_plain(entry["v"]) for entry in node["o"])
return False
def _plain(node: Any) -> Any:
if not isinstance(node, dict):
return node
for tag in ("n", "s", "b"):
if tag in node:
return node[tag]
if "v" in node:
return None
if "a" in node:
return [_plain(x) for x in node["a"]]
return {entry["k"]: _plain(entry["v"]) for entry in node["o"]}
def _milliseconds(iso: Any) -> Any:
"""A date as the node side re-emits it: `Date.prototype.toJSON`, milliseconds, truncated."""
found = _ISO_MILLISECONDS.match(iso) if isinstance(iso, str) else None
if not found:
return iso
return "%s.%sZ" % (found.group(1), ((found.group(2) or "") + "000")[:3])
def _error(entry: Dict) -> Dict:
"""`{e: {n, m, s}}` as `serializeAsCallArgument` emits it: the stack stays when it starts with `name: message`, else the head is put on it."""
name, message, stack = entry.get("n"), entry.get("m"), entry.get("s")
name = "" if name is None else str(name)
message = "" if message is None else str(message)
stack = "" if stack is None else str(stack)
head = name + ": " + message
return {"e": {"n": name, "m": message, "s": stack if stack.startswith(head) else head + "\n" + stack}}
def _argument_of(remote: Dict) -> Dict:
"""A RemoteObject as the engine's `CallFunctionArgument`."""
if remote.get("objectId"):
return {"objectId": remote["objectId"]}
if "unserializableValue" in remote:
return {"unserializableValue": remote["unserializableValue"]}
if "value" in remote:
return {"value": remote["value"]}
return {}
class Argument:
"""One argument, resolved against the caller's world `context` of the frame `frame_id` and ready to be the last argument of a call there.
Built before the caller's code runs (the handle errors are stock's, thrown before the script), so the code never runs on a refused argument. The
one extra command, the decoder, is made at `call_argument()` and once: a poll asks it every turn and gets the same object. `release()` lets go
of what this made (the decoded object and the copies of the elements it carried) and nothing of the caller's own handles; it is safe twice."""
def __init__(self, injected, context: str, frame_id: Optional[str], raw: Any, lookup: Optional[Callable[[str], Any]] = None, *,
what: str = "arg", handles_allowed: bool = True) -> None:
self.injected = injected
self.context = context
self.frame_id = frame_id
self.lookup = lookup
self.what = what
self.handles_allowed = handles_allowed
tagged, self._channels = split(raw)
self._plain: Any = None
self._spec: Any = None
self._root_is_handle = False
self._objects: List[str] = []
self._by_guid: Dict[str, Any] = {}
self._copies: List[str] = []
self._decoded: Optional[str] = None
self._argument: Optional[Dict] = None
self._is_plain = _is_plain(tagged)
try:
if self._is_plain:
self._plain = _plain(tagged)
else:
self._root_is_handle = isinstance(tagged, dict) and "h" in tagged and "ref" not in tagged
self._spec = self._to_spec(tagged)
if isinstance(self._spec, dict) and set(self._spec) == {"bi"}:
raise ProtocolException(
"a BigInt as the whole argument cannot be handed to the page: the engine's protocol carries no BigInt. Put it in an "
"array or an object, or pass it as a string")
except BaseException:
self.release()
raise
# ── the spec: what the page side reads ───────────────────────────────────
def _to_spec(self, node: Any) -> Any:
if not isinstance(node, dict):
return node
if "ref" in node:
return {"ref": node["ref"]}
if "n" in node:
number = node["n"]
if isinstance(number, float) and number != number:
return {"v": "NaN"}
if isinstance(number, float) and number in (float("inf"), float("-inf")):
return {"v": "Infinity" if number > 0 else "-Infinity"}
return number
if "s" in node:
return node["s"]
if "b" in node:
return node["b"]
if "v" in node:
return {"v": node["v"]}
if "d" in node:
return {"d": _milliseconds(node["d"])}
if "u" in node:
return {"u": node["u"]}
if "bi" in node:
return {"bi": node["bi"]}
if "e" in node:
return _error(node["e"])
if "r" in node:
return {"r": {"p": node["r"].get("p"), "f": node["r"].get("f")}}
if "ta" in node:
return {"ta": {"b": node["ta"]["b"], "k": node["ta"]["k"]}}
if "ab" in node:
return {"ab": node["ab"]}
if "a" in node:
spec = {"a": [self._to_spec(x) for x in node["a"]]}
if "id" in node:
spec["id"] = node["id"]
return spec
if "o" in node:
spec = {"o": [{"k": entry["k"], "v": self._to_spec(entry["v"])} for entry in node["o"]]}
if "id" in node:
spec["id"] = node["id"]
return spec
if "h" in node:
return self._handle(node["h"])
raise ProtocolException("Attempting to deserialize unexpected value: %r" % (node,))
# ── the handles ──────────────────────────────────────────────────────────
def _handle(self, index: int) -> Any:
"""`{"h": position}` (the position among the objects the decoder gets), or the value of a primitive handle."""
try:
channel = self._channels[index]
except (IndexError, TypeError):
raise ProtocolException("%s.handles[%s]: no object with guid undefined" % (self.what, index)) from None
guid = channel.get("guid") if isinstance(channel, dict) else None
if guid not in self._by_guid:
self._by_guid[guid] = self._resolve(index, guid)
kind, value = self._by_guid[guid]
if kind == "inline":
return value
return {"h": value}
def _resolve(self, index: int, guid: Optional[str]):
if not self.handles_allowed:
raise ProtocolException(
"%s carries a JSHandle, which cannot be delivered here: its object lives in the caller's world, and this answer is read in the "
"page's own" % self.what)
missing = ProtocolException("%s.handles[%d]: no object with guid %s" % (self.what, index, guid))
try:
handle = self.lookup(guid) if self.lookup is not None else None
except ProtocolException:
handle = None
if handle is None or getattr(handle, "disposed", False):
raise missing
frame = getattr(handle, "frame", None)
if frame is None:
raise missing
frame_id = frame.frame_id
if getattr(handle, "world", "utility") == "caller":
if not handle.object_id:
return ("inline", self._primitive(handle.remote or {}))
held_in = getattr(handle, "context", None)
if frame_id != self.frame_id or (held_in is not None and held_in != self.context):
raise ProtocolException(NOT_IN_THE_CONTEXT)
return ("object", self._place(handle.object_id))
if not getattr(handle, "node", True):
raise ProtocolException(NOT_IN_THE_CONTEXT)
if frame_id == self.frame_id:
copy = self.injected.node_to_caller(self.frame_id, handle.object_id)
else:
road = self.injected.adopt(frame_id, handle.object_id, into=self.frame_id)
if not road:
raise ProtocolException(NOT_ADOPTED)
try:
copy = self.injected.node_to_caller(self.frame_id, road)
finally:
self.injected.dispose(self.frame_id, road)
if not copy:
raise ProtocolException(NOT_ADOPTED)
self._copies.append(copy)
return ("object", self._place(copy))
def _place(self, object_id: str) -> int:
self._objects.append(object_id)
return len(self._objects) - 1
@staticmethod
def _primitive(remote: Dict) -> Any:
"""A primitive of the caller's world as a node of the spec: stock's `fallThrough: handle._value`."""
special = remote.get("unserializableValue")
if special in _SPECIAL_NUMBERS:
return {"v": special}
if isinstance(special, str) and _BIGINT_REMOTE.match(special):
return {"bi": special[:-1]}
if "value" in remote:
value = remote["value"]
if value is None:
return {"v": "null"}
if isinstance(value, float) and value != value:
return {"v": "NaN"}
return value
return {"v": "undefined"}
# ── the call ─────────────────────────────────────────────────────────────
def call_argument(self) -> Dict:
"""The engine's `CallFunctionArgument` for this argument. The decoder is called here, once."""
if self._argument is None:
self._argument = self._build()
return self._argument
def _build(self) -> Dict:
if self._is_plain:
return {"value": self._plain}
spec = self._spec
if self._root_is_handle and isinstance(spec, dict) and set(spec) == {"h"}:
return {"objectId": self._objects[spec["h"]]}
if isinstance(spec, dict) and set(spec) == {"v"}:
if spec["v"] in _SPECIAL_NUMBERS:
return {"unserializableValue": spec["v"]}
return {"value": None} if spec["v"] == "null" else {}
if not isinstance(spec, dict):
return {"value": spec}
decoded = self.injected.call_raw(
self.context, DECODER, [{"value": spec}] + [{"objectId": o} for o in self._objects], by_value=False)
if decoded.get("objectId"):
self._decoded = decoded["objectId"]
return _argument_of(decoded)
def release(self) -> None:
decoded, copies = self._decoded, self._copies
self._decoded, self._copies = None, []
if decoded:
self.injected.release(self.context, decoded)
for copy in copies:
self.injected.release(self.context, copy)
@@ -85,7 +85,12 @@ def _as_script(expression: str) -> str:
def _deserialize(value: Any) -> Any:
"""The tagged union Playwright sends for an ARGUMENT, back to a value."""
"""The tagged union Playwright sends for an ARGUMENT, back to a plain value.
⛔ ONLY FOR THE CONSUMERS THAT CARRY THEIR VALUE AS JSON (an event's init, an expected value): the argument of the caller's code is
`_arguments.Argument`, which keeps what this cannot (a handle, a date, `undefined`, a reference). `undefined` is `None` here because a
JSON value has no `undefined`; `-0` is `-0.0`, which JSON does carry (it was `None` until the Python client's `0.0` came through here).
"""
if not isinstance(value, dict):
return value
if "value" in value and "handles" in value:
@@ -96,7 +101,7 @@ def _deserialize(value: Any) -> Any:
return convert(value[tag])
if "v" in value:
return {"null": None, "undefined": None, "NaN": float("nan"),
"Infinity": float("inf"),
"Infinity": float("inf"), "-0": -0.0,
"-Infinity": float("-inf")}.get(value["v"])
if "a" in value:
return [_deserialize(x) for x in value["a"]]
+42 -3
View File
@@ -62,8 +62,6 @@ OUTSIDE = {
"clockRunFor": "clock",
"clockSetFixedTime": "clock",
"clockSetSystemTime": "clock",
# the streamed upload path - set_input_files with local paths works
"createTempFiles": "the streamed upload path - set_input_files with local paths works",
# recorder
"cancelPickLocator": "recorder",
"createSelectorForTest": "recorder",
@@ -103,7 +101,6 @@ OUTSIDE = {
"tracingStarted": "tracing",
"tracingStop": "tracing",
"tracingStopChunk": "tracing",
"write": "tracing",
"zip": "tracing",
# video annotations. ⛔ `screencastStart` and `screencastStop` are NOT
# here any more: since the engine's screencast came back (firefox-28) the
@@ -218,3 +215,45 @@ def refusal(operation):
"invisible_playwright does not implement: the package covers the "
"automation core, and " + feature + " is outside it by decision, "
"not by omission. See 32-stacco-da-playwright.md section 5.4.")
#: ⛔ A PARAMETER OF A SERVED OPERATION THAT IS REFUSED, keyed by (operation, parameter), and the sentence a caller reads.
#: The operations above are refused whole; these are refused one parameter (or one value of it) at a time, and the call
#: without them is served. They are raised in `server.py` by `_refuse_parameter(operation, parameter)`, the one function
#: that reads this table, and `tests/test_every_refusal_is_declared.py` holds the two sides to each other.
#:
#: ⛔ WHY THESE FIVE. Stock Playwright honours `mask`, `style` and `animations="disabled"` by MODIFYING THE PAGE (an overlay,
#: an injected `<style>`, animations finished or cancelled) before the picture and putting it back after. This package does
#: not touch a page to photograph it, and until now it did not read them either: the call succeeded and the picture was as
#: if they had not been written, which a caller cannot see. `caret="initial"` asks for the text caret to be drawn, and the
#: engine never draws it (the capture does not set the flag that draws it), so the picture it takes is the one `"hide"`
#: asks for, which is also Playwright's default: `"hide"` and an absent `caret` are served. `omitBackground` with png is
#: Firefox's own `Not implemented` in stock (`FFPage.setBackgroundColor`), word for word; with jpeg stock does nothing and
#: neither do we.
REFUSED_PARAMETERS = {
("screenshot", "mask"):
"screenshot(mask=...) is not served: Playwright covers the masked elements by modifying the page (an overlay is "
"put on it before the picture), and this package does not touch a page to take a picture. maskColor goes with "
"mask and is refused with it. Hide the elements yourself before the screenshot (for example set their "
"visibility to hidden in your own script) and restore them after.",
("screenshot", "style"):
"screenshot(style=...) is not served: Playwright applies it by modifying the page (a <style> element is "
"injected before the picture and removed after), and this package does not touch a page to take a picture. Add "
"the style yourself with page.add_style_tag() before the screenshot and remove the element it returns after.",
("screenshot", "animations"):
'screenshot(animations="disabled") is not served: Playwright does it by modifying the page (the finite '
"animations are finished and the infinite ones cancelled), and this package does not touch a page to take a "
"picture. Wait for the animations to end, or pause them in your own script (document.getAnimations()), before "
'the screenshot. animations="allow" is what is served.',
("screenshot", "caret"):
'screenshot(caret="initial") is not served: it asks for the text caret to be drawn in the picture, and the '
'engine never draws it (the picture is the one caret="hide" asks for, which is the default of Playwright). Leave '
'caret out or pass "hide".',
("screenshot", "omitBackground"):
"Not implemented",
}
def parameter_refusal(operation, parameter):
"""The sentence for a refused (operation, parameter): `KeyError` for one that is not declared."""
return REFUSED_PARAMETERS[(operation, parameter)]
+31 -11
View File
@@ -22,9 +22,12 @@ used to answer, carried over unchanged):
* NOT `Mouse.move`: an explicit move is the caller's. (The in-process client
marks its own with `humanise`, see `_cursor._wrap_mouse_move`; a client that
does not say so is answered with exactly the point it named.)
* NOT the actions of an ElementHandle (they name a node, never a selector, and
the in-process client never walked onto them either) and NOT `dragAndDrop`,
whose travel the core's `Actions` already draws.
* `ElementHandle.click / dblclick / hover / tap / check / uncheck` (and so
`set_checked`): the same walk, onto the node the handle already names
(`act(..., element=)`: the node is not looked up again and is not disposed).
One click path is one fingerprint, so a handle click and a selector click
arrive as the same kind of stroke;
* NOT `dragAndDrop`, whose travel the core's `Actions` already draws.
HOW IT STAYS THE SAME AS THE CLIENT WAS. The stroke generator, the planners
(`_behaviour`) and the discipline events are delivered under (`Pacer`) are the
@@ -391,9 +394,14 @@ class Pointer:
# -- the probes --------------------------------------------------------
def _element_box(self, frame_id: str, selector: str) -> Tuple[Optional[str], Optional[dict]]:
def _element_box(self, frame_id: str, selector: str,
element: Optional[str] = None) -> Tuple[Optional[str], Optional[dict]]:
"""Resolve the element and its box, or (None, None). Never raises.
``element`` is a node the caller already holds (an ElementHandle's): it is
measured as it is, never looked up again from ``selector``, and it is not
ours to dispose.
Deliberately non-blocking and deliberately forgiving: this is a hint
used to aim a mouse path, never a correctness step. It resolves the
element if it is already there and gives up otherwise, so it can
@@ -401,6 +409,12 @@ class Pointer:
failing one - the action itself still does its own waiting and raises
its own errors.
"""
if element is not None:
try:
box = self.injected.bounding_box(frame_id, element)
except _PROBE_ERRORS:
return None, None # the handle's node is gone: the action meets that itself
return (element, box) if box else (None, None)
try:
handle = self.injected.query_selector(frame_id, selector)
except _PROBE_ERRORS:
@@ -442,10 +456,11 @@ class Pointer:
return False
def _choose_landing(self, frame_id: str, selector: str,
position: Optional[dict]) -> Optional[_Aim]:
position: Optional[dict],
element: Optional[str] = None) -> Optional[_Aim]:
"""Pick the point on the element this action will land on."""
hand = self.hand
handle, box = self._element_box(frame_id, selector)
handle, box = self._element_box(frame_id, selector, element)
if handle is None or box is None:
return None
try:
@@ -476,7 +491,8 @@ class Pointer:
return _Aim(box, (box["x"] + box["width"] / 2.0,
box["y"] + box["height"] / 2.0), None)
finally:
self._dispose(frame_id, handle)
if element is None: # a node the caller holds stays the caller's
self._dispose(frame_id, handle)
# -- travelling --------------------------------------------------------
@@ -582,7 +598,8 @@ class Pointer:
# -- the entry points --------------------------------------------------
def approach(self, frame_id: str, selector: str, position: Optional[dict],
trial: bool = False) -> Optional[Dict[str, float]]:
trial: bool = False,
element: Optional[str] = None) -> Optional[Dict[str, float]]:
"""Walk the pointer onto the element this action is about to touch.
Returns the `position` the action should run with, or None.
@@ -598,7 +615,7 @@ class Pointer:
hand.busy = True
hand.action += 1
try:
aim = self._choose_landing(frame_id, selector, position)
aim = self._choose_landing(frame_id, selector, position, element)
if aim is None:
return None
w, h = self._viewport()
@@ -614,9 +631,12 @@ class Pointer:
def act(self, frame_id: str, selector: str, position: Optional[dict],
timeout: Optional[float], run: Callable[[Optional[dict], Optional[float]], Any],
*, trial: bool = False) -> Any:
*, trial: bool = False, element: Optional[str] = None) -> Any:
"""Run a pointer action on an element the way a hand would.
``element`` is the object id of a node the caller already holds (an
ElementHandle): the walk aims at THAT node and `selector` is not looked up.
`run(position, timeout)` performs the plain action with those two
arguments. The approach comes first; if it chose a landing point the
action is told to click it, within a bounded slice of the caller's
@@ -626,7 +646,7 @@ class Pointer:
"""
override = None
try:
override = self.approach(frame_id, selector, position, trial)
override = self.approach(frame_id, selector, position, trial, element)
except _PROBE_ERRORS as exc: # motion never fails an action for what the engine or the page answers; a bug of ours is not that
_cursor._warn_once(
"approach-failed",
+6 -2
View File
@@ -43,8 +43,12 @@ locale, timezone), and `context_options_override=True` makes the server's win.
LIMITS OF THIS FIRST VERSION, said instead of hidden.
* `launchPersistentContext` and `profile_dir` are not served.
* `x-playwright-proxy` (exposeNetwork) is recorded, not honoured.
* Downloads, file choosers and other fused types follow the in-process
client's path and are not carried to a remote client.
* Downloads and other fused types follow the in-process client's path and
are not carried to a remote client. A file chooser is: the `fileChooser`
event reaches the client, and `set_files` with a path streams the file
(`createTempFiles`, `WritableStream`) into the session's upload area, where
it lives as long as its context and goes with it, or with a client that
drops in the middle of the copy (`_client_gone` closes the contexts it owns).
* `RemoteServer.process` is the core's handle for the browser process
(`Connection._process`, a private attribute of the core: pid / poll / wait).
* Page numbers (`pageNumber`, which the in-process client reserves) are drawn
File diff suppressed because it is too large. Load diff
+23
View File
@@ -0,0 +1,23 @@
"""The row the host oracle's declared list carried while the published engine was the 68 or the 69 and the candidate no longer spawned the graphics probe.
ci/ab-host-expected.json declares what the published engine of today and the candidate differ by, which is nothing now (the published engine is the 70, which does not spawn
gfxtest either, so the row would be stale in every run). The mechanism of a declared `proc` difference (the kind and the paths only that process touched, the A/B only, the stale
check) is tested with this row, as a row of the tests' own.
"""
from __future__ import annotations
import copy
GFXTEST_ROW = {
"id": "gfxtest-69",
"os": "linux",
"category": "proc",
"name": "gfxtest",
"published": "present",
"candidate": "absent",
"reason": "the 69 no longer spawns the graphics probe gfxtest (GFX_PROBE_BINARY, widget/gtk/GfxInfo.cpp:55; commit 0e896e4ee1, the probe never reads the host); the paths only that process touched go with it",
}
def gfxtest_rows() -> list:
return [copy.deepcopy(GFXTEST_ROW)]
+274
View File
@@ -0,0 +1,274 @@
"""What the canvas-reader e2e tests share: one scene, the readers of a canvas, the page that serves them, and the comparison of bytes.
The engine applies its canvas noise (``gfx::StealthProjectPixels``) to a WebGL or WebGPU canvas when a PAGE reads it, and only then. These
tests ask whether every road by which a page reads such a canvas gives the same bytes, so they need one scene that the noise touches, the same
scene drawn through every API, and the same list of readers for every kind of canvas.
THE SCENE. Ten triangles with random vertex colours (a fixed generator, the same numbers in every launch and in every API: ``starVertices``)
over a white clear. The noise touches only an edge pixel whose 3x3 neighbourhood holds a THIRD colour besides a blend of two, so a flat clear
is never touched; ten overlapping triangles make hundreds of such junctions, and the chance that two reads of a noised and an un-noised canvas
differ nowhere is nil. The 2D twin (``draw2D``) draws the same triangles with translucent fills and a shadow: a canvas that WOULD be noised if
the 2D road were projected, and is not (a 2D canvas reads as drawn).
THE CONTROL. ``noised=False`` declares ``zoom.stealth.canvas.substitute_pixels`` false: the canvas noise is declared off and NOTHING else changes
(same declared GPU, same antialiasing, same raster), so the difference between the two launches is the noise and nothing else, which is why
the tests may ask that it touches only the low bit of R, G and B. (A launch with ``hw_seed`` 0 would also change the declared GPU.)
THE READERS (``readersOf``): the canvas's own read (``readPixels`` / ``getImageData``), ``drawImage`` onto a 2D canvas, ``createImageBitmap``, the
PNG of ``toDataURL`` / ``toBlob`` / ``convertToBlob`` (decoded here, never by the browser, so the browser's image decoding is not a variable)
and, for an OffscreenCanvas, ``transferToImageBitmap``. Every entry is the base64 of RGBA bytes, top row first; a name that ends in ``.png`` is a
PNG file.
Nothing here waits on a clock: the page's async functions end on events, and the one wait that needs polling (``wait_until``) ends on a condition.
"""
from __future__ import annotations
import base64
import contextlib
import json
import threading
from http.server import BaseHTTPRequestHandler
from typing import Dict, List
import _page_bytes as pb
from _servers import LocalServer
#: The side of every canvas of the scene.
SIZE = 128
#: A noise seed that no runner has.
HW_SEED = 12345
#: The persona (identity) seed of every launch: not the noise seed.
SEED = 7
#: The JS of the scene and of the readers. Plain script: it runs in the page and, as the head of a worker's source, in a worker (no ``document`` in it).
SHARED_JS = r"""
const W = 128, H = 128;
// ten triangles, 30 vertices of (x, y, r, g, b), x and y in clip space: a fixed generator, so every launch and every API draws the same scene
function starVertices() {
const v = []; let s = 12345;
const rnd = () => (s = (s * 1103515245 + 12345) & 0x7fffffff) / 0x7fffffff;
for (let i = 0; i < 30; i++) v.push(rnd() * 1.8 - 0.9, rnd() * 1.8 - 0.9, rnd(), rnd(), rnd());
return v;
}
function drawGL(canvas, kind) {
const gl = canvas.getContext(kind || 'webgl', {preserveDrawingBuffer: true, antialias: true});
if (!gl) throw new Error('no ' + (kind || 'webgl') + ' context');
const shader = (type, src) => {
const s = gl.createShader(type); gl.shaderSource(s, src); gl.compileShader(s);
if (!gl.getShaderParameter(s, gl.COMPILE_STATUS)) throw new Error(gl.getShaderInfoLog(s));
return s;
};
const pr = gl.createProgram();
gl.attachShader(pr, shader(gl.VERTEX_SHADER, 'attribute vec2 p; attribute vec3 c; varying vec3 v; void main(){v=c;gl_Position=vec4(p,0.,1.);}'));
gl.attachShader(pr, shader(gl.FRAGMENT_SHADER, 'precision mediump float; varying vec3 v; void main(){gl_FragColor=vec4(v,1.);}'));
gl.linkProgram(pr);
if (!gl.getProgramParameter(pr, gl.LINK_STATUS)) throw new Error(gl.getProgramInfoLog(pr));
gl.useProgram(pr);
const b = gl.createBuffer(); gl.bindBuffer(gl.ARRAY_BUFFER, b);
gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(starVertices()), gl.STATIC_DRAW);
const pl = gl.getAttribLocation(pr, 'p'), cl = gl.getAttribLocation(pr, 'c');
gl.enableVertexAttribArray(pl); gl.vertexAttribPointer(pl, 2, gl.FLOAT, false, 20, 0);
gl.enableVertexAttribArray(cl); gl.vertexAttribPointer(cl, 3, gl.FLOAT, false, 20, 8);
gl.clearColor(1, 1, 1, 1); gl.clear(gl.COLOR_BUFFER_BIT);
gl.drawArrays(gl.TRIANGLES, 0, 30);
gl.finish();
return gl;
}
// the same ten triangles on a 2D canvas, with translucent fills and a shadow
function draw2D(x) {
x.fillStyle = '#fff'; x.fillRect(0, 0, W, H);
const v = starVertices();
for (let t = 0; t < 10; t++) {
const q = v.slice(t * 15, t * 15 + 15);
x.fillStyle = 'rgba(' + Math.round(q[2] * 255) + ',' + Math.round(q[3] * 255) + ',' + Math.round(q[4] * 255) + ',' + (t % 2 ? 0.7 : 1) + ')';
x.beginPath();
for (let k = 0; k < 3; k++) {
const px = (q[k * 5] + 1) / 2 * W, py = (1 - q[k * 5 + 1]) / 2 * H;
if (k) x.lineTo(px, py); else x.moveTo(px, py);
}
x.closePath(); x.fill();
}
x.shadowColor = 'rgba(0, 0, 0, 0.6)'; x.shadowBlur = 4; x.shadowOffsetX = 3; x.shadowOffsetY = 2;
x.fillStyle = 'rgb(200, 120, 20)'; x.fillRect(40, 40, 30, 30);
}
// readPixels, top row first (readPixels gives the bottom row first)
function readGL(gl) {
const buf = new Uint8Array(W * H * 4);
gl.readPixels(0, 0, W, H, gl.RGBA, gl.UNSIGNED_BYTE, buf);
const out = new Uint8Array(W * H * 4);
for (let y = 0; y < H; y++) out.set(buf.subarray((H - 1 - y) * W * 4, (H - y) * W * 4), y * W * 4);
return out;
}
function readCtx(x) { return new Uint8Array(x.getImageData(0, 0, W, H).data); }
function b64(u8) {
let s = '';
for (let i = 0; i < u8.length; i += 8192) s += String.fromCharCode.apply(null, u8.subarray(i, i + 8192));
return btoa(s);
}
function blobB64(blob) {
return new Promise((ok, bad) => {
const r = new FileReader();
r.onload = () => ok(String(r.result).split(',')[1]);
r.onerror = () => bad(new Error('FileReader failed'));
r.readAsDataURL(blob);
});
}
// what a fresh 2D canvas (made by `make`) holds after `draw(context)`
function pixelsOf(make, draw) {
const c = make(); c.width = W; c.height = H;
const x = c.getContext('2d'); draw(x);
return readCtx(x);
}
// every road by which a page turns `src` into bytes: {name: base64 of RGBA, top row first}; a name ending in .png is a PNG file
async function readersOf(src, direct, make, withTransfer) {
const out = {direct: b64(direct())};
out.drawImage = b64(pixelsOf(make, x => x.drawImage(src, 0, 0)));
const bm = await createImageBitmap(src);
out.createImageBitmap = b64(pixelsOf(make, x => x.drawImage(bm, 0, 0)));
bm.close();
if (src.toDataURL) {
out['toDataURL.png'] = src.toDataURL('image/png').split(',')[1];
out['toBlob.png'] = await blobB64(await new Promise(r => src.toBlob(r, 'image/png')));
} else {
out['convertToBlob.png'] = await blobB64(await src.convertToBlob({type: 'image/png'}));
}
if (withTransfer && src.transferToImageBitmap) { // last: it empties the canvas
const tb = src.transferToImageBitmap();
out.transferToImageBitmap = b64(pixelsOf(make, x => x.drawImage(tb, 0, 0)));
tb.close();
}
return out;
}
const makeElement = () => document.createElement('canvas');
const makeOffscreen = () => new OffscreenCanvas(W, H);
"""
def page_html(page_js: str) -> str:
"""A page whose script holds SHARED_JS, ``WORKER_LIB`` (the same text, for the source of a worker) and the page's own functions."""
return ("<!doctype html><meta charset=utf-8><title>canvas readers</title><body><script>\n" + SHARED_JS
+ "\nconst WORKER_LIB = " + json.dumps(SHARED_JS) + ";\n" + page_js + "\n</script></body>")
@contextlib.contextmanager
def serve(html: str):
"""The page on a local http origin (a secure context, and a site a canvas has a principal on); port 0, the one the system gave."""
body = html.encode("utf-8")
class Page(BaseHTTPRequestHandler):
timeout = 5
def do_GET(self):
self.send_response(200)
self.send_header("Content-Type", "text/html; charset=utf-8")
self.send_header("Content-Length", str(len(body)))
self.send_header("Cache-Control", "no-store")
self.end_headers()
self.wfile.write(body)
def log_message(self, *args):
pass
httpd = LocalServer(("127.0.0.1", 0), Page)
threading.Thread(target=httpd.serve_forever, daemon=True).start()
try:
yield "http://127.0.0.1:%d/" % httpd.server_address[1]
finally:
httpd.shutdown()
httpd.server_close()
@contextlib.contextmanager
def launched(firefox_binary, html: str, noised: bool = True, pin=None, viewport=None):
"""The page open in a browser of the product: the engine on (a declared noise seed no runner has), and, when ``noised`` is false, the
canvas noise declared off and nothing else. One browser, closed on leaving."""
from invisible_playwright import InvisiblePlaywright
prefs = {"zoom.stealth.fpp.hw_seed": HW_SEED}
if not noised:
prefs["zoom.stealth.canvas.substitute_pixels"] = False
with serve(html) as url:
with InvisiblePlaywright(seed=SEED, binary_path=firefox_binary, headless=True, extra_prefs=prefs, pin=pin) as browser:
context = browser.new_context(viewport=viewport) if viewport else browser.new_context()
page = context.new_page()
page.goto(url, wait_until="load", timeout=60_000)
yield page
def run(page, call: str, deadline_s: int = 120):
"""Runs the page's async function ``call`` (a JS expression that gives a promise) to its end and returns what it resolved to. The end is
the promise's own: the deadline is only how long a lost event is allowed before the test says so."""
page.evaluate("() => { window.DONE = false; window.ERR = null; window.R = null;"
" Promise.resolve().then(() => %s).then(r => { window.R = r; window.DONE = true; },"
" e => { window.ERR = String((e && e.stack) || e); window.DONE = true; }); }" % call)
page.wait_for_function("window.DONE === true", timeout=deadline_s * 1000)
err = page.evaluate("window.ERR")
assert err is None, "the page could not run %s: %s" % (call, err)
return page.evaluate("window.R")
# ------------------------------------------------------------------------------------------------------------------ bytes
def rgba_of_image(image) -> bytes:
"""RGBA bytes of an ``_page_bytes.unfiltered`` image (RGB gets an opaque alpha)."""
data, channels = image["data"], image["channels"]
if channels == 4:
return data
assert channels == 3, "a PNG of %d channels is not read here" % channels
out = bytearray()
for i in range(0, len(data), 3):
out += data[i:i + 3] + b"\xff"
return bytes(out)
def rgba(name: str, value: str) -> bytes:
"""The RGBA bytes of a reader's entry: its base64, or, for a PNG, the pixels it decodes to."""
raw = base64.b64decode(value)
if name.endswith(".png"):
image = pb.unfiltered(raw)
assert (image["w"], image["h"]) == (SIZE, SIZE), "%s is a %dx%d image, not %dx%d" % (name, image["w"], image["h"], SIZE, SIZE)
return rgba_of_image(image)
assert len(raw) == SIZE * SIZE * 4, "%s holds %d bytes, not %d" % (name, len(raw), SIZE * SIZE * 4)
return raw
def decode(readers: Dict[str, str], prefix: str = "") -> Dict[str, bytes]:
return {prefix + name: rgba(name, value) for name, value in readers.items()}
def differing_pixels(a: bytes, b: bytes) -> int:
assert len(a) == len(b), "two images of %d and %d bytes" % (len(a), len(b))
return sum(1 for i in range(0, len(a), 4) if a[i:i + 4] != b[i:i + 4])
def only_the_low_bit_of_rgb(a: bytes, b: bytes) -> List[int]:
"""The pixels where ``a`` and ``b`` differ by more than the low bit of R, G and B (or in alpha): the noise writes nothing else."""
return [i // 4 for i in range(0, len(a), 4)
if (a[i] | 1, a[i + 1] | 1, a[i + 2] | 1, a[i + 3]) != (b[i] | 1, b[i + 1] | 1, b[i + 2] | 1, b[i + 3])]
def distinct_colours(a: bytes) -> int:
return len({a[i:i + 4] for i in range(0, len(a), 4)})
def disagreements(readers: Dict[str, bytes], reference: str) -> List[str]:
"""The readers whose bytes are not those of ``reference``, each with how many pixels differ."""
want = readers[reference]
return ["%s (%d pixels differ)" % (name, differing_pixels(want, got)) for name, got in readers.items() if got != want]
def assert_agree(what: str, readers: Dict[str, bytes], reference: str = "direct") -> None:
bad = disagreements(readers, reference)
assert not bad, (
"%s: the readers %s do not read what %s reads (readers: %s). Every road by which a page reads a canvas gives the same bytes "
"when it is the same canvas" % (what, "; ".join(bad), reference, ", ".join(sorted(readers))))
+174
View File
@@ -0,0 +1,174 @@
"""TEMPORARY: the core of every crash of an engine the tests start, read by gdb after a test that fails. Remove it with tests/_generation_evidence.py once the
exit by SIGSEGV (-11) of the engine in generate mode on Linux (runs 44985244053 and 45014369018) is understood and fixed.
A release build crashes in silence: MOZ_CRASH, MOZ_RELEASE_ASSERT and a Rust panic write to a null address and print nothing, so stderr cannot tell a crash the
code wanted from a bad access. The core can: `gMozCrashReason` says the reason of a wanted crash, the faulting address and the thread that fell say the rest.
* `lift_the_core_limit_of_the_session()`: once, at the start of pytest (tests/conftest.py, `pytest_configure`), on Linux: the soft RLIMIT_CORE of the pytest
process raised to its hard limit. Every process a test starts inherits it, the engines the CORE launches included (its `generate` passes no limit of its own),
so a crash of any of them leaves a core where `kernel.core_pattern` says. The Linux e2e jobs (e2e.yml, and gate.yml of the engine series) point it at
`$INVPW_CORE_DIR` and install gdb.
* `after_the_report(nodeid, when, failed)`: tests/conftest.py calls it after each phase of every test (`pytest_runtest_makereport`). When `$INVPW_CORE_DIR` is set:
after a phase that FAILED, every `core*` there is read by gdb into `<evidence>/cores/<nodeid>/<core>.gdb.txt` and deleted, and `notes.txt` says what was found
(no core included); after the teardown of a test that did not fail, the cores left are deleted and listed in `<evidence>/cores/after-passing-tests.txt` (a crash
in a passing test is information too). `<evidence>` is `$RUNNER_TEMP/invpw-evidence`, the folder the e2e jobs upload.
* `gdb_text(core, into)`: the one gdb path of the tests: the executable is the one the core's header names (else `$INVPW_BINARY_PATH`), and the text holds the
backtrace of every thread, their names, the signal's address, `gMozCrashReason`, the registers, the shared libraries with their addresses and build ids, and the
mappings. Only the text is kept: a core of the engine is hundreds of MB.
Best effort: nothing here raises, and nothing here decides a test.
"""
from __future__ import annotations
import contextlib
import os
import re
import shutil
import subprocess
import sys
import tempfile
from pathlib import Path
#: The folder under `$RUNNER_TEMP` the e2e workflows upload (`invpw-evidence-*`, "Keep what the tests saved").
EVIDENCE_FOLDER = "invpw-evidence"
CORES = "cores"
AFTER_PASSING = "after-passing-tests.txt"
#: How long gdb may take to read a core of the engine, and to read its header only.
GDB_TIMEOUT_S = 600
HEADER_TIMEOUT_S = 120
#: What gdb prints from the core: the crashing thread first, then every thread with its name, the signal, the reason of a wanted crash, where libxul is.
GDB_COMMANDS = (
"set pagination off",
"set width 0",
"bt",
"info threads",
"thread apply all bt",
"p $_siginfo",
"p $_siginfo._sifields._sigfault.si_addr",
"x/s *(char**)&gMozCrashReason",
"info registers",
"x/8i $pc",
"info sharedlibrary",
"python print('\\n'.join('%s %s' % (o.filename, o.build_id) for o in gdb.objfiles()))",
"info proc mappings",
)
_HEADER = re.compile(r"Core was generated by `([^']*)'")
#: The tests a phase of which failed: their teardown reads its cores too.
_FAILED = set()
def lift_the_core_limit_of_the_session():
"""Linux: the soft RLIMIT_CORE of this process raised to its hard limit, inherited by every child. Elsewhere, or if it is refused, nothing."""
if not sys.platform.startswith("linux"):
return
try:
import resource
_soft, hard = resource.getrlimit(resource.RLIMIT_CORE)
resource.setrlimit(resource.RLIMIT_CORE, (hard, hard))
except (ImportError, OSError, ValueError):
pass
def core_pattern():
try:
return Path("/proc/sys/kernel/core_pattern").read_text(encoding="utf-8").strip()
except OSError as exc:
return "unreadable: %r" % (exc,)
def gdb():
"""The gdb command (a list), or None when gdb is not installed."""
found = shutil.which("gdb")
return [found] if found else None
def evidence_root():
base = os.environ.get("RUNNER_TEMP") or tempfile.gettempdir()
return Path(base) / EVIDENCE_FOLDER / CORES
def folder_name(nodeid):
return re.sub(r"[^A-Za-z0-9._-]+", "_", nodeid).strip("_")[:150] or "unnamed"
def _cores():
where = os.environ.get("INVPW_CORE_DIR")
if not where or not Path(where).is_dir():
return None, []
return Path(where), sorted((path for path in Path(where).glob("core*") if path.is_file()), key=lambda path: path.stat().st_mtime)
def executable_of(core, command):
"""The executable the core's header names when it is a file, else `$INVPW_BINARY_PATH` (or `$STEALTHFOX_E2E_BINARY`), else None. Returns (path, how)."""
header = ""
try:
done = subprocess.run(command + ["-batch", "-nx", "-c", str(core)], stdin=subprocess.DEVNULL, stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
timeout=HEADER_TIMEOUT_S)
header = done.stdout.decode("utf-8", "replace")
except Exception as exc: # best effort
header = "header unreadable: %r" % (exc,)
match = _HEADER.search(header)
named = match.group(1).split()[0] if match and match.group(1).split() else None
if named and Path(named).is_file():
return named, "from the core's header"
for variable in ("INVPW_BINARY_PATH", "STEALTHFOX_E2E_BINARY"):
if os.environ.get(variable) and Path(os.environ[variable]).is_file():
return os.environ[variable], "from $%s (the header names %r)" % (variable, named)
return None, "none (the header names %r)" % (named,)
def gdb_text(core, into):
"""gdb's text of `core` in `into/<core>.gdb.txt`. One line saying what was done. Does not delete the core."""
command = gdb()
size = core.stat().st_size
if command is None:
return "core %s (%d bytes, kernel.core_pattern %r) but gdb is not installed" % (core.name, size, core_pattern())
exe, how = executable_of(core, command)
argv = command + ["-batch", "-nx"]
for line in GDB_COMMANDS:
argv += ["-ex", line]
argv += ([exe] if exe else []) + ["-c", str(core)]
target = into / (core.name + ".gdb.txt")
try:
done = subprocess.run(argv, stdin=subprocess.DEVNULL, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, timeout=GDB_TIMEOUT_S)
target.write_bytes(("executable: %s (%s)\n\n" % (exe, how)).encode("utf-8") + done.stdout)
return "core %s (%d bytes): gdb exited %d, %d bytes of text in %s; executable %s" % (core.name, size, done.returncode, len(done.stdout), target.name, how)
except Exception as exc:
return "core %s (%d bytes): gdb failed: %r" % (core.name, size, exc)
def after_the_report(nodeid, when, failed):
"""After a phase (`setup`, `call`, `teardown`) of the test `nodeid`: see the module's docstring. Never raises."""
try:
failed_before = nodeid in _FAILED
if failed:
_FAILED.add(nodeid)
if when == "teardown":
_FAILED.discard(nodeid)
where, cores = _cores()
if where is None:
return
if failed or (failed_before and cores):
into = evidence_root() / folder_name(nodeid)
into.mkdir(parents=True, exist_ok=True)
notes = ["%s failed (phase %s); INVPW_CORE_DIR %s, kernel.core_pattern %r, gdb %s" % (nodeid, when, where, core_pattern(), gdb())]
if not cores:
notes.append("no core file in %s" % where)
for core in cores:
notes.append(gdb_text(core, into))
with open(str(into / "notes.txt"), "a", encoding="utf-8") as sink:
sink.write("\n".join(notes) + "\n")
elif when == "teardown" and cores:
root = evidence_root()
root.mkdir(parents=True, exist_ok=True)
with open(str(root / AFTER_PASSING), "a", encoding="utf-8") as sink:
for core in cores:
sink.write("%s\t%s\t%d bytes (deleted, not read)\n" % (nodeid, core.name, core.stat().st_size))
else:
return
for core in cores:
with contextlib.suppress(OSError):
core.unlink()
except Exception: # the evidence is best effort: the test's own outcome is what counts
pass
+5 -2
View File
@@ -42,7 +42,7 @@ from pathlib import Path
from typing import Callable, Dict, List, NamedTuple, Optional, Set, Tuple
from urllib.parse import parse_qs, urlsplit
from _socks_servers import EXIT, Gateway, WEB_NAME, WHOAMI4, WHOAMI6
from _socks_servers import EXIT, Gateway, WEB_NAME, WHOAMI4, WHOAMI6, _REQUEST
try: # the HTTP/2 side needs it; a test that wants h2 says pytest.importorskip("h2")
import h2.config
@@ -602,7 +602,8 @@ class DohGateway(Gateway):
* CONNECT to a loopback address is relayed for real (the pages and the echo servers of a test);
* the egress endpoints of the base class (``api.ipify.org:80``) keep working;
* any other CONNECT is refused (reply 2 "not allowed", for an address; 4 "host unreachable", for a name) and
listed in :attr:`refused`: the gateway never resolves a name and never reaches past the loopback.
listed in :attr:`refused` (and in ``guard``, the record every gateway of ``_socks_servers`` writes under ``$RUNNER_TEMP/invpw-evidence/``):
the gateway never resolves a name and never reaches past the loopback. Its UDP relay is the base one: only the lab's, the rest dropped and recorded.
:attr:`connects` (inherited) lists EVERY CONNECT target in order, so ``("page-a.test", 80)`` in it means the
browser sent a name where it should have sent an address. :attr:`credentials_seen` lists every
@@ -696,6 +697,8 @@ class DohGateway(Gateway):
if not is_loopback(host):
self.connects.append((host, port))
self.refused.append((host, port))
self.guard.refuse(host, port, getattr(_REQUEST, "atyp", 3), "tcp",
reason="past loopback: the DoH gateway carries only loopback (besides the DoH, the exit questions and the web name it answers)")
self._send(c, self._reply(2 if _is_address(host) else 4))
return
self.connects.append((host, port))
+187
View File
@@ -0,0 +1,187 @@
"""What the drag twin records of a drag, and how two records are compared: every drag event the page hears, in the top document and in the frame, never a number of ours.
``RECORDER_JS`` is the script both pages run: for each of ``dragstart``, ``drag``, ``dragenter``, ``dragover``, ``dragleave``, ``drop`` and ``dragend`` (heard at the document, after the
page's own handlers, so ``dataTransfer.types`` is what the page has set by then) it keeps, in ``window.__events``, the fields of ``FIELDS``:
type, at (the id of the event's target), under (the id of ``document.elementFromPoint`` at the event's client point), cx/cy (clientX/Y), sx/sy (screenX/Y), buttons, input (mozInputSource),
types (dataTransfer.types), allowed (effectAllowed), effect (dropEffect), cancelled (mozUserCancelled), source_null (whether mozSourceNode is null), trusted (isTrusted).
``record(top_events, frame_events)`` is what one browser leaves: for each document (the top one, where the drag starts and ends and a drop can land, and the frame) the events that happen once
or a few times (``once``: dragstart, dragenter, dragleave, drop, dragend, in the order the page heard them) whole, and for ``drag`` and ``dragover``, which repeat as often as the mouse moves
and as a timer fires, their count, their first and last event and the ids they were dispatched at. ``end_minus_last`` is ``dragend``'s client point less the last ``drag``'s, in the top
document.
HOW TWO RECORDS ARE COMPARED (``compare``): with stock, only what stock decides the same way on every machine and in either process model: the routing and the targets (the event sequence, the
type, the target, what is under the point), the client points, ``rel``, the data transfer's types, trusted, the input source, and, in the top document, the effects (the same process on both
sides) of every event but the one the frame's process decides (see the twin rule). In a CSS pixel for the client points (``TOLERANCES``: the point of a drag is a device pixel that crosses a process and is rounded to CSS, the tolerance the twin has always had for the
drop point); and through the relation for the screen points. ``screenX/Y`` is where the window stands on the screen: stock's is the real place of its window and ours is the declared one, so the
two are not the same number and no number of ours is the expected one. What the page reads is the same in both: where a point is on the screen relative to where the top document's first event is
(``rel``: ``screen - client`` of the event, less that of the first event of the top document). It is 0 for every event of the top document and the frame's place in it for a frame's event, in a
browser whose window stands anywhere. The absolute screen points and the origin are in the record, printed when the two differ, and not in the comparison. The count of ``dragover`` events is in
the record and not in the comparison: it is timer-driven.
THE TWIN RULE (``DECLARED``): a field that depends on stock's frame being in the top's process, or on stock's drag being Juggler's synthetic one, is in the record and NOT compared with stock; the
list says which and why, and ``recorded`` returns what differs there, for the report. Retail decides those fields, through the capture of the round ``drag`` of the core's window-geometry workflow.
They are ``buttons`` (stock's synthetic drag has no OLE loop: 0), ``drag`` at the source (count and presence: no OLE loop, no timer-driven ``drag``), the ``dragend`` point less the last ``drag``
(no ``drag`` to be less of), and in the frame ``effectAllowed``, ``dropEffect`` and ``mozSourceNode`` (stock's frame is in-process and reads the source's own DataTransfer; ours is in another
process, where Mozilla's cross-process DataTransfer starts with effectAllowed ``uninitialized`` and the dropEffect is the action, nsContentUtils FilterDropEffect).
For the drop in the frame (``kind`` ``frame``), two more fields of the TOP document depend on the frame's process, and ``comparable`` moves them out of ``top.once`` before the comparison: every top
``dragleave`` whose ``under`` is the frame (``top.into_frame``: stock's frame is in its own process model, so the top's event manager fires a leave at the body when the cursor enters the
subdocument; retail with the frame out of process has none, and ours has none) and the ``dropEffect`` of the top ``dragend`` (``top.dragend_effect``: it is the frame's drop result, which crosses
processes). In the drop in the top document (``kind`` ``top``) the record is compared whole, ``dragend``'s effect included.
"""
from __future__ import annotations
import copy
import json
from typing import Any, Dict, List, Optional, Tuple
from _stock_twin import IN_PROCESS_FRAME, SYNTHETIC_DRAG, both, split_differences
#: The events of a drag, in the order a drag starts, goes over and ends.
TYPES = ("dragstart", "drag", "dragenter", "dragover", "dragleave", "drop", "dragend")
#: Events that repeat (every mouse move, every timer tick): the record keeps their count, their first and last event.
REPEATED = ("drag", "dragover")
#: What the page keeps of each event, and so what the record has of it.
FIELDS = ("type", "at", "under", "cx", "cy", "sx", "sy", "buttons", "input", "types", "allowed", "effect", "cancelled", "source_null", "trusted")
#: A CSS pixel for a client point and for the relation of the screen point to the client one; every other number exactly.
TOLERANCES: Dict[str, float] = {"cx": 1.0, "cy": 1.0, "rel": 1.0}
#: Keys of the record that are in it and not in the comparison, and why (the count of ``drag`` and of ``dragover`` is left out in ``_comparable``: a timer fires them, so it depends on the speed of the machine).
NOT_COMPARED = {
"sx": "the real place of stock's window and the declared one of ours: compared through rel",
"sy": "the real place of stock's window and the declared one of ours: compared through rel",
"screen_origin": "screen minus client of the first event of the top document: where the window stands",
}
#: THE TWIN RULE. Stock Playwright's Firefox sets ``fission.webContentIsolationStrategy=0``: its cross-site frame is in the top's process, ours is in another process, and stock's drag is Juggler's
#: synthetic one (no OLE drag loop). A field that depends on either is RECORDED, not compared with stock: the retail capture decides it (round ``drag`` of the core's window-geometry workflow, which
#: drives a real drag on retail). Each key is a pattern of canonical paths of the record (``top.once[].buttons``; ``*`` is any run of characters), each value is the reason.
#: What is compared with stock is the routing and the targets (the event sequence, ``type``, ``at``, ``under``), the client points and ``rel``, ``types``, ``trusted`` and ``input`` (mozInputSource),
#: in both documents, and ``effectAllowed`` and ``dropEffect`` of the top document, except, in the drop in the frame, the top's leave into the frame and the top ``dragend``'s ``dropEffect``.
DECLARED: Dict[str, str] = {
# stock's synthetic Juggler drag: no OLE loop, so the mouse buttons are 0 in its events and ``drag`` never fires at the source (and the dragend point less the last drag has no drag to be less of)
"*.buttons": SYNTHETIC_DRAG,
"top.repeated.drag.*": SYNTHETIC_DRAG,
"end_minus_last*": SYNTHETIC_DRAG,
# stock's frame is in-process: it reads the source's own DataTransfer; ours is in another process, where Mozilla's cross-process DataTransfer starts with effectAllowed 'uninitialized' and
# dropEffect is the action (nsContentUtils FilterDropEffect), and mozSourceNode is not reachable
"frame.*.allowed": IN_PROCESS_FRAME,
"frame.*.effect": IN_PROCESS_FRAME,
"frame.*.source_null": IN_PROCESS_FRAME,
# the frame drop only (``comparable`` makes these keys): stock's top hears a leave at the body when the cursor enters its in-process-model subdocument, and the top dragend's dropEffect is the
# frame's drop result, which crosses processes
"top.into_frame*": IN_PROCESS_FRAME,
"top.dragend_effect*": IN_PROCESS_FRAME,
}
RECORDER_JS = """
window.__events = [];
(function () {
const name = n => n ? (n.id || n.nodeName.toLowerCase()) : null;
for (const type of %s) {
document.addEventListener(type, e => {
const dt = e.dataTransfer;
window.__events.push({
type: e.type, at: name(e.target), under: name(document.elementFromPoint(e.clientX, e.clientY)),
cx: e.clientX, cy: e.clientY, sx: e.screenX, sy: e.screenY, buttons: e.buttons, input: e.mozInputSource,
types: dt ? Array.from(dt.types) : null, allowed: dt ? dt.effectAllowed : null, effect: dt ? dt.dropEffect : null,
cancelled: dt ? dt.mozUserCancelled : null, source_null: dt ? dt.mozSourceNode === null : null, trusted: e.isTrusted,
});
});
}
})();
""" % json.dumps(list(TYPES))
READ_JS = "() => window.__events"
def read_events(document) -> List[Dict[str, Any]]:
"""The raw events a page or frame heard (``document`` is a Playwright page or frame)."""
return document.evaluate(READ_JS)
def _event(raw: Dict[str, Any], origin: Optional[List[float]]) -> Dict[str, Any]:
missing = [f for f in FIELDS if f not in raw]
if missing:
raise ValueError("a drag event the page recorded has no %s (an absent field is a difference, never an agreement): %r" % (", ".join(missing), raw))
out = {f: raw[f] for f in FIELDS}
out["rel"] = None if origin is None else [raw["sx"] - raw["cx"] - origin[0], raw["sy"] - raw["cy"] - origin[1]]
return out
def _document(events: List[Dict[str, Any]], origin: Optional[List[float]]) -> Dict[str, Any]:
once = [_event(e, origin) for e in events if e.get("type") not in REPEATED]
repeated: Dict[str, Any] = {}
for kind in REPEATED:
of_kind = [_event(e, origin) for e in events if e.get("type") == kind]
repeated[kind] = ({"count": len(of_kind), "first": of_kind[0], "last": of_kind[-1], "at": sorted({str(e["at"]) for e in of_kind})}
if of_kind else {"count": 0})
return {"once": once, "repeated": repeated}
def record(top_events: List[Dict[str, Any]], frame_events: List[Dict[str, Any]]) -> Dict[str, Any]:
"""What one browser leaves of one drag: both documents' events, the end point less the last drag point, and the origin of the screen points."""
origin = [top_events[0]["sx"] - top_events[0]["cx"], top_events[0]["sy"] - top_events[0]["cy"]] if top_events else None
top = _document(top_events, origin)
drags = [e for e in top_events if e.get("type") == "drag"]
ends = [e for e in top_events if e.get("type") == "dragend"]
last, end = (drags[-1] if drags else None), (ends[-1] if ends else None)
return {"top": top, "frame": _document(frame_events, origin),
"end_minus_last": [end["cx"] - last["cx"], end["cy"] - last["cy"]] if (end and last) else None,
"screen_origin": origin}
def read_record(page, frame) -> Dict[str, Any]:
"""The record of a drag, read from the top page and from the frame."""
return record(read_events(page), read_events(frame))
def _comparable(node: Any, key: str = "") -> Any:
if isinstance(node, dict):
return {k: _comparable(v, k) for k, v in node.items() if k not in NOT_COMPARED and not (key in REPEATED and k == "count")}
if isinstance(node, list):
return [_comparable(v, key) for v in node]
return copy.deepcopy(node)
#: The id of the frame in the top page (``f``): the ``under`` of the top's leave into it.
FRAME_ID = "f"
def comparable(record: Dict[str, Any], kind: str) -> Dict[str, Any]:
"""The record as it is compared: for the drop in the frame (``kind`` ``frame``) the top's ``dragleave`` events under the frame leave ``top.once`` for ``top.into_frame`` and the top ``dragend``'s
``effect`` leaves its event for ``top.dragend_effect``; both keys are in ``DECLARED``. For the drop in the top document (``top``) the record is unchanged."""
if kind not in ("top", "frame"):
raise ValueError("the drop is in the 'top' document or in the 'frame', not %r" % (kind,))
out = _comparable(record)
if kind == "frame":
top = out["top"]
into_frame = [e for e in top["once"] if e["type"] == "dragleave" and e["under"] == FRAME_ID]
top["once"] = [e for e in top["once"] if not (e["type"] == "dragleave" and e["under"] == FRAME_ID)]
top["into_frame"] = into_frame
top["dragend_effect"] = [e.pop("effect") for e in top["once"] if e["type"] == "dragend"]
return out
def split(stock: Dict[str, Any], ours: Dict[str, Any], kind: str, path: str = "drag") -> Tuple[List[str], List[str]]:
"""``(red, recorded)``: the differences that decide, and those of the declared fields (``DECLARED``), kept for the report. ``kind`` is where the drop ended: ``top`` or ``frame``."""
return split_differences(comparable(stock, kind), comparable(ours, kind), DECLARED, TOLERANCES, path)
def compare(stock: Dict[str, Any], ours: Dict[str, Any], kind: str, path: str = "drag") -> List[str]:
"""Every place where ours is not what stock is in a field that is compared, as ``path: stock X, ours Y``; empty when the page reads the same there."""
return split(stock, ours, kind, path)[0]
def recorded(stock: Dict[str, Any], ours: Dict[str, Any], kind: str, path: str = "drag") -> List[str]:
"""The differences in the fields of ``DECLARED``: in the report, never in the verdict."""
return split(stock, ours, kind, path)[1]
def verdict(case: str, kind: str, stock: Dict[str, Any], ours: Dict[str, Any]) -> str:
"""The message of a red drag twin, with both records whole; empty when ours is what stock is."""
differing = compare(stock, ours, kind, "%s drop" % kind)
if not differing:
return ""
return ("%s: the drag that ends in the %s of ours does not read what stock's does (every event, that drag fired at the source, dragend less the last drag):\n %s%s"
% (case, "frame of another site" if kind == "frame" else "top document", "\n ".join(differing), both(case, stock, ours)))
+101 -1
View File
@@ -23,6 +23,11 @@ THE RULES (a stable name each; ``CLASS`` is the letter of the audit of the e2e t
time a healthy run is allowed, and a loaded runner takes longer than a developer's machine: 30 s is the one the whole suite uses (the unit is read from the callee:
milliseconds for the Playwright API, seconds for the standard library and for the helpers of ``tests/``). A wait for something that must NOT happen is accepted by its shape
(inside ``pytest.raises``, under a ``try`` that swallows the timeout, or a limit that is NAMED ``NEGATIVE_...``); any other is a reviewed ``entries`` item with its reason.
* ``lab-delay`` (A): an e2e test that gives a lab gateway or lab server a delay (``Gateway(..., rtt_ms=N)``, ``Chain(rtt_ms=N)``, ``first_connection_delay=N``, ``doh.delay_names[...] = N``,
``sites.route(..., delay=N)``, ``_serve(..., delay=N)``, a test parameter named ``rtt_ms``, or a fixture of the file that does) and is not marked ``wall_clock``. The delay is a sleep or a
timer of the lab's own threads, and what the test waits for is decided by the product with a time budget (the core's UDP measurement, a DoH timeout): on a runner with no CPU left the
threads are scheduled late and the answer comes after the budget (run 45058944650). The test belongs to the ``wall_clock`` lane (serial, the whole machine). A delay of a literal 0 is none;
a value the test computes counts until it is shown to be 0. One occurrence per test.
* ``egress`` (D): the conftest has no autouse session fixture that declares the exit of the lab (tests/_lab_egress.py), so a launch asks three services of the internet.
WHAT IS ACCEPTED WITHOUT A LIST, because it is recognised by its shape: a pause that is the step of a poll with a deadline (a ``while``/``for`` that compares with a clock
@@ -45,7 +50,7 @@ from typing import Dict, Iterable, List, Optional, Set, Tuple
TESTS = Path(__file__).resolve().parent
#: The rule -> the class of the audit.
CLASS = {"sleep": "A", "js-timer": "A", "bound": "B", "port": "C", "env": "C", "net": "D", "egress": "D", "count": "E", "timeout": "F"}
CLASS = {"sleep": "A", "js-timer": "A", "lab-delay": "A", "bound": "B", "port": "C", "env": "C", "net": "D", "egress": "D", "count": "E", "timeout": "F"}
RULES = tuple(CLASS)
#: The files that say what is forbidden (their own patterns would be found) and the files of the round after a publication (``net`` is theirs by design).
@@ -608,6 +613,98 @@ def _is_e2e_file(tree: ast.Module) -> bool:
for sub in ast.walk(tree))
#: The delay knobs of the lab servers: the keyword of a call -> the callees it is a delay of (None: any). ``delay`` alone is too common a word (``keyboard.type(delay=120)``): it is a delay
#: of the lab only on the two helpers that serve a late page.
LAB_DELAY_KEYWORDS: Dict[str, Optional[Set[str]]] = {"rtt_ms": None, "first_connection_delay": None, "delay": {"route", "_serve"}}
#: A test parameter that is one of those knobs: the distance a ``parametrize`` gives the gateway.
LAB_DELAY_PARAMETERS = {"rtt_ms", "first_connection_delay"}
#: The tables of the lab servers that a test fills with a delay by name (``doh.delay_names["slow.test"] = 2.0``).
LAB_DELAY_TABLES = {"delay_names"}
def _is_zero(node: ast.AST) -> bool:
return isinstance(node, ast.Constant) and (node.value is None or node.value is False or (isinstance(node.value, (int, float)) and node.value == 0))
def _first_lab_delay(function: ast.AST) -> Optional[ast.AST]:
"""The first node in the body of ``function`` that gives a lab server a delay (see :data:`LAB_DELAY_KEYWORDS`), or None."""
for node in ast.walk(function):
if isinstance(node, ast.Call):
callee = _dotted(node.func).rsplit(".", 1)[-1]
for keyword in node.keywords:
where = LAB_DELAY_KEYWORDS.get(keyword.arg or "", False)
if where is not False and (where is None or callee in where) and not _is_zero(keyword.value):
return node
elif isinstance(node, (ast.Assign, ast.AugAssign)):
for target in node.targets if isinstance(node, ast.Assign) else [node.target]:
if isinstance(target, ast.Subscript) and _dotted(target.value).rsplit(".", 1)[-1] in LAB_DELAY_TABLES and not _is_zero(node.value):
return node
return None
def _lab_delays(tree: ast.Module) -> List[Tuple[str, int, str]]:
"""``(scope, line, text)`` of each e2e test that gives a lab server a delay and does not carry ``wall_clock``: in its own body, through a parameter named like a knob, or through a
fixture of the same file (``usefixtures`` and the fixtures that fixture takes included)."""
module_marks: Set[str] = set()
for node in tree.body:
if isinstance(node, ast.Assign) and any(isinstance(t, ast.Name) and t.id == "pytestmark" for t in node.targets):
module_marks |= _marks(node.value)
functions: List[Tuple[str, ast.AST, Set[str]]] = [] # qualified name, node, the marks of its classes and module
def collect(body: List[ast.stmt], prefix: str, inherited: Set[str]) -> None:
for node in body:
if isinstance(node, (ast.FunctionDef, ast.AsyncFunctionDef)):
functions.append((prefix + node.name, node, inherited))
elif isinstance(node, ast.ClassDef):
marks = set(inherited)
for decorator in node.decorator_list:
marks |= _marks(decorator)
for stmt in node.body:
if isinstance(stmt, ast.Assign) and any(isinstance(t, ast.Name) and t.id == "pytestmark" for t in stmt.targets):
marks |= _marks(stmt.value)
collect(node.body, prefix + node.name + ".", marks)
collect(tree.body, "", module_marks)
def is_a_fixture(node: ast.AST) -> bool:
return any(_dotted(d.func if isinstance(d, ast.Call) else d).rsplit(".", 1)[-1] == "fixture" for d in node.decorator_list) # type: ignore[attr-defined]
def parameters(node: ast.AST) -> List[str]:
arguments = node.args # type: ignore[attr-defined]
return [a.arg for a in list(arguments.posonlyargs) + list(arguments.args) + list(arguments.kwonlyargs)]
delaying = {name.rsplit(".", 1)[-1] for name, node, _ in functions if is_a_fixture(node) and _first_lab_delay(node) is not None}
grew = True
while grew: # a fixture that takes a delaying fixture delays too
grew = False
for name, node, _ in functions:
short = name.rsplit(".", 1)[-1]
if is_a_fixture(node) and short not in delaying and delaying & set(parameters(node)):
delaying.add(short)
grew = True
out: List[Tuple[str, int, str]] = []
for name, node, inherited in functions:
if not name.rsplit(".", 1)[-1].startswith("test_") or is_a_fixture(node):
continue
marks = set(inherited)
for decorator in node.decorator_list: # type: ignore[attr-defined]
marks |= _marks(decorator)
if "e2e" not in marks or "wall_clock" in marks:
continue
used = set(parameters(node))
for decorator in node.decorator_list: # type: ignore[attr-defined]
if isinstance(decorator, ast.Call) and _dotted(decorator.func).rsplit(".", 1)[-1] == "usefixtures":
used |= {a.value for a in decorator.args if isinstance(a, ast.Constant) and isinstance(a.value, str)}
own = _first_lab_delay(node)
if own is not None:
out.append((name, getattr(own, "lineno", node.lineno), ast.unparse(own).splitlines()[0][:80]))
elif used & LAB_DELAY_PARAMETERS:
out.append((name, node.lineno, "parameter " + sorted(used & LAB_DELAY_PARAMETERS)[0]))
elif used & delaying:
out.append((name, node.lineno, "fixture " + sorted(used & delaying)[0]))
return out
def analyze(source: str, file: str, *, force: bool = False) -> List[Violation]:
"""The occurrences of ``source`` (the content of ``tests/<file>``). A test file with no ``e2e`` marker is not read, unless ``force`` (the helpers always are)."""
tree = ast.parse(source)
@@ -615,6 +712,8 @@ def analyze(source: str, file: str, *, force: bool = False) -> List[Violation]:
if not e2e or file in SELF:
return []
reader = _Reader(file, tree, e2e)
if file.startswith("test_"):
reader.found.extend((scope, "lab-delay", line, text) for scope, line, text in _lab_delays(tree))
reader.found.sort(key=lambda item: item[2])
counts: Dict[Tuple[str, str], int] = {}
out: List[Violation] = []
@@ -684,6 +783,7 @@ DEBT_REASON = {
"net": "A real host in a gate is a third party: serve the page and the answer from the test's own server.",
"count": "The number of processes is not something the product promises: count by site name or against the pool the product keeps (tests/_processes.py, tests/_waits.py).",
"timeout": "A deadline under 30 s on a wait for something that must happen is a verdict on the machine: a loaded runner is slower than the one it was written on. Give it 30 s (or the deadline the product itself has), and read the result after it.",
"lab-delay": "A delay given to a lab gateway or server, and a wait for what the product decides with a time budget, read the wall clock: mark the test wall_clock (the serial lane, the whole machine), or take the delay out of the verdict.",
"egress": "The launch asks three services of the internet where it leaves from: declare the exit (tests/_lab_egress.py).",
}
+197
View File
@@ -0,0 +1,197 @@
"""What an e2e test that fails leaves for a reader, and nothing when it passes.
``with FailureEvidence("name") as evidence:`` around the body of a test: while the body runs, the helper collects, in a temporary folder,
the sources the test points it at (the fake web's own record, the Juggler wire of the served browser, the engine's own Juggler trace,
the client's view of every request); when the body raises (an assertion included), it copies what it holds to
``$RUNNER_TEMP/invpw-evidence/<name>/<pid>-<ms>/``, the folder the e2e jobs upload (``invpw-evidence-*``), with a ``meta.json``; when the
body passes, it deletes it all. Off a runner (no ``RUNNER_TEMP``) nothing is copied. It changes no assertion, wait or deadline of the
test: it only listens.
A test that passed slowly may keep the evidence too: ``evidence.keep(why)`` saves what the helper holds at that moment (the same folder, a
``meta.json`` whose ``kept`` says why, judged after the fact and never a verdict). ``arm(moz_log=...)`` also starts the engine's own log
(``MOZ_LOG``, one file per process in the evidence: ``MOZ_LOG_FILE`` carries ``%PID``), and ``note_records(name, state)`` adds a record the test keeps itself (``state.lock``,
``state.records``) as ``<name>.jsonl``.
The times written: ``t``, wall-clock seconds since the epoch (``time.time()``; the engine's own trace writes milliseconds in ``t``, its
``performance.timeOrigin + now``, also since the epoch), and ``m``, ``time.perf_counter()`` of the test process, finer on Windows (whose wall
clock ticks every 15 ms) and shared by the fake web's record, the client's log and the Juggler wire.
"""
from __future__ import annotations
import json
import os
import pathlib
import platform
import shutil
import sys
import tempfile
import threading
import time
import pytest
#: The folder under ``$RUNNER_TEMP`` the e2e workflows upload (``invpw-evidence-*``).
EVIDENCE_FOLDER = "invpw-evidence"
#: The most characters of one Juggler message kept in the wire log: a message longer than this is cut and says so.
WIRE_LIMIT = 4000
#: The engine's trace: the variable `Trace.js` of the engine reads in the parent process (off without it).
TRACE_ENV = "INVISIBLE_JUGGLER_TRACE_DIR"
#: The base name of the engine's log files in the evidence, and the name given to ``MOZ_LOG_FILE``: Firefox expands ``%PID`` into ``-main.<pid>`` or
#: ``-child.<pid>`` (and adds ``.moz_log``, ``ExpandLogFileName`` in ``xpcom/base/Logging.cpp``), so that every process of every session of a test writes a
#: file of its own. Without it two sessions of one test wrote the same file and the parent's one was 0 bytes.
MOZ_LOG_BASE = "engine"
MOZ_LOG_FILE_NAME = MOZ_LOG_BASE + "%PID"
class FailureEvidence:
def __init__(self, name: str):
self.name = name
self.work = pathlib.Path(tempfile.mkdtemp(prefix="invpw-failure-evidence-"))
self.trace_dir = self.work / "juggler-engine-trace"
self.wire_path = self.work / "juggler-wire.jsonl"
self.moz_log_dir = self.work / "moz-log"
#: The records the test keeps itself, by name (``note_records``).
self.records = {}
#: What the client heard of each request (a list ``profile_p2.drive(client_log=...)`` fills).
self.client_log = []
#: The cells of the run, once it has returned (``note_cells``).
self.cells = None
self._stop = None
self._patch = None
self._wire = None
self._wire_lock = threading.Lock()
self.saved_to = None
# ---- what the test points the helper at ---------------------------------------------------------------------------
def watch_server(self, stop) -> None:
"""The ``stop`` function ``tests/fakeweb/sites.start`` returned: it carries the server's own record (``stop.state``)."""
self._stop = stop
def note_cells(self, cells) -> None:
self.cells = cells
def note_records(self, name: str, state) -> None:
"""A record the test keeps itself (``state.lock``, ``state.records``: a list of dicts), saved as ``<name>.jsonl``."""
self.records[name] = state
def arm(self, moz_log: str = "") -> None:
"""Before the browser under test is launched: the engine writes its trace, and the Juggler wire of this process is logged.
Armed after the other processes of the test were started, so that they do not inherit the variable. ``moz_log``, a value of
``MOZ_LOG`` (modules and levels), also starts the engine's own log into the evidence (a diagnostic no page reads: the core passes it)."""
self.trace_dir.mkdir(parents=True, exist_ok=True)
self._patch = pytest.MonkeyPatch()
self._patch.setenv(TRACE_ENV, str(self.trace_dir))
if moz_log:
self.moz_log_dir.mkdir(parents=True, exist_ok=True)
self._patch.setenv("MOZ_LOG", moz_log)
self._patch.setenv("MOZ_LOG_FILE", str(self.moz_log_dir / MOZ_LOG_FILE_NAME))
self._wire = open(self.wire_path, "w", encoding="utf-8")
try:
from invisible_core.juggler import connection
except Exception as exc: # the trace of the engine is still written; say that the wire is not
self._write_wire({"dir": "note", "what": "the Juggler wire is not logged: %r" % (exc,)})
return
owner = self
original_deliver, original_write = connection.Connection._deliver, connection.Connection._write
def deliver(connection_self, raw):
owner._log_wire("in", raw)
return original_deliver(connection_self, raw)
def write(connection_self, msg):
owner._log_wire("out", msg)
return original_write(connection_self, msg)
self._patch.setattr(connection.Connection, "_deliver", deliver)
self._patch.setattr(connection.Connection, "_write", write)
# ---- the wire ------------------------------------------------------------------------------------------------------
def _write_wire(self, record: dict) -> None:
try:
with self._wire_lock:
if self._wire is not None:
self._wire.write(json.dumps(record, default=str) + "\n")
self._wire.flush()
except Exception:
pass
def _log_wire(self, direction: str, message) -> None:
try:
if isinstance(message, (bytes, bytearray)):
text = bytes(message).decode("utf-8", "replace")
else:
text = json.dumps(message, default=str)
cut = len(text) > WIRE_LIMIT
self._write_wire({"t": round(time.time(), 4), "m": round(time.perf_counter(), 6), "dir": direction, "len": len(text), "cut": cut,
"msg": text[:WIRE_LIMIT]})
except Exception:
pass
# ---- the end ---------------------------------------------------------------------------------------------------------
def keep(self, why: str) -> None:
"""Saves what the helper holds now, though the test has not failed: a run judged after the fact as one to read (a step slower
than any healthy run). Not a verdict: nothing is raised and the test goes on. Never raises."""
try:
self._save(None, None, kept=why)
except Exception as problem:
sys.stderr.write("evidence: could not be kept: %r\n" % (problem,))
def __enter__(self) -> "FailureEvidence":
return self
def __exit__(self, exc_type, exc, tb) -> bool:
try:
if self._patch is not None:
self._patch.undo()
with self._wire_lock:
if self._wire is not None:
self._wire.close()
self._wire = None
if exc_type is not None:
self._save(exc_type, exc)
except Exception as problem: # the evidence never hides the failure it is about
sys.stderr.write("failure evidence: could not be saved: %r\n" % (problem,))
finally:
shutil.rmtree(self.work, ignore_errors=True)
return False
def _save(self, exc_type, exc, kept: str = "") -> None:
base = os.environ.get("RUNNER_TEMP")
if not base:
return
target = pathlib.Path(base) / EVIDENCE_FOLDER / self.name / ("%d-%d" % (os.getpid(), int(time.time() * 1000)))
target.mkdir(parents=True, exist_ok=True)
if self._stop is not None and getattr(self._stop, "state", None) is not None:
state = self._stop.state
with state.lock:
records = list(state.records)
self._jsonl(target / "fakeweb-server-record.jsonl", records)
for name, state in self.records.items():
with state.lock:
records = list(state.records)
self._jsonl(target / ("%s.jsonl" % name), records)
self._jsonl(target / "client-request-log.jsonl", list(self.client_log))
if self.cells is not None:
(target / "cells.json").write_text(json.dumps(self.cells, indent=1, default=str), encoding="utf-8")
if self.wire_path.exists():
shutil.copyfile(self.wire_path, target / "juggler-wire.jsonl")
if self.trace_dir.exists():
shutil.copytree(self.trace_dir, target / "juggler-engine-trace", dirs_exist_ok=True)
if self.moz_log_dir.exists():
shutil.copytree(self.moz_log_dir, target / "moz-log", dirs_exist_ok=True)
meta = {"test": self.name, "platform": sys.platform,
"machine": platform.machine(), "python": platform.python_version(), "saved_at": round(time.time(), 4),
"times": "t: wall-clock seconds since the epoch (the engine's trace: milliseconds, in t); m: time.perf_counter() of the test process, the scale shared by the server record, the client log and the wire",
"files": sorted(p.name for p in target.iterdir())}
if exc_type is not None:
meta["failure"] = "%s: %s" % (exc_type.__name__, str(exc)[:1500])
if kept:
meta["kept"] = kept
(target / "meta.json").write_text(json.dumps(meta, indent=1), encoding="utf-8")
self.saved_to = target
@staticmethod
def _jsonl(path: pathlib.Path, records) -> None:
with open(path, "w", encoding="utf-8") as out:
for record in records:
out.write(json.dumps(record, default=str) + "\n")
+133
View File
@@ -0,0 +1,133 @@
"""``FailureEvidence`` that also keeps a folder of extra files (the engine's own log of the launch, a lab server's record, a page's timeline).
The test writes whatever it wants to keep into ``evidence.files`` while it runs. When the body fails, the folder is copied next to the
rest of the evidence (``<evidence folder>/files/``) and ``meta.json`` lists it; when the body passes, it is deleted with the rest.
Nothing else differs from ``tests/_evidence_on_failure.py``.
"""
from __future__ import annotations
import json
import re
import shutil
import subprocess
import sys
import threading
import time
from _evidence_on_failure import FailureEvidence
class FailureEvidenceWithFiles(FailureEvidence):
def __init__(self, name: str):
super().__init__(name)
#: Under the helper's own temporary folder: removed with it when the body passes.
self.files = self.work / "files"
self.files.mkdir(parents=True, exist_ok=True)
def _save(self, exc_type, exc) -> None:
super()._save(exc_type, exc)
if self.saved_to is None or not self.files.exists():
return
shutil.copytree(self.files, self.saved_to / "files", dirs_exist_ok=True)
meta_path = self.saved_to / "meta.json"
meta = json.loads(meta_path.read_text(encoding="utf-8"))
meta["files"] = sorted(p.name for p in self.saved_to.iterdir())
meta["extra_files"] = sorted(str(p.relative_to(self.files)).replace("\\", "/") for p in self.files.rglob("*") if p.is_file())
meta_path.write_text(json.dumps(meta, indent=1), encoding="utf-8")
class _TeeStream:
"""The browser's merged stdout and stderr as the core reads it, copied line by line to a file: ``<wall clock> <perf_counter> <line>``.
The core reads the pipe with ``readline`` for the whole life of the process (``invisible_core.juggler.connection.ProcessOutput``) and keeps only the last
200 lines, so this sits between the pipe and that reader: every line it returns is also appended to ``path``, nothing else changes. The content processes
inherit the parent's stdout (ipc/chromium/src/base/process_util_win.cc ``GetStdHandle(STD_OUTPUT_HANDLE)``; a plain fork on Linux), so what they
``printf`` arrives here. The file is opened for each line and closed again: the folder it is in can be removed at any moment (a launch that went right)
with nothing left open. It never raises."""
def __init__(self, stream, path):
self._stream = stream
self._path = path
self._lock = threading.Lock()
def readline(self, *args):
raw = self._stream.readline(*args)
if raw and self._path:
try:
with self._lock, open(self._path, "ab") as out:
out.write(("%.4f %.6f " % (time.time(), time.perf_counter())).encode("ascii") + raw.rstrip(b"\r\n") + b"\n")
except Exception:
pass
return raw
def __getattr__(self, name):
return getattr(self._stream, name)
_TEE = {"path": None}
def tee_browser_output(monkeypatch, path) -> bool:
"""From now on, until the end of the test, the stdout of the browser the core launches next is also written to ``path`` (see ``_TeeStream``). Test side
only: it wraps the stream the core hands to its own reader, in the test process, and touches nothing of the product. Called again with another
``path`` it only changes where the next launch's lines go. False (and nothing changed) when the core has no such reader."""
try:
from invisible_core.juggler import connection
output = connection.ProcessOutput
original = output.__init__
except Exception:
return False
_TEE["path"] = str(path)
if getattr(original, "_invpw_tee", False):
return True
def init(self, stream):
original(self, _TeeStream(stream, _TEE["path"]))
init._invpw_tee = True
monkeypatch.setattr(output, "__init__", init)
return True
#: The most a command of the probe is waited for, in seconds (the suite's 30 s: a command that hangs is cut and the file says so).
_PROBE_COMMAND_S = 30
def _run(argv):
started = time.perf_counter()
try:
done = subprocess.run(argv, capture_output=True, text=True, encoding="utf-8", errors="replace", timeout=_PROBE_COMMAND_S)
text = (done.stdout or "") + (("\n[stderr]\n" + done.stderr) if done.stderr and done.stderr.strip() else "")
return "$ %s\n[exit %s, %.2f s]\n%s\n" % (" ".join(argv), done.returncode, time.perf_counter() - started, text.rstrip())
except Exception as problem:
return "$ %s\n[could not run: %r]\n" % (" ".join(argv), problem)
_SHOW_PROCESSES = (
"foreach ($p in @(%s)) { try { Get-Process -Id $p -ErrorAction Stop | Select-Object Id,ProcessName,StartTime,Path | Format-List } "
"catch { 'pid ' + $p + ': ' + $_.Exception.Message } }")
def probe_machine(path) -> None:
"""Who holds UDP 5353 on this machine, now, written to ``path``: the failure evidence of the mDNS test (the engine's responder binds it, and so does any
other browser of the machine). Windows: ``Get-NetUDPEndpoint -LocalPort 5353`` and ``Get-Process`` of each owning pid. Linux: ``ss -uapn``. Meant to be
called while the browser of the launch is still up. It only reads, never raises and never changes a verdict."""
try:
text = "taken_t %.4f\ntaken_m %.6f\nplatform %s\n\n" % (time.time(), time.perf_counter(), sys.platform)
if sys.platform == "win32":
endpoints = _run(["powershell", "-NoProfile", "-Command",
"Get-NetUDPEndpoint -LocalPort 5353 | Select-Object LocalAddress,LocalPort,OwningProcess,CreationTime | Format-List"])
text += endpoints + "\n"
pids = sorted({int(n) for n in re.findall(r"OwningProcess\s*:\s*(\d+)", endpoints)})
if pids:
text += _run(["powershell", "-NoProfile", "-Command", _SHOW_PROCESSES % ",".join(str(n) for n in pids)])
else:
text += _run(["ss", "-uapn", "sport", "=", ":5353"])
with open(path, "w", encoding="utf-8") as out:
out.write(text)
except Exception as problem:
try:
with open(path, "w", encoding="utf-8") as out:
out.write("the machine probe failed: %r\n" % (problem,))
except Exception:
pass
+58
View File
@@ -0,0 +1,58 @@
"""A stock Playwright client that launches nothing and records what ``p.firefox.launch`` was called with, for the unit tests of the stock twins (no browser, no display)."""
from __future__ import annotations
from typing import Any, Dict, List
import _stock_twin
class _Page:
pass
class _Context:
def new_page(self) -> _Page:
return _Page()
class _Browser:
def __init__(self, events: List[str]) -> None:
self._events = events
def new_context(self, **kwargs: Any) -> _Context:
return _Context()
def close(self) -> None:
self._events.append("browser closed")
class _Firefox:
def __init__(self, launches: List[Dict[str, Any]], events: List[str], fail: bool) -> None:
self._launches, self._events, self._fail = launches, events, fail
def launch(self, **kwargs: Any) -> _Browser:
self._events.append("launch")
self._launches.append(kwargs)
if self._fail:
raise RuntimeError("the launch fails")
return _Browser(self._events)
class _Playwright:
def __init__(self, launches: List[Dict[str, Any]], events: List[str], fail: bool) -> None:
self.firefox = _Firefox(launches, events, fail)
def __enter__(self) -> "_Playwright":
return self
def __exit__(self, *exc: Any) -> bool:
return False
def install(monkeypatch, events: List[str] = None, fail: bool = False) -> List[Dict[str, Any]]:
"""``_stock_twin._on_stock`` on a client that records its launches (the keywords of each) in the list returned, and its steps in ``events``."""
launches: List[Dict[str, Any]] = []
events = [] if events is None else events
monkeypatch.setattr(_stock_twin, "stock_client", lambda: (lambda: _Playwright(launches, events, fail)))
monkeypatch.setattr(_stock_twin, "Chrome", type("FakeChrome", (), {"__init__": lambda self, page: None, "close": lambda self: None}))
return launches
+359
View File
@@ -0,0 +1,359 @@
"""What a failed far-away gather says about the machine and the core's own measurement (the recorders of ``_Watch`` in tests/test_webrtc_realness.py).
The gateway of these tests simulates distance with sleeps and timers inside the process of pytest, which also runs the core's UDP measurement.
When the gather fails the question is where the time went: in the gateway's own answers, in a stall of the whole worker process, or in a
runner with no CPU left. Three recorders answer it, each kept as a list of records the evidence saves (``FailureEvidence.note_records``) and
each said in a few lines of the failure message:
* the times of every control connection of the gateway (connect, greeting, authentication, ASSOCIATE asked and answered), read from the
records the watch already makes, and how long the gateway sat on an answer;
* the records of the core's logger ``invisible_core._udp_exit`` at DEBUG (the outcome of its UDP measurement), set and removed around the test,
next to the marks the test makes (the launch that runs the measurement starts and returns);
* a witness of the whole process (a daemon thread that beats every 50 ms and records the gaps over 200 ms) and the runner's CPU load,
sampled every 0.5 s.
Nothing here changes an assertion, a wait, a deadline or a measurement: a recorder only listens, never raises into the test or into a server,
and takes every record as ONE dict (no keyword that can collide with a field of the data).
"""
from __future__ import annotations
import logging
import threading
import time
#: The logger of the core whose DEBUG records say how its UDP measurement ended (``invisible_core/_udp_exit.py``: ``log = getLogger(__name__)``).
UDP_EXIT_LOGGER = "invisible_core._udp_exit"
#: The beat of the witness and the gap it calls a stall, in seconds.
BEAT_S, STALL_S = 0.05, 0.2
#: How often the runner's load is sampled, in seconds.
LOAD_EVERY_S = 0.5
#: The most control connections and stalls said in the message (the evidence has all of them).
MESSAGE_CONNECTIONS, MESSAGE_STALLS = 3, 4
class Records:
"""A list of records for ``FailureEvidence.note_records`` (``lock``, ``records``). ``add`` never raises: it is called from threads of the test
and, through the watch, from the gateway's own."""
def __init__(self):
self.lock = threading.Lock()
self.records = []
def add(self, record):
try:
record = dict(record)
record.setdefault("t", round(time.time(), 4))
with self.lock:
self.records.append(record)
except Exception as problem: # noqa: BLE001 - recorded, never raised
try:
with self.lock:
self.records.append({"origin": "probe", "event": "a record could not be kept", "error": repr(problem)})
except Exception: # noqa: BLE001
pass
def all(self):
with self.lock:
return list(self.records)
def _say(value):
return "?" if value is None else ("%.2f" % value)
# ---- the witness of the whole process ----------------------------------------------------------------------------------------------
class StallWitness:
"""A daemon thread that beats every ``beat_s`` and keeps the gaps over ``stall_s``. A call that holds the GIL (a long call into C) or a
machine with no CPU left for this process delays the beat of every thread alike, so a gap is a stall of the whole worker process, the one
that also holds the gateway's own threads. Times are seconds from ``epoch`` (``time.monotonic()`` of the start of the gateway: the scale
of its records) and ``t``, the wall clock."""
def __init__(self, records, epoch, beat_s=BEAT_S, stall_s=STALL_S, clock=time.monotonic):
self.records, self.epoch, self.beat_s, self.stall_s, self._clock = records, epoch, beat_s, stall_s, clock
self.beats = 0
self.first = self.last = None
self.longest_gap_s = 0.0
self._stop = threading.Event()
self._thread = None
def beat(self):
"""One beat. Never raises: a clock that fails is a record."""
try:
now = self._clock()
if self.last is None:
self.first = now
else:
gap = now - self.last
self.longest_gap_s = max(self.longest_gap_s, gap)
if gap > self.stall_s:
self.records.add({"origin": "witness", "event": "stall", "from_gw": round(self.last - self.epoch, 4),
"to_gw": round(now - self.epoch, 4), "gap_s": round(gap, 4)})
self.last = now
self.beats += 1
except Exception as problem: # noqa: BLE001
self.records.add({"origin": "witness", "event": "a beat could not be made", "error": repr(problem)})
def _run(self):
try:
while not self._stop.wait(self.beat_s):
self.beat()
except Exception as problem: # noqa: BLE001
self.records.add({"origin": "witness", "event": "the witness ended", "error": repr(problem)})
def start(self):
try:
self.beat()
self._thread = threading.Thread(target=self._run, name="far-away-stall-witness", daemon=True)
self._thread.start()
except Exception as problem: # noqa: BLE001
self.records.add({"origin": "witness", "event": "the witness did not start", "error": repr(problem)})
def stop(self):
"""Ends the witness and says what it saw: the last gap (from its last beat to now) is a stall too if it is long."""
try:
self._stop.set()
if self._thread is not None:
self._thread.join(5)
self.beat()
self.records.add({"origin": "witness", "event": "the witness stopped", "beats": self.beats, "beat_s": self.beat_s,
"stall_s": self.stall_s, "longest_gap_s": round(self.longest_gap_s, 4),
"watched_s": None if self.first is None or self.last is None else round(self.last - self.first, 4)})
except Exception as problem: # noqa: BLE001
self.records.add({"origin": "witness", "event": "the witness did not stop cleanly", "error": repr(problem)})
def stalls(self):
return [r for r in self.records.all() if r.get("event") == "stall"]
# ---- the load of the runner -------------------------------------------------------------------------------------------------------
class LoadSampler:
"""The runner's CPU load every ``every_s`` seconds: ``cpu_percent(percpu=False)`` since the previous sample and, where the system has it,
the load average. ``source`` is ``psutil`` (a stand-in in the unit tests)."""
def __init__(self, records, epoch, every_s=LOAD_EVERY_S, source=None, clock=time.monotonic):
self.records, self.epoch, self.every_s, self._clock = records, epoch, every_s, clock
self.source = source
self._stop = threading.Event()
self._thread = None
def sample(self):
"""One sample. Never raises: a source that fails is a record."""
try:
record = {"origin": "load", "event": "sample", "gw": round(self._clock() - self.epoch, 4)}
record["cpu_percent"] = self.source.cpu_percent(percpu=False)
if hasattr(self.source, "getloadavg"):
try:
record["loadavg_1_5_15"] = [round(v, 2) for v in self.source.getloadavg()]
except Exception as problem: # noqa: BLE001
record["loadavg_error"] = repr(problem)
self.records.add(record)
except Exception as problem: # noqa: BLE001
self.records.add({"origin": "load", "event": "a sample could not be taken", "error": repr(problem)})
def _run(self):
try:
while not self._stop.wait(self.every_s):
self.sample()
except Exception as problem: # noqa: BLE001
self.records.add({"origin": "load", "event": "the sampler ended", "error": repr(problem)})
def start(self):
try:
if self.source is None:
import psutil
self.source = psutil
self.source.cpu_percent(percpu=False) # the first reading has no window: it is only the start of the first one
if hasattr(self.source, "getloadavg"):
self.source.getloadavg() # on Windows the first call starts the thread that makes the average
self._thread = threading.Thread(target=self._run, name="far-away-load-sampler", daemon=True)
self._thread.start()
except Exception as problem: # noqa: BLE001
self.records.add({"origin": "load", "event": "the sampler did not start", "error": repr(problem)})
def stop(self):
try:
self._stop.set()
if self._thread is not None:
self._thread.join(5)
self.sample()
except Exception as problem: # noqa: BLE001
self.records.add({"origin": "load", "event": "the sampler did not stop cleanly", "error": repr(problem)})
def samples(self):
return [r for r in self.records.all() if r.get("event") == "sample" and isinstance(r.get("cpu_percent"), (int, float))]
# ---- the core's logger ------------------------------------------------------------------------------------------------------------
class _KeepRecords(logging.Handler):
def __init__(self, records, epoch, clock):
super().__init__(level=logging.DEBUG)
self.records, self.epoch, self._clock = records, epoch, clock
def emit(self, record):
try:
self.records.add({"origin": "core", "event": "log", "logger": record.name, "level": record.levelname,
"message": record.getMessage(), "thread": record.threadName, "gw": round(self._clock() - self.epoch, 4)})
except Exception as problem: # noqa: BLE001 - a message that cannot be formatted is a record, not an error of the core's thread
try:
self.records.add({"origin": "probe", "event": "a log record could not be kept", "logger": getattr(record, "name", None),
"error": repr(problem)})
except Exception: # noqa: BLE001 - not even that: nothing is raised into the logging call of the core
pass
class LogCapture:
"""The records of the logger ``name`` at DEBUG while it is on: its level is set and the handler added at ``start``, and both are put back at
``stop`` whatever happened in between. The logger keeps passing every record on to its parents as before."""
def __init__(self, records, epoch, name=UDP_EXIT_LOGGER, clock=time.monotonic):
self.records, self.name = records, name
self._handler = _KeepRecords(records, epoch, clock)
self._level = None
self._on = False
def start(self):
try:
logger = logging.getLogger(self.name)
self._level = logger.level
logger.addHandler(self._handler)
self._on = True
logger.setLevel(logging.DEBUG)
except Exception as problem: # noqa: BLE001
self.records.add({"origin": "probe", "event": "the log capture did not start", "error": repr(problem)})
def stop(self):
try:
if self._on:
logger = logging.getLogger(self.name)
logger.removeHandler(self._handler)
logger.setLevel(self._level)
self._on = False
except Exception as problem: # noqa: BLE001
self.records.add({"origin": "probe", "event": "the log capture did not stop", "error": repr(problem)})
# ---- the times of the control connections ----------------------------------------------------------------------------------------
def control_times(records):
"""From the records of the watch's control journal (``gateway-control-connections``): for each control connection, in seconds from the start
of the gateway, when it was accepted (connect), when the greeting and the authentication were answered, when the ASSOCIATE was asked and
answered, and the longest time the gateway sat on an answer between the moment it was asked to send it and the moment it was sent.
``None`` is a step that was not seen. Never raises."""
table = {}
try:
for r in records:
conn = r.get("conn")
if conn is None or conn < 0:
continue
row = table.setdefault(conn, {"connect": None, "greeting": None, "authentication": None, "associate_asked": None,
"associate_answered": None, "longest_answer_wait_s": None})
event = r.get("event")
if event == "control connection accepted":
row["connect"] = r.get("gw")
elif event == "request" and r.get("command") == "UDP ASSOCIATE":
row["associate_asked"] = r.get("gw")
elif event == "answer sent":
what = str(r.get("what", ""))
if what.startswith("method selection"):
row["greeting"] = r.get("gw")
elif what.startswith("authentication status"):
row["authentication"] = r.get("gw")
elif r.get("kind") == "associate" and r.get("rep") == 0:
row["associate_answered"] = r.get("gw")
if r.get("gw") is not None and r.get("asked_gw") is not None:
wait = round(r["gw"] - r["asked_gw"], 4)
if row["longest_answer_wait_s"] is None or wait > row["longest_answer_wait_s"]:
row["longest_answer_wait_s"] = wait
except Exception as problem: # noqa: BLE001
table["error"] = repr(problem)
return table
def control_line(table):
"""The control connections in one line: ``#<n> connect|greeting|authentication|ASSOCIATE asked|ASSOCIATE answered`` in seconds from the start of
the gateway, the longest wait inside the gateway for an answer, and a reminder that #0 is the core's (the first accepted)."""
try:
rows = sorted((k, v) for k, v in table.items() if isinstance(k, int))
if not rows:
return "control connections of the gateway: none seen"
shown = " ".join("#%d %s|%s|%s|%s|%s (longest wait in the gateway %ss)" % (
k, _say(v["connect"]), _say(v["greeting"]), _say(v["authentication"]), _say(v["associate_asked"]), _say(v["associate_answered"]),
_say(v["longest_answer_wait_s"])) for k, v in rows[:MESSAGE_CONNECTIONS])
return ("control connections of the gateway, s from its start, connect|greeting answered|authentication answered|ASSOCIATE asked|"
"ASSOCIATE answered (#0 is the first accepted: the core's own measurement), %d of %d: %s" % (min(len(rows), MESSAGE_CONNECTIONS), len(rows), shown))
except Exception as problem: # noqa: BLE001
return "control connections of the gateway: not read (%r)" % (problem,)
def core_line(records):
"""The core's UDP measurement in one line: its DEBUG records and the marks of the test, each with its time in seconds from the start of the gateway."""
try:
parts = []
for r in records:
if r.get("event") == "log":
parts.append("%s: %r at %s" % (r.get("thread"), r.get("message"), _say(r.get("gw"))))
elif r.get("event") == "mark":
parts.append("%s at %s" % (r.get("what"), _say(r.get("gw"))))
return "the core's UDP measurement (logger %s, s from the gateway start): %s" % (UDP_EXIT_LOGGER, "; ".join(parts) or "no record")
except Exception as problem: # noqa: BLE001
return "the core's UDP measurement: not read (%r)" % (problem,)
def process_line(witness, sampler):
"""The stalls of the process and the runner's load in one line each."""
try:
stalls = sorted(witness.stalls(), key=lambda s: -s["gap_s"])
samples = sampler.samples() if sampler is not None else []
if stalls:
said = ", ".join("%.2fs (%.2f to %.2f)" % (s["gap_s"], s["from_gw"], s["to_gw"]) for s in stalls[:MESSAGE_STALLS])
stall = "%d stall(s) of the whole process over %.0f ms, longest first, gap (from to, s from the gateway start): %s" % (
len(stalls), witness.stall_s * 1000, said)
else:
stall = "no stall of the whole process over %.0f ms in %d beats of %.0f ms (longest gap %.3fs)" % (
witness.stall_s * 1000, witness.beats, witness.beat_s * 1000, witness.longest_gap_s)
if samples:
cpu = [s["cpu_percent"] for s in samples]
loads = [s["loadavg_1_5_15"][0] for s in samples if s.get("loadavg_1_5_15")]
load = "runner CPU every %.1fs: %d samples, max %.0f%%, mean %.0f%%, at least 90%% in %d%s" % (
sampler.every_s, len(cpu), max(cpu), sum(cpu) / len(cpu), sum(1 for c in cpu if c >= 90),
"; load average max %.2f" % max(loads) if loads else "")
else:
load = "runner CPU: no sample"
return stall + "\n" + load
except Exception as problem: # noqa: BLE001
return "stall witness and runner load: not read (%r)" % (problem,)
class FarAwayProbes:
"""The three recorders of one gather, started and stopped together. ``epoch`` is ``time.monotonic()`` at the start of the gateway."""
def __init__(self, epoch, load_source=None):
self.epoch = epoch
self.stall_records, self.load_records, self.core_records = Records(), Records(), Records()
self.witness = StallWitness(self.stall_records, epoch)
self.sampler = LoadSampler(self.load_records, epoch, source=load_source)
self.core = LogCapture(self.core_records, epoch)
def start(self):
self.core.start()
self.sampler.start()
self.witness.start()
def stop(self):
self.witness.stop()
self.sampler.stop()
self.core.stop()
def mark(self, what):
"""A moment of the test (the launch that runs the core's measurement starts, returns), on the scale of the core's records."""
self.core_records.add({"origin": "test", "event": "mark", "what": what, "gw": round(time.monotonic() - self.epoch, 4)})
def lines(self, control_records):
"""The failure message: the times of the control connections, the core's measurement, the stalls and the load."""
return "\n".join(["far-away probes:", control_line(control_times(control_records)), core_line(self.core_records.all()),
process_line(self.witness, self.sampler)])
def cells(self, control_records):
return {"control_connection_times_s_from_the_gateway_start": control_times(control_records),
"stalls_of_the_whole_process": self.witness.stalls(), "stall_beats": self.witness.beats,
"longest_gap_between_beats_s": round(self.witness.longest_gap_s, 4),
"runner_load_samples": self.sampler.samples(), "core_udp_exit_log_and_marks": self.core_records.all()}
+244
View File
@@ -0,0 +1,244 @@
"""What the e2e tests of the font list need to know about the bundle and about the host, read from files and never typed.
Two sources, both plain data:
* the bundle manifest the core hands to the engine (``invisible_core._fpforge.profile.FONT_MANIFEST``, the text of
``bundle-fonts.list``: ``F|<family>`` opens a family, ``f|<file>|<index>|...|<psname>|<upem>|<ascent>|<descent>|...`` is one of its faces,
``A|<alias>|<target>`` is a Windows font-substitute). The engine prefers this text to the copy in its own directory, so it is the list of
the families the engine answers to;
* the font files of the machine that runs the test (the host): the folders a system installs fonts in. Each file's ``name`` table gives the
family, PostScript and full names of each of its faces. A host font whose names are not in the bundle is a "host-only" face: the engine
must not know it, and a test that asks the page for it has a name that exists on this machine and in no bundle.
Only the header and the ``name`` table of a file are read (a font collection is several faces; ``simsun.ttc`` is 15 MB).
"""
from __future__ import annotations
import os
import struct
import sys
from pathlib import Path
from typing import Dict, Iterable, List, Optional, Set
#: What an sfnt file starts with: TrueType 1.0, OpenType with CFF outlines, the Apple TrueType tag, a collection.
_SFNT = (b"\x00\x01\x00\x00", b"OTTO", b"true")
_COLLECTION = b"ttcf"
_EXTENSIONS = {".ttf", ".otf", ".ttc", ".otc"}
#: name ids of the strings that name a face.
FAMILY, FULL, POSTSCRIPT, TYPOGRAPHIC_FAMILY = 1, 4, 6, 16
class Manifest:
"""The bundle manifest, parsed: families in order, the faces of each (file, index, PostScript name, metrics) and the aliases."""
def __init__(self, text: str):
self.families: List[str] = []
self.faces: Dict[str, List[dict]] = {}
self.aliases: Dict[str, str] = {}
current: Optional[str] = None
for line in text.splitlines():
if not line or line.startswith("#"):
continue
fields = line.split("|")
if fields[0] == "F" and len(fields) >= 2:
current = fields[1]
self.families.append(current)
self.faces[current] = []
elif fields[0] == "A" and len(fields) >= 3:
self.aliases[fields[1]] = fields[2]
elif fields[0] == "f" and current is not None and len(fields) >= 19:
self.faces[current].append({
"file": fields[1], "index": int(fields[2]), "psname": fields[8],
"upem": int(fields[9]), "ascent": int(fields[10]), "descent": int(fields[11]),
})
def family_of_psname(self, psname: str) -> Optional[str]:
for family, faces in self.faces.items():
if any(face["psname"] == psname for face in faces):
return family
return None
def face_with_psname(self, psname: str) -> dict:
for faces in self.faces.values():
for face in faces:
if face["psname"] == psname:
return face
raise AssertionError("the bundle manifest has no face with the PostScript name %r" % psname)
def known_names(self) -> Set[str]:
"""Every name the bundle answers to, lower case: its families, its aliases and the PostScript names of its faces."""
names = {family.lower() for family in self.families}
names |= {alias.lower() for alias in self.aliases}
names |= {face["psname"].lower() for faces in self.faces.values() for face in faces}
return names
def bundle_manifest() -> Manifest:
"""The manifest of the core installed with the wrapper under test, the one the engine is handed as ``zoom.stealth.fonts.manifest``."""
from invisible_core._fpforge.profile import FONT_MANIFEST
manifest = Manifest(FONT_MANIFEST)
assert manifest.families, "the manifest of the core has no family: the parser read nothing"
return manifest
def _decode(platform: int, encoding: int, raw: bytes) -> Optional[str]:
try:
if platform in (0, 3):
return raw.decode("utf-16-be")
if platform == 1 and encoding == 0:
return raw.decode("mac_roman")
except UnicodeDecodeError:
return None
return None
def _name_strings(table: bytes) -> Dict[int, List[tuple]]:
"""name id -> [(is english windows name, text)] of one ``name`` table."""
out: Dict[int, List[tuple]] = {}
if len(table) < 6:
return out
_format, count, string_offset = struct.unpack(">HHH", table[:6])
for i in range(count):
record = table[6 + 12 * i: 18 + 12 * i]
if len(record) < 12:
break
platform, encoding, language, name_id, length, offset = struct.unpack(">6H", record)
text = _decode(platform, encoding, table[string_offset + offset: string_offset + offset + length])
if text:
out.setdefault(name_id, []).append((platform == 3 and language == 0x409, text))
return out
def face_names(path: Path) -> List[dict]:
"""For each face of a font file: ``family`` (every family string, any language), ``psname`` and ``full`` (the English ones, or None).
An unreadable file, or a file that is not an sfnt, has no faces: a host folder holds other things than fonts."""
faces: List[dict] = []
try:
with open(path, "rb") as handle:
head = handle.read(12)
if len(head) < 12:
return faces
if head[:4] == _COLLECTION:
count = struct.unpack(">I", head[8:12])[0]
if count > 64:
return faces
offsets = struct.unpack(">%dI" % count, handle.read(4 * count))
elif head[:4] in _SFNT:
offsets = (0,)
else:
return faces
for base in offsets:
handle.seek(base + 4)
tables = struct.unpack(">H", handle.read(2))[0]
handle.seek(base + 12)
directory = handle.read(16 * tables)
name_table = None
for i in range(tables):
tag, _checksum, offset, length = struct.unpack(">4sIII", directory[16 * i: 16 * i + 16])
if tag == b"name" and 0 < length <= 1 << 20:
handle.seek(offset)
name_table = handle.read(length)
break
if name_table is None:
continue
strings = _name_strings(name_table)
def english(name_id: int) -> Optional[str]:
for is_english, text in strings.get(name_id, []):
if is_english:
return text
return None
families = []
for name_id in (FAMILY, TYPOGRAPHIC_FAMILY):
for _english, text in strings.get(name_id, []):
if text not in families:
families.append(text)
faces.append({"file": str(path), "families": families, "psname": english(POSTSCRIPT), "full": english(FULL)})
except (OSError, struct.error):
return []
return faces
def host_font_files() -> List[Path]:
"""The font files the host has installed, in a stable order."""
if sys.platform == "win32":
roots = [Path(os.environ.get("WINDIR", r"C:\Windows")) / "Fonts"]
local = os.environ.get("LOCALAPPDATA")
if local:
roots.append(Path(local) / "Microsoft" / "Windows" / "Fonts")
else:
roots = [Path("/usr/share/fonts"), Path("/usr/local/share/fonts"), Path.home() / ".fonts",
Path.home() / ".local" / "share" / "fonts"]
files: List[Path] = []
for root in roots:
if root.is_dir():
files += [p for p in root.rglob("*") if p.suffix.lower() in _EXTENSIONS and p.is_file()]
return sorted(files, key=lambda p: str(p).lower())
def _plain(name: Optional[str]) -> bool:
"""A name that goes into a CSS string between double quotes without an escape: printable ASCII, no quote, no backslash."""
return bool(name) and all(32 <= ord(ch) < 127 and ch not in "\"\\" for ch in name)
def bundle_file_names(manifest: Manifest, binary: str) -> Set[str]:
"""Every name (families of any language, PostScript, full), lower case, that the files of the bundle carry in their own ``name`` tables.
The engine answers to the other-language family names of a bundled face as it does to its family (a localized name is an alias of the
face it names), so a host font that carries such a name is not host-only. The folder is ``<engine>/fonts``; when the build has no such
folder the set is empty and the manifest alone decides."""
folder = Path(binary).resolve().parent / "fonts"
names: Set[str] = set()
if not folder.is_dir():
return names
for name in sorted({face["file"] for faces in manifest.faces.values() for face in faces}):
for face in face_names(folder / name):
names |= {family.lower() for family in face["families"]}
names |= {value.lower() for value in (face["psname"], face["full"]) if value}
return names
def host_only_faces(manifest: Manifest, extra_known: Iterable[str] = ()) -> List[dict]:
"""The faces of the host whose names the bundle does not know: no family, no alias and no PostScript name of the bundle."""
known = manifest.known_names() | set(extra_known)
out: List[dict] = []
for path in host_font_files():
for face in face_names(path):
names = [name.lower() for name in face["families"]]
if face["psname"]:
names.append(face["psname"].lower())
if names and not any(name in known for name in names):
out.append(face)
return out
def host_only_families(manifest: Manifest, extra_known: Iterable[str] = ()) -> List[str]:
"""The family names (every language) of the host-only faces, once each, in the order of the files."""
extra_known = set(extra_known)
known = manifest.known_names() | extra_known
seen: Set[str] = set()
out: List[str] = []
for face in host_only_faces(manifest, extra_known):
for family in face["families"]:
key = family.lower()
if key not in seen and key not in known and _plain(family):
seen.add(key)
out.append(family)
return out
def a_host_only_face(manifest: Manifest, prefer: Iterable[str] = (), extra_known: Iterable[str] = ()) -> dict:
"""One host-only face with a PostScript name and a full name a page can write: the first of the ``prefer`` families the host has, else the first.
The face is what a ``src: local()`` is given: its names exist on this machine (the file is on its disk) and in no bundle."""
faces = [f for f in host_only_faces(manifest, extra_known) if _plain(f["psname"]) and _plain(f["full"])]
assert faces, "the host has no font whose names are not the bundle's: there is nothing to ask the engine for that only the host knows"
for wanted in prefer:
for face in faces:
if wanted.lower() in (family.lower() for family in face["families"]):
return face
return faces[0]
+417
View File
@@ -0,0 +1,417 @@
"""What a failing Fission frame test leaves about the frames of its pages, and nothing it could change in the test.
``tests/_evidence_on_failure.py`` keeps the Juggler wire and the engine's own trace. This adds the client's view of the pages (the events
``frameattached``, ``framenavigated`` and ``framedetached`` with the url and name of the frame, the times at which a call of the test started and
came back, and ``page.frames`` at the failure) and a reading of the wire that answers "to which execution context, of which frame and url, was that
evaluate sent, and what came back".
The rule of a probe: it can never change the outcome of the call it watches. So
* nothing here raises into the test, into the browser's event dispatch or into the server: every recording runs inside one guard;
* nothing takes ``**fields``: a record keeps what it was given under ``data``, so that a field named ``what``, ``source`` or ``event`` of the thing
being recorded cannot collide with a keyword of ours (two earlier probes broke their tests exactly that way);
* ``observed`` returns what the call returned, and raises what the call raised, the same object, whatever the recording did.
"""
from __future__ import annotations
import json
import sys
import threading
import time
from _far_away_probes import LoadSampler, StallWitness
from _far_away_probes import Records as ProbeRecords
#: The events of a page the client hears, recorded with the frame they are about.
FRAME_EVENTS = ("frameattached", "framenavigated", "framedetached")
#: The most records of the wire the summary keeps (the window of one test is a few hundred messages).
SUMMARY_LIMIT = 600
#: The most commands without an answer the summary says (a browser that is closed leaves a few; the evidence has the wire itself).
UNANSWERED_LIMIT = 20
#: The commands that carry code to a context.
_CALLS = ("Runtime.evaluate", "Runtime.callFunction")
#: The events of the engine that say which frame and which world exist, and when they come and go.
_EVENTS = ("Page.frameAttached", "Page.frameDetached", "Page.navigationStarted", "Page.navigationCommitted", "Page.navigationAborted",
"Runtime.executionContextCreated", "Runtime.executionContextDestroyed", "Runtime.executionContextsCleared")
class Records:
"""A list of dicts with its lock: the shape ``FailureEvidence.note_records`` reads (``lock``, ``records``)."""
def __init__(self, records=None):
self.lock = threading.Lock()
self.records = [] if records is None else records
def add(self, record: dict) -> None:
"""Never raises."""
try:
with self.lock:
self.records.append(record)
except Exception:
pass
def _plain(data):
"""``data`` as plain JSON values (what cannot be written is written as its ``repr``); never raises."""
try:
return json.loads(json.dumps(data, default=repr))
except Exception:
try:
return {"unwritable": repr(data)[:500]}
except Exception:
return {"unwritable": "?"}
class FrameWatch(Records):
"""The client's own log of what the test did and heard, on the clocks of the evidence (``t`` wall, ``m`` ``time.perf_counter()``)."""
def __init__(self, records=None):
super().__init__(records)
#: The reading of the wire (``summarize_wire``), saved as its own file.
self.wire = Records()
self._pages = {}
self.started_m = None
# ---- one record --------------------------------------------------------------------------------------------------
def note(self, event: str, data=None) -> None:
"""One record: ``{t, m, event, data}``. What is recorded lives under ``data``, whatever fields it has. Never raises."""
try:
self.add({"t": round(time.time(), 4), "m": round(time.perf_counter(), 6), "event": str(event), "data": _plain(data)})
except Exception:
pass
@staticmethod
def frame_data(frame) -> dict:
"""What the client knows of a frame without asking the browser: url, name, whether it is the main frame, its parent's url, its guid.
A field that cannot be read is left out. Never raises."""
found = {}
try:
for field, read in (("url", lambda f: f.url), ("name", lambda f: f.name), ("guid", lambda f: getattr(f, "_guid", None)),
("main", lambda f: f.parent_frame is None),
("parent_url", lambda f: None if f.parent_frame is None else f.parent_frame.url),
("detached", lambda f: f.is_detached())):
try:
found[field] = read(frame)
except Exception as problem:
found[field] = "unreadable: %r" % (problem,)
except Exception:
pass
return found
# ---- the pages ---------------------------------------------------------------------------------------------------
def listen(self, page, label: str) -> None:
"""Records ``frameattached``, ``framenavigated`` and ``framedetached`` of ``page`` under ``label``, and the page's own ``domcontentloaded`` and
``load``. Call it right after the page is made. Never raises; a handler never raises into the client's dispatch."""
try:
self._pages[label] = page
except Exception:
pass
for event in FRAME_EVENTS:
self._on(page, event, lambda frame, event=event: self.note(event, {"page": label, "frame": self.frame_data(frame)}))
for event in ("domcontentloaded", "load"):
self._on(page, event, lambda _page, event=event: self.note(event, {"page": label, "frames": self.frames_of(_page)}))
def _on(self, page, event: str, handler) -> None:
def guarded(*args):
try:
handler(*args)
except Exception:
pass
try:
page.on(event, guarded)
except Exception:
pass
def frames_of(self, page) -> list:
"""``page.frames`` as url, name and guid of each (local state of the client); never raises."""
try:
return [self.frame_data(f) for f in list(page.frames)]
except Exception as problem:
return [{"unreadable": repr(problem)}]
def forget_pages(self) -> None:
self._pages = {}
# ---- a call of the test ------------------------------------------------------------------------------------------
def observed(self, label: str, call, describe=None):
"""``call()``, with a record when it starts, when it returns and when it raises. It returns what ``call`` returned and raises what it raised.
``describe(stage, value)``, if given, adds to the record: stage is ``"start"``, ``"returned"`` (value: the result) or ``"raised"`` (value: the
exception); what it returns, or what it raises, only goes into the record."""
self.note(label + ": start", self._describe(describe, "start", None))
try:
result = call()
except BaseException as problem:
self.note(label + ": raised", {"type": type(problem).__name__, "message": str(problem)[:1500],
"more": self._describe(describe, "raised", problem)})
raise
self.note(label + ": returned", self._describe(describe, "returned", result))
return result
@staticmethod
def _describe(describe, stage: str, value):
if describe is None:
return None
try:
return describe(stage, value)
except Exception as problem:
return {"describe raised": repr(problem)}
# ---- the test ----------------------------------------------------------------------------------------------------
def start(self, evidence=None) -> None:
"""The test begins: one record, and a note in the wire log (the module's browser is shared by tests that came before)."""
self.started_m = time.perf_counter()
self.note("test starts")
try:
if evidence is not None:
evidence._write_wire({"t": round(time.time(), 4), "m": round(self.started_m, 6), "dir": "note", "what": "the watched test starts"})
except Exception:
pass
def at_failure(self, evidence) -> None:
"""At the failure: ``page.frames`` of every page listened to, and the reading of the wire. Never raises."""
try:
self.note("page.frames at the failure", {label: self.frames_of(page) for label, page in list(self._pages.items())})
except Exception:
pass
try:
for record in summarize_wire(evidence.wire_path, self.started_m):
self.wire.add(record)
except Exception:
pass
def unanswered_line(self, limit: int = 3) -> str:
"""The commands the wire reading found with no answer, in one line each (id, method, context and its frame's url, seconds waited, whether the
context was announced and whether it was destroyed). Empty when there is none. Never raises."""
try:
with self.wire.lock:
found = [r for r in self.wire.records if r.get("event") == "command without an answer"]
parts = []
for r in found[:limit]:
end = r.get("context_at_the_end") or {}
frame = r.get("frame_at_the_end") or {}
parts.append("%s #%s to context %s (frame %s, %s) had no answer after %ss; context %s" % (
r.get("method"), r.get("id"), r.get("executionContextId"), end.get("frame"), frame.get("url"), r.get("waited_s"),
"not announced in the window" if not end else ("destroyed at m=%s" % end.get("destroyed_m") if end.get("destroyed_m") else "alive")))
return "; ".join(parts)
except Exception:
return ""
class ProcessProbes:
"""The stall witness and the runner's CPU load of ``tests/_far_away_probes.py``, on the clock of the wire: ``m`` is ``time.perf_counter()``
(their epoch is 0, so ``from_gw`` and ``to_gw`` are ``m``). A beat that is late is a stall of the whole test process, the one that also holds
the client's reader of the Juggler pipe; a quiet process and a call that gets no answer put the stall in the browser or in the context, not
in the client. ``evidence.note_records`` keeps both lists. Nothing here raises: both recorders keep a failure as a record."""
def __init__(self, load_source=None):
self.stall_records, self.load_records = ProbeRecords(), ProbeRecords()
self.witness = StallWitness(self.stall_records, 0.0, clock=time.perf_counter)
self.sampler = LoadSampler(self.load_records, 0.0, source=load_source, clock=time.perf_counter)
def keep_in(self, evidence) -> None:
evidence.note_records("stalls-of-the-test-process", self.stall_records)
evidence.note_records("runner-load", self.load_records)
def start(self) -> None:
self.witness.start()
self.sampler.start()
def stop(self) -> None:
self.witness.stop()
self.sampler.stop()
def line(self) -> str:
"""Stalls and load in one short line (``m`` of each stall). Never raises."""
try:
stalls = sorted(self.witness.stalls(), key=lambda r: -r["gap_s"])
if stalls:
said = ", ".join("%.2fs at m=%.2f" % (r["gap_s"], r["from_gw"]) for r in stalls[:3])
stall = "%d stall(s) of the test process over %.0f ms: %s" % (len(stalls), self.witness.stall_s * 1000, said)
else:
stall = "no stall of the test process over %.0f ms (%d beats, longest gap %.3fs)" % (
self.witness.stall_s * 1000, self.witness.beats, self.witness.longest_gap_s)
cpu = [r["cpu_percent"] for r in self.sampler.samples()]
load = "runner CPU max %.0f%%, mean %.0f%% in %d samples" % (max(cpu), sum(cpu) / len(cpu), len(cpu)) if cpu else "runner CPU: no sample"
return "%s; %s" % (stall, load)
except Exception as problem:
return "stalls and load: not read (%r)" % (problem,)
class OnFailure:
"""``with OnFailure(evidence, watch):`` around the body of a test: when the body fails, the frames and the wire reading are added and the
evidence is saved (the folder the e2e jobs upload); the exception goes on, the very one the body raised."""
def __init__(self, evidence, watch: FrameWatch, probes: ProcessProbes = None):
self.evidence = evidence
self.watch = watch
self.probes = probes
def __enter__(self):
self.watch.start(self.evidence)
self._probes("start")
return self
def _probes(self, action: str) -> None:
try:
if self.probes is not None:
getattr(self.probes, action)()
except Exception:
pass
def __exit__(self, exc_type, exc, tb):
self._probes("stop")
try:
if exc_type is not None and issubclass(exc_type, Exception): # not a skip, not an interrupt
self.watch.note("failure", {"type": exc_type.__name__, "message": str(exc)[:1500]})
self.watch.at_failure(self.evidence)
self._say(exc)
try:
self.evidence._save(exc_type, exc)
except Exception as problem:
sys.stderr.write("frame evidence: could not be saved: %r\n" % (problem,))
except Exception:
pass
finally:
try:
self.watch.forget_pages()
except Exception:
pass
return False
def _say(self, exc) -> None:
"""A note on the exception the body raised (the very object, its type and message untouched): what the wire says of the commands with no
answer, and the stalls and load of the process. It is read in the failure report next to the traceback."""
try:
lines = []
unanswered = self.watch.unanswered_line()
if unanswered:
lines.append("wire: " + unanswered)
if self.probes is not None:
lines.append("process: " + self.probes.line())
if lines:
self.watch.note("said at the failure", {"lines": lines})
add_note = getattr(exc, "add_note", None)
if add_note is not None:
add_note("evidence of this failure: " + " | ".join(lines))
except Exception:
pass
# ---- the wire --------------------------------------------------------------------------------------------------------
def _short(text, limit=160):
text = "" if text is None else str(text)
return text if len(text) <= limit else text[:limit] + "..."
def summarize_wire(path, since_m=None, marker: str = "window.__r") -> list:
"""What the Juggler wire log (``FailureEvidence`` ``juggler-wire.jsonl``) says about frames, worlds and the evaluate of the test, from ``since_m``
(``perf_counter``) on: the engine's frame and context events with their ids, urls and names; each ``Runtime.evaluate`` or ``callFunction`` sent
with its context id and the beginning of its code; each answer to one of those (its error text, if it has one); and, for every command whose code
contains ``marker``, a ``marker command`` record that joins the context id it was sent to with what the wire knows of that context (its frame id
and name, when it was announced and when it was destroyed) and of that frame (the url it last committed, its parent). Whatever the code, every
command that has no answer by the end of the log gets a ``command without an answer`` record with the same join, taken when it was sent and at
the end of the log, and the time it has waited: the evaluate that a client gave up on (``no response in 30s``) is there whether or not its code
has the marker. An answer says how long after its command it came (``after_s``). A line of the log that is not JSON, or was cut at the log's
limit, is counted, not read. Never raises: a failure is a record."""
try:
return _summarize_wire(path, since_m, marker)
except Exception as problem:
return [{"event": "the wire could not be read", "error": repr(problem)}]
def _join(contexts, frames, context_id):
"""What the wire knows now of a context, of its frame and of the frame's parent (copies: the entries change later); ``None`` for what it does
not know (a context announced before the window, or never)."""
context = dict(contexts.get(context_id) or {}) or None
frame = dict(frames.get((context or {}).get("frame")) or {}) or None
parent = dict(frames.get((frame or {}).get("parent")) or {}) or None
return context, frame, parent
def _after(start_m, end_m):
try:
return round(end_m - start_m, 4)
except Exception:
return None
def _summarize_wire(path, since_m, marker) -> list:
out = []
contexts = {} # context id -> {"frame", "name", "created_m", "destroyed_m"}
frames = {} # frame id -> {"url", "name", "parent", "attached_m", "detached_m", "committed_m"}
sent = {} # command id -> the record of the command
waiting = {} # command id -> what the wire knew of its context and frame when it was sent, until it is answered
last_m = None
unparsed = 0
with open(path, "r", encoding="utf-8", errors="replace") as handle:
for line in handle:
try:
row = json.loads(line)
except Exception:
unparsed += 1
continue
m = row.get("m")
if row.get("dir") == "note" or m is None or (since_m is not None and m < since_m):
continue
try:
message = json.loads(row.get("msg") or "")
except Exception:
unparsed += 1
out.append({"event": "unread message", "m": m, "t": row.get("t"), "dir": row.get("dir"), "len": row.get("len"),
"cut": row.get("cut"), "start": _short(row.get("msg"), 200)})
continue
if not isinstance(message, dict):
continue
last_m = m if last_m is None else max(last_m, m)
base = {"t": row.get("t"), "m": m, "dir": row.get("dir")}
method, params = message.get("method"), message.get("params") or {}
if row.get("dir") == "out" and method in _CALLS:
code = params.get("expression") or params.get("functionDeclaration") or ""
record = dict(base, event="command", method=method, id=message.get("id"), sessionId=message.get("sessionId"),
executionContextId=params.get("executionContextId"), code=_short(code))
sent[message.get("id")] = record
out.append(record)
context, frame, parent = _join(contexts, frames, params.get("executionContextId"))
waiting[message.get("id")] = {"record": record, "context": context, "frame": frame, "parent": parent}
if marker and marker in str(code):
out.append(dict(base, event="marker command", id=message.get("id"), executionContextId=params.get("executionContextId"),
context=context, frame=frame, parent=parent))
elif row.get("dir") == "in" and message.get("id") in sent:
answer = message.get("error")
result = message.get("result")
command = sent[message.get("id")]
waiting.pop(message.get("id"), None)
out.append(dict(base, event="answer", id=message.get("id"), to=command.get("code"), after_s=_after(command.get("m"), m),
error=_short(answer, 400) if answer is not None else None,
result=_short(json.dumps(result, default=str), 300) if answer is None else None))
elif row.get("dir") == "in" and method in _EVENTS:
out.append(dict(base, event=method, sessionId=message.get("sessionId"), params=_plain(params)))
if method == "Runtime.executionContextCreated":
aux = params.get("auxData") or {}
contexts[params.get("executionContextId")] = {"frame": aux.get("frameId"), "name": aux.get("name"), "created_m": m,
"destroyed_m": None}
elif method == "Runtime.executionContextDestroyed":
if params.get("executionContextId") in contexts:
contexts[params.get("executionContextId")]["destroyed_m"] = m
elif method == "Page.frameAttached":
frames.setdefault(params.get("frameId"), {})
frames[params.get("frameId")].update(parent=params.get("parentFrameId"), attached_m=m)
elif method == "Page.frameDetached":
frames.setdefault(params.get("frameId"), {})["detached_m"] = m
elif method == "Page.navigationCommitted":
frames.setdefault(params.get("frameId"), {}).update(url=params.get("url"), name=params.get("name"), committed_m=m)
if len(out) >= SUMMARY_LIMIT:
out.append({"event": "summary cut", "limit": SUMMARY_LIMIT})
break
for command_id, known in list(waiting.items())[:UNANSWERED_LIMIT]:
record = known["record"]
context_now, frame_now, parent_now = _join(contexts, frames, record.get("executionContextId"))
out.append({"event": "command without an answer", "id": command_id, "method": record.get("method"), "sessionId": record.get("sessionId"),
"executionContextId": record.get("executionContextId"), "code": record.get("code"), "sent_m": record.get("m"),
"waited_s": _after(record.get("m"), last_m), "context_known_when_sent": known["context"] is not None,
"context_when_sent": known["context"], "frame_when_sent": known["frame"], "parent_when_sent": known["parent"],
"context_at_the_end": context_now, "frame_at_the_end": frame_now, "parent_at_the_end": parent_now})
out.append({"event": "summary end", "unparsed_lines": unparsed, "last_m": last_m, "commands_without_an_answer": len(waiting), "since_m": since_m,
"contexts_known": len(contexts), "frames_known": len(frames)})
return out
+165
View File
@@ -0,0 +1,165 @@
"""TEMPORARY: what a generation of the security state that fails leaves for a reader, whoever started the engine. Remove it once the exit by SIGSEGV
(-11) of the engine in generate mode on the Linux e2e job (run 45014369018) is understood and fixed.
Two launches of the engine in generate mode run in tests/test_security_state_engine_e2e.py: the test's own (`-profile <p>` with the four prefs) and the
CORE's (`invisible_core._security_state_generate.generate`, which `_ready` calls once per module and whose outcome the three tests that need a ready
directory share). The core sends the engine's stdout and stderr to the null device, deletes its work profile before it raises `GenerationError`, and
starts the engine with the core size limit of the test process: a crash of its launch left nothing at all.
* `save_what_the_failed_generation_left` saves, in `$RUNNER_TEMP/invpw-evidence/<name>/` (the folder the e2e jobs upload), the engine's stdout and stderr and
the files of the profile with their sizes (the result, `user.js` and `security_state/` copied);
* `the_core_s_generation_keeps_its_evidence(work, name)` wraps the core's own launch while it is in force: its Popen writes stdout and stderr to files of
`work`, the files of the work profile are noted when the engine exits (before the core deletes them), and when `generate` raises, everything is saved
under `name` and the error is raised unchanged. The core's launch line, environment and outcome are not touched.
The CORE file of a crash is not read here: tests/_crash_cores.py lifts the core limit of the whole pytest session (every engine inherits it, the core's
launches included) and, after the test fails, saves gdb's text of every core in `$INVPW_CORE_DIR` under `invpw-evidence/cores/<test>/`.
Saving is best effort: it never raises and never decides a test (the assertion of the test, or the core's error, does).
"""
from __future__ import annotations
import contextlib
import importlib
import os
import shutil
import subprocess
import sys
import time
from pathlib import Path
import _crash_cores
#: The folder under `$RUNNER_TEMP` the e2e workflows upload (`invpw-evidence-*`).
EVIDENCE_FOLDER = "invpw-evidence"
RESULT_NAME = "securitystate-result.json"
STATE_DIR = "security_state"
def evidence_folder(name, fallback):
"""`$RUNNER_TEMP/invpw-evidence/<name>` on a runner, `<fallback>/<name>` elsewhere; made here."""
base = os.environ.get("RUNNER_TEMP")
folder = (Path(base) / EVIDENCE_FOLDER if base else Path(fallback)) / name
folder.mkdir(parents=True, exist_ok=True)
return folder
def _profile_of(argv):
argv = [str(part) for part in argv]
return Path(argv[argv.index("-profile") + 1]) if "-profile" in argv[:-1] else None
def snapshot_the_profile(profile, into):
"""The files of `profile` (path, size) in `into/profile-files.tsv`, with the result, `user.js` and `security_state/` copied: what the engine left, kept before
anybody deletes the profile. One line saying what was done."""
into.mkdir(parents=True, exist_ok=True)
if profile is None or not Path(profile).is_dir():
return "no profile directory (%s)" % (profile,)
profile = Path(profile)
listing = ["%s\t%d" % (path.relative_to(profile).as_posix(), path.stat().st_size) for path in sorted(profile.rglob("*")) if path.is_file()]
(into / "profile-files.tsv").write_text("\n".join(listing) + "\n", encoding="utf-8")
for name in (RESULT_NAME, "user.js"):
if (profile / name).is_file():
shutil.copyfile(str(profile / name), str(into / name))
if (profile / STATE_DIR).is_dir():
shutil.copytree(str(profile / STATE_DIR), str(into / STATE_DIR), dirs_exist_ok=True)
return "profile files: %d" % len(listing)
def save_what_the_failed_generation_left(profile, output, code, why, folder, *, snapshot=None):
"""ONLY after a generation that failed: `<output>.stdout` and `<output>.stderr` copied as `engine.stdout`/`engine.stderr` and the profile's files (from
`profile`, or from a `snapshot` folder made by `snapshot_the_profile` when the profile is gone); `notes.txt` says what was found, and where the core of a
crash goes. Never raises."""
notes = ["exit code %r; %s" % (code, why or "the engine exited")]
try:
for suffix in (".stdout", ".stderr"):
source = Path(str(output) + suffix)
if source.is_file():
shutil.copyfile(str(source), str(folder / ("engine" + suffix)))
notes.append("%s: %d bytes" % (source.name, source.stat().st_size))
else:
notes.append("%s: not written" % source.name)
if snapshot is not None and Path(snapshot).is_dir():
shutil.copytree(str(snapshot), str(folder), dirs_exist_ok=True)
notes.append("profile: as the engine left it at its exit (the core deleted it afterwards)")
else:
notes.append(snapshot_the_profile(profile, folder))
notes.append(where_the_core_goes())
except Exception as exc: # the evidence is best effort: the test reports the failure
notes.append("saving the evidence failed: %r" % (exc,))
with open(str(folder / "notes.txt"), "a", encoding="utf-8") as sink:
sink.write("\n".join(notes) + "\n")
def where_the_core_goes():
"""One line for `notes.txt`: where the core of a crash is read (Linux), or that there is none to read (elsewhere)."""
if not sys.platform.startswith("linux"):
return "core files: Linux only (tests/_crash_cores.py); none is looked for on %s" % sys.platform
return "core file: read by tests/_crash_cores.py after the test fails, into invpw-evidence/cores/<test>/ (INVPW_CORE_DIR %r, kernel.core_pattern %r, gdb %s)" % (
os.environ.get("INVPW_CORE_DIR"), _crash_cores.core_pattern(), _crash_cores.gdb())
class _Subprocess:
"""The `subprocess` the core's module sees while the wrapper is in force: the real module, with `Popen` replaced."""
def __init__(self, popen):
self.Popen = popen
def __getattr__(self, name):
return getattr(subprocess, name)
@contextlib.contextmanager
def the_core_s_generation_keeps_its_evidence(work, name):
"""While in force, every engine the core's `generate` starts writes its stdout and stderr to files of `work` and has the files of its profile noted when it
exits; if the block raises (the core's `GenerationError`), each launch is saved in the evidence folder `name` and the
exception goes on unchanged. Yields the list of the launches (dicts: argv, output, started_at, code, snapshot)."""
module = importlib.import_module("invisible_core._security_state_generate")
work = Path(work)
work.mkdir(parents=True, exist_ok=True)
launches = []
real_popen = subprocess.Popen
real_module, real_wait = module.subprocess, module._wait_for_exit
def popen(argv, *args, **kwargs):
output = work / ("engine-%d" % len(launches))
launch = {"argv": [str(part) for part in argv], "output": output, "started_at": time.time(), "code": "not exited", "snapshot": None}
launches.append(launch)
sinks = [open(str(output) + ".stdout", "wb"), open(str(output) + ".stderr", "wb")]
kwargs["stdout"], kwargs["stderr"] = sinks
try:
proc = real_popen(argv, *args, **kwargs)
finally:
for sink in sinks:
sink.close()
launch["proc"] = proc
return proc
def wait_for_exit(proc, timeout_s):
code = real_wait(proc, timeout_s)
for launch in launches:
if launch.get("proc") is proc:
launch["code"] = code
launch["snapshot"] = work / ("engine-%d-profile" % launches.index(launch))
try:
snapshot_the_profile(_profile_of(launch["argv"]), launch["snapshot"])
except Exception: # best effort, as every save here
launch["snapshot"] = None
return code
module.subprocess, module._wait_for_exit = _Subprocess(popen), wait_for_exit
try:
yield launches
except BaseException as exc:
folder = evidence_folder(name, work)
with open(str(folder / "notes.txt"), "a", encoding="utf-8") as sink:
sink.write("the core's generate raised %s: %s\nlaunches of the engine: %d\n" % (type(exc).__name__, exc, len(launches)))
for index, launch in enumerate(launches):
target = folder if len(launches) == 1 else folder / ("launch-%d" % index)
target.mkdir(parents=True, exist_ok=True)
with open(str(target / "notes.txt"), "a", encoding="utf-8") as sink:
sink.write("argv: %r\n" % (launch["argv"],))
save_what_the_failed_generation_left(_profile_of(launch["argv"]), launch["output"], launch["code"], str(exc), target, snapshot=launch["snapshot"])
raise
finally:
module.subprocess, module._wait_for_exit = real_module, real_wait
+152 -15
View File
@@ -7,6 +7,13 @@ later one read `h3` (retail Firefox 159, native DNS in loopback: h2, h3, h3; beh
came from: a connection that comes from anywhere but the relay of a gateway on this host (127.0.0.1) did not go through
the proxy.
A client that has a QUIC handshake in progress toward the server is served its next TCP connection only once that handshake has ended (``_QuicFirst``): a real network completes
QUIC in 1 round trip and TCP+TLS in 2, and a browser takes the first connection that is ready.
It also keeps its own record of what it saw (``H3Server.record``, ``write_record``): per TCP connection its accept, the ALPN, every request
path and its end, per QUIC connection its first datagram, its handshake, every request and its end (with the reason), each with ``m``
(``time.perf_counter()`` of the test process) and ``t`` (``time.time()``). It only listens: no answer depends on it.
Needs `aioquic` and `h2` (pip install aioquic h2; the dev extra installs both).
"""
from __future__ import annotations
@@ -14,14 +21,17 @@ from __future__ import annotations
import asyncio
import datetime
import ipaddress
import itertools
import json
import socket
import socketserver
import ssl
import sys
import tempfile
import threading
import time
from pathlib import Path
from typing import List, Tuple
from typing import Dict, List, Tuple
from _ports import bind_tcp_and_hold_udp
@@ -50,6 +60,50 @@ def _certificate(address: str, directory: Path):
#: The one document every path answers, over TCP and over QUIC.
PAGE = b"<!doctype html><meta charset=utf-8><title>h3</title><p>ok</p>"
class _QuicFirst:
"""Keeps the order of a real network between the two connections a browser opens to one server: QUIC is ready after 1 round trip and TCP+TLS after 2, so the QUIC one is
taken. The Python QUIC server of the lab needs longer than TCP+TLS under load and would invert that. For a peer address that has a QUIC handshake in progress toward the
server, the TLS of a new TCP connection from that address waits until the handshake has ended. It waits for an event, never for a time: ``ended`` is called when the
handshake completes (the client has had its connection ready for a round trip by then), fails, or the connection terminates (the idle timeout is one of them), and
``release_all`` when the server closes. With no handshake in progress for the address nothing is held.
The residual case: a client that starts a QUIC handshake and vanishes without a CONNECTION_CLOSE leaves its handshake in progress, so the TCP connections of the same
IP are held until the QUIC idle timeout ends the connection (aioquic: 60 s by default, ``H3Server(quic_idle_timeout=...)``). A real network does not hold the TCP of a
client for that long, but a client of the lab that opens QUIC and goes away is not one a test of the lab depends on; it is measured, with the order asserted and not a
duration, in tests/test_the_h3_lab_server_lets_quic_finish_first.py."""
def __init__(self):
self._changed = threading.Condition()
self._in_progress: Dict[str, int] = {}
self._closed = False
def began(self, peer: str) -> None:
with self._changed:
self._in_progress[peer] = self._in_progress.get(peer, 0) + 1
def ended(self, peer: str) -> None:
with self._changed:
left = self._in_progress.get(peer, 0) - 1
if left > 0:
self._in_progress[peer] = left
else:
self._in_progress.pop(peer, None)
self._changed.notify_all()
def hold(self, peer: str, held: List[str]) -> None:
"""Returns at once when no QUIC handshake of ``peer`` is in progress; otherwise records the hold in ``held`` and returns when none is."""
with self._changed:
if peer not in self._in_progress or self._closed:
return
held.append(peer)
self._changed.wait_for(lambda: self._closed or peer not in self._in_progress)
def release_all(self) -> None:
with self._changed:
self._closed = True
self._changed.notify_all()
class _TcpServer(socketserver.ThreadingTCPServer):
# On Windows SO_REUSEADDR is "share the port": with a number the picker drew (tests/_ports.py) it would bind over a listener that is there.
allow_reuse_address = sys.platform != "win32"
@@ -71,29 +125,36 @@ class _TcpHandler(socketserver.BaseRequestHandler):
def handle(self):
owner = self.server.owner
cid = "tcp-%d" % next(owner._ids)
owner.note("tcp_accept", conn=cid, peer=list(self.client_address[:2]))
reason = "handler ended"
try:
owner._quic_first.hold(self.client_address[0], owner.tcp_held)
self.request.settimeout(10)
tls = owner._tls.wrap_socket(self.request, server_side=True)
except (ssl.SSLError, OSError):
except (ssl.SSLError, OSError) as exc:
owner.note("tcp_handshake_failed", conn=cid, error=repr(exc))
return
try:
tls.settimeout(60)
alpn = tls.selected_alpn_protocol() or "http/1.1"
owner.tcp_alpn.append(alpn)
owner.note("tcp_handshake_done", conn=cid, alpn=alpn)
if alpn == "h2":
self._h2(tls, owner)
reason = self._h2(tls, owner, cid)
else:
self._http1(tls, owner)
except (ssl.SSLError, OSError):
pass
reason = self._http1(tls, owner, cid)
except (ssl.SSLError, OSError) as exc:
reason = "error: %r" % (exc,)
finally:
owner.note("tcp_close", conn=cid, reason=reason)
try:
tls.close()
except OSError:
pass
@staticmethod
def _h2(tls, owner):
def _h2(tls, owner, cid):
import h2.config
import h2.connection
import h2.events
@@ -105,15 +166,16 @@ class _TcpHandler(socketserver.BaseRequestHandler):
while True:
data = tls.recv(65536)
if not data:
return
return "the client closed the connection (EOF)"
try:
events = conn.receive_data(data)
except h2.exceptions.ProtocolError:
except h2.exceptions.ProtocolError as exc:
tls.sendall(conn.data_to_send())
return
return "h2 protocol error: %r" % (exc,)
for event in events:
if isinstance(event, h2.events.RequestReceived):
owner.tcp_requests.append(dict(event.headers).get(":path", ""))
owner.note("tcp_request", conn=cid, stream=event.stream_id, path=dict(event.headers).get(":path", ""))
conn.send_headers(event.stream_id, [
(":status", "200"), ("content-type", "text/html; charset=utf-8"),
("content-length", str(len(PAGE))), ("alt-svc", owner.alt_svc),
@@ -122,13 +184,13 @@ class _TcpHandler(socketserver.BaseRequestHandler):
elif isinstance(event, h2.events.DataReceived):
conn.acknowledge_received_data(event.flow_controlled_length, event.stream_id)
elif isinstance(event, h2.events.ConnectionTerminated):
return
return "h2 GOAWAY from the client (error code %s)" % (event.error_code,)
out = conn.data_to_send()
if out:
tls.sendall(out)
@staticmethod
def _http1(tls, owner):
def _http1(tls, owner, cid):
head = b""
while b"\r\n\r\n" not in head:
chunk = tls.recv(4096)
@@ -140,18 +202,20 @@ class _TcpHandler(socketserver.BaseRequestHandler):
tls.sendall(b"HTTP/1.1 200 OK\r\nContent-Type: text/html; charset=utf-8\r\nContent-Length: %d\r\n"
b"Alt-Svc: %s\r\nAccess-Control-Allow-Origin: *\r\nConnection: close\r\n\r\n%s"
% (len(PAGE), owner.alt_svc.encode(), PAGE))
return "answered, Connection: close"
class H3Server:
"""TCP+TLS (HTTP/2) and QUIC (HTTP/3) on one port of `address`."""
def __init__(self, address: str):
def __init__(self, address: str, quic_idle_timeout: float = None):
"""``quic_idle_timeout`` (seconds) is the QUIC idle timeout of the server; None keeps aioquic's default (60 s)."""
from aioquic.asyncio.protocol import QuicConnectionProtocol
from aioquic.asyncio.server import QuicServer
from aioquic.h3.connection import H3_ALPN, H3Connection
from aioquic.h3.events import HeadersReceived
from aioquic.quic.configuration import QuicConfiguration
from aioquic.quic.events import ProtocolNegotiated
from aioquic.quic.events import ConnectionTerminated, HandshakeCompleted, ProtocolNegotiated
self.address = address
#: The address each QUIC connection came from.
@@ -159,11 +223,22 @@ class H3Server:
#: The same peers with the port they sent from: (address, port). On a machine where a gateway's relay sends from an address of
#: this host (Windows cannot send from 127.0.0.1 to it) the address cannot tell the relay from a client that came direct; its port can.
self.quic_peer_addrs: List[Tuple[str, int]] = []
#: EVERY datagram that reached the UDP port, whether or not a QUIC handshake came out of it: (address, port) of the sender. A browser
#: that TRIES h3 sends its Initial here before anything else, so this list is the attempt itself, the one signal of "the engine tried
#: HTTP/3" that does not depend on the attempt succeeding or on how long it takes; ``quic_peers`` only has the connections that
#: negotiated an ALPN (an attempt that never completes is not in it).
self.udp_datagrams: List[Tuple[str, int]] = []
#: The paths of the requests that were answered over HTTP/3, and over TCP.
self.h3_requests: List[str] = []
self.tcp_requests: List[str] = []
#: The ALPN each TCP connection negotiated ("h2", or "http/1.1").
self.tcp_alpn: List[str] = []
#: The peer address of each TCP connection whose TLS was held until a QUIC handshake of that address had ended (see ``_QuicFirst``).
self.tcp_held: List[str] = []
self._quic_first = _QuicFirst()
#: The server's own record of what it saw, in order (``note``): a list of dicts, each with ``m``, ``t`` and ``kind``.
self.record: List[dict] = []
self._ids = itertools.count(1)
self._dir = tempfile.TemporaryDirectory()
cert, key = _certificate(address, Path(self._dir.name))
@@ -186,8 +261,47 @@ class H3Server:
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self._http = None
#: The address whose handshake this connection holds open in ``_quic_first``; None before its first datagram and once the handshake has ended.
self._handshaking = None
self._began = False
self._cid = "quic-%d" % next(server._ids)
self._datagrams = 0
self._last_datagram_m = None
def datagram_received(self, data, addr):
self._datagrams += 1
self._last_datagram_m = round(time.perf_counter(), 6)
if self._datagrams == 1:
server.note("quic_first_datagram", conn=self._cid, peer=list(addr[:2]), bytes=len(data))
# The first datagram of a peer is the start of its handshake: it is registered before the server answers it.
if not self._began:
self._began = True
self._handshaking = addr[0]
server._quic_first.began(addr[0])
super().datagram_received(data, addr)
# A close (the peer's, or ours after a failed handshake) ends the handshake before the event of the end of the connection.
if self._quic._close_event is not None:
self._handshake_ended()
def _handshake_ended(self):
if self._handshaking is not None:
peer, self._handshaking = self._handshaking, None
server._quic_first.ended(peer)
def quic_event_received(self, event):
if isinstance(event, (HandshakeCompleted, ConnectionTerminated)):
self._handshake_ended()
kind = type(event).__name__
if isinstance(event, ProtocolNegotiated):
server.note("quic_protocol_negotiated", conn=self._cid, alpn=event.alpn_protocol, datagrams=self._datagrams)
elif kind == "HandshakeCompleted":
server.note("quic_handshake_done", conn=self._cid, alpn=getattr(event, "alpn_protocol", None),
datagrams=self._datagrams)
elif kind == "ConnectionTerminated":
server.note("quic_close", conn=self._cid, error_code=event.error_code, frame_type=event.frame_type,
reason=event.reason_phrase, datagrams=self._datagrams, last_datagram_m=self._last_datagram_m)
elif kind == "StreamReset":
server.note("quic_stream_reset", conn=self._cid, stream=event.stream_id, error_code=event.error_code)
if isinstance(event, ProtocolNegotiated):
self._http = H3Connection(self._quic)
peer = self._quic._network_paths[0].addr
@@ -198,13 +312,21 @@ class H3Server:
if isinstance(http_event, HeadersReceived):
headers = dict(http_event.headers)
server.h3_requests.append(headers.get(b":path", b"").decode())
server.note("quic_request", conn=self._cid, stream=http_event.stream_id, path=server.h3_requests[-1])
self._http.send_headers(http_event.stream_id, [
(b":status", b"200"), (b"content-type", b"text/html; charset=utf-8"),
(b"access-control-allow-origin", b"*")])
self._http.send_data(http_event.stream_id, PAGE, end_stream=True)
self.transmit()
class Recording(QuicServer):
def datagram_received(self, data, addr):
server.udp_datagrams.append((addr[0], addr[1]))
super().datagram_received(data, addr)
configuration = QuicConfiguration(is_client=False, alpn_protocols=H3_ALPN)
if quic_idle_timeout is not None:
configuration.idle_timeout = quic_idle_timeout
configuration.load_cert_chain(str(cert), str(key))
self._loop = asyncio.new_event_loop()
started = threading.Event()
@@ -213,7 +335,7 @@ class H3Server:
asyncio.set_event_loop(self._loop)
# What ``aioquic.asyncio.serve(address, port)`` does (1.x), with the socket that already holds the number.
_transport, self._quic = self._loop.run_until_complete(self._loop.create_datagram_endpoint(
lambda: QuicServer(configuration=configuration, create_protocol=Protocol), sock=self._udp))
lambda: Recording(configuration=configuration, create_protocol=Protocol), sock=self._udp))
started.set()
try:
self._loop.run_forever()
@@ -236,7 +358,22 @@ class H3Server:
def url(self) -> str:
return "https://%s:%d/" % (self.address, self.port)
def note(self, kind: str, **fields) -> None:
"""One line of the server's record: ``m`` is ``time.perf_counter()`` of this process, ``t`` the wall clock. Never raises."""
try:
self.record.append({"m": round(time.perf_counter(), 6), "t": round(time.time(), 4), "kind": kind, **fields})
except Exception:
pass
def write_record(self, path) -> None:
"""The record as JSON lines (what the failure evidence of a test keeps)."""
with open(path, "w", encoding="utf-8") as out:
for line in list(self.record):
out.write(json.dumps(line, default=str) + "\n")
def close(self) -> None:
self._quic_first.release_all()
self.note("server_close", quic_connections=len(self.quic_peers), tcp_connections=len(self.tcp_alpn))
self._tcp.shutdown()
self._tcp.server_close()
if not self._loop.is_closed():
+213
View File
@@ -0,0 +1,213 @@
"""The pieces the e2e tests of the language and the zone a context declares share.
* ``serve(routes)``: a local HTTP server on a port the OS gives, answering a table of paths (the query is ignored), each with its bytes, its type
and, if the test needs them, extra headers. Nothing leaves the machine.
* ``open_chrome(port)`` / ``chrome(...)`` / ``set_pref(...)``: the engine's own chrome scope through Marionette, for what no protocol command of
the wrapper does: writing ``intl.accept_languages`` while a session runs, and ``content_process_prefs(...)``: what a pref holds in the
content process of each tab asked for (the proof that a process has taken a change, read from the process itself).
* ``read_in_page_realm(page, body)``: runs ``body`` as an inline ``<script>`` of the page, so in the page's own realm, and returns what it
wrote into the DOM. ``page.evaluate`` is not the page's realm on this engine; an inline script is what a site runs.
* the measuring scripts of the canvas tests (``MEASURE_JS``): the width of a few strings as a canvas of one language group draws them.
No clock, no port written as a number, no environment written here.
"""
from __future__ import annotations
import http.server
import json
import threading
from typing import Any, Dict, Tuple, Union
import webfont_probe
#: What the launch of a browser whose chrome scope is read through Marionette is given (the env var MOZ_REMOTE_ALLOW_SYSTEM_ACCESS
#: is set by the test with ``monkeypatch``).
MARIONETTE_ARGS = ["-marionette", "-remote-allow-system-access"]
Route = Union[bytes, Tuple[bytes, str], Tuple[bytes, str, Dict[str, str]]]
def serve(routes: Dict[str, Route]):
"""A server for ``routes``; returns ``(server, base_url)``. Stop it with :func:`stop`."""
class Handler(http.server.BaseHTTPRequestHandler):
def do_GET(self):
path = self.path.split("?", 1)[0]
route = routes.get(path)
if route is None:
self.send_response(404)
self.send_header("Content-Length", "0")
self.end_headers()
return
if isinstance(route, bytes):
route = (route, "text/html; charset=utf-8")
body, kind = route[0], route[1]
extra = route[2] if len(route) > 2 else {}
self.send_response(200)
self.send_header("Content-Type", kind)
self.send_header("Content-Length", str(len(body)))
self.send_header("Cache-Control", "no-store")
for name, value in extra.items():
self.send_header(name, value)
self.end_headers()
self.wfile.write(body)
def log_message(self, *args):
pass
server = http.server.ThreadingHTTPServer(("127.0.0.1", 0), Handler)
server.daemon_threads = True
threading.Thread(target=server.serve_forever, daemon=True).start()
return server, "http://127.0.0.1:%d" % server.server_address[1]
def stop(server) -> None:
server.shutdown()
server.server_close()
PAGE = b"<!doctype html><html><head><meta charset=utf-8><title>t</title></head><body><p id=p>t</p></body></html>"
# ----------------------------------------------------------------------------------------------------------------- the chrome scope
def open_chrome(port: int):
"""A Marionette session in chrome scope on the engine that listens on ``port``."""
marionette = webfont_probe._Marionette(port)
marionette.call("WebDriver:NewSession", {"capabilities": {"alwaysMatch": {}}})
marionette.call("WebDriver:SetTimeouts", {"script": 240000})
marionette.call("Marionette:SetContext", {"value": "chrome"})
return marionette
def chrome(marionette, script: str, *args: Any) -> Any:
"""Run ``script`` (the body of a function that returns ``JSON.stringify(...)``) in chrome scope; its answer, decoded."""
return json.loads(marionette.call("WebDriver:ExecuteScript", {"script": script, "args": list(args)})["value"])
SET_STRING_PREF_JS = """
const [name, value] = arguments;
Services.prefs.setStringPref(name, value);
return JSON.stringify(Services.prefs.getStringPref(name));
"""
def set_pref(marionette, name: str, value: str) -> str:
return chrome(marionette, SET_STRING_PREF_JS, name, value)
#: What the content process of each tab holds for a pref, read in that process. ``arguments``: the pref's name and the labels of the tabs; a tab is
#: found by its address ending in ``?<label>``. A process script (``Services.ppmm.loadProcessScript``, a data: URL, only the processes that exist)
#: runs in every process and sends back its pid and the value ``Services.prefs`` of THAT process gives; the answer comes when each tab's process
#: has answered. The parent sends a pref change to a content process before this message on the same channel, and the process applies it
#: (and runs its observers) before it runs the script, so a process that answers has handled the change.
PROCESS_PREFS_JS = """
const [name, labels] = arguments;
const done = arguments[arguments.length - 1];
const wanted = {};
for (const win of Services.wm.getEnumerator('navigator:browser')) {
for (const tab of win.gBrowser.tabs) {
const spec = tab.linkedBrowser.currentURI.spec;
const wg = tab.linkedBrowser.browsingContext && tab.linkedBrowser.browsingContext.currentWindowGlobal;
for (const label of labels) {
if (spec.endsWith('?' + label) && wg && wg.domProcess) { wanted[label] = wg.domProcess.osPid; }
}
}
}
const missing = labels.filter((label) => !(label in wanted));
if (missing.length) { done(JSON.stringify({missing})); return; }
const KEY = 'invisible-probe:pref';
const answers = {};
const listener = {
receiveMessage(message) {
answers[message.data.pid] = message.data.value;
if (Object.values(wanted).every((pid) => pid in answers)) {
Services.ppmm.removeMessageListener(KEY, listener);
const prefs = {};
for (const [label, pid] of Object.entries(wanted)) { prefs[label] = answers[pid]; }
done(JSON.stringify({pids: wanted, prefs}));
}
},
};
Services.ppmm.addMessageListener(KEY, listener);
const body = 'sendAsyncMessage(' + JSON.stringify(KEY) + ', {pid: Services.appinfo.processID, value: Services.prefs.getStringPref(' + JSON.stringify(name) + ', "")});';
Services.ppmm.loadProcessScript('data:,' + encodeURIComponent(body), false);
"""
def content_process_prefs(marionette, name: str, labels) -> Dict[str, Any]:
"""``{"pids": {label: pid}, "prefs": {label: value}}``: what pref ``name`` holds in the content process of each tab whose address ends with
``?<label>`` (or ``{"missing": [labels]}`` when a tab is not there)."""
answer = marionette.call("WebDriver:ExecuteAsyncScript", {"script": PROCESS_PREFS_JS, "args": [name, list(labels)]})
return json.loads(answer["value"])
# -------------------------------------------------------------------------------------------------------------------- the page realm
def read_in_page_realm(page, body: str, name: str = "read") -> Any:
"""What ``body`` (the body of a function that returns a JSON-able value) gives when an inline script of the page runs it."""
page.add_script_tag(content=("document.documentElement.setAttribute('data-%s', JSON.stringify((() => {%s})()));" % (name, body)))
return json.loads(page.evaluate("n => document.documentElement.getAttribute('data-' + n)", name))
# ------------------------------------------------------------------------------------------------------------------------ the workers
#: A dedicated worker that answers every message with the language its realm and its navigator speak.
LANG_WORKER = b"""
onmessage = () => postMessage({languages: [...navigator.languages],
intl: Intl.DateTimeFormat().resolvedOptions().locale});
"""
#: Starts that worker in the page and leaves ``window.__ask()`` to ask it again; the worker lives as long as the page.
START_LANG_WORKER_JS = """() => {
window.__worker = new Worker('/lang-worker.js');
window.__ask = () => new Promise((ok) => {
window.__worker.onmessage = (e) => ok(e.data);
window.__worker.postMessage(0);
});
}"""
ASK_LANG_WORKER_JS = "() => window.__ask()"
# ----------------------------------------------------------------------------------------------------------------------- the canvases
#: The width of a few strings, in two generic families, as a canvas of ONE language group draws them: Latin text (the generic serif of each
#: group is another font), full-width Han, kana, half-width kana. ``widths(canvas)`` takes the 2D context's canvas, a main-thread or a
#: worker's OffscreenCanvas, or an element: the font is resolved the way each of them resolves it, which is what the tests compare.
MEASURE_JS = """
const STRINGS = ['Hamburgefonstiv', '\\u6f22\\u5b57', '\\u3042\\u3044\\u3046', '\\uff71\\uff72\\uff73', '\\u76f4\\u9aa8'];
function widths(context) {
const out = {};
for (const font of ['20px serif', '20px sans-serif']) {
context.font = font;
out[font] = STRINGS.map((s) => context.measureText(s).width);
}
return out;
}
"""
#: A dedicated worker that measures on its own OffscreenCanvas and answers with the widths.
MEASURE_WORKER = (MEASURE_JS + """
onmessage = () => postMessage(widths(new OffscreenCanvas(300, 60).getContext('2d')));
""").encode()
#: In the page: the worker's widths, the widths of an OffscreenCanvas of the main thread (no element, no ``lang``), and the widths of a canvas
#: ELEMENT whose ``lang`` is each of the two languages asked for.
MEASURE_PAGE_JS = """async (languages) => {
%s
const worker = await new Promise((ok) => {
const w = new Worker('/measure-worker.js');
w.onmessage = (e) => { ok(e.data); w.terminate(); };
w.postMessage(0);
});
const offscreen = widths(new OffscreenCanvas(300, 60).getContext('2d'));
const element = {};
for (const lang of languages) {
const c = document.createElement('canvas');
c.setAttribute('lang', lang);
document.body.appendChild(c);
element[lang] = widths(c.getContext('2d'));
}
return {worker, offscreen, element};
}""" % MEASURE_JS
+165
View File
@@ -0,0 +1,165 @@
"""A passive listener on the mDNS group (224.0.0.251, UDP 5353): what the lab heard of the engine's responder, packet by packet.
Failure evidence of ``tests/test_declared_host_network_e2e.py``. The engine's responder (dom/media/webrtc/transport/mdns_service/src/lib.rs) is
not heard in a release build: its ``trace!`` lines are compiled out (``release_max_level_info``), so the lab listens to the group itself.
IT ONLY LISTENS. It never sends a packet, never answers, never sets a multicast interface or the loop flag (those are the sender's), and it never raises:
every refusal (a bind, a join, a read, a parse) is written into its own record and the test goes on unchanged.
HOW IT BINDS, against the engine's own socket (lib.rs:124-135): the engine makes a UDP socket with SO_REUSEADDR, SO_REUSEPORT where the system has it
(not on Windows) and binds 0.0.0.0:5353. Both sockets here set the same options, so two sockets share the port and each receives every datagram sent
to the group, and the listener takes nothing from the engine:
* Linux: SO_REUSEADDR and SO_REUSEPORT, bound to the group address 224.0.0.251:5353. A socket bound to a multicast address receives only datagrams
addressed to that group, never a unicast one, so it cannot take a datagram that was meant for the engine's wildcard socket.
* Windows: SO_REUSEADDR, bound to 0.0.0.0:5353 (a multicast address cannot be bound there). The listener is started BEFORE the browser is launched, so the
engine's socket is the later one: Windows gives a unicast datagram to the socket bound last, and the engine's responder sends and answers on the group
address only (lib.rs: ``send_to(&buf, mdns_addr)``).
It joins the group on the interfaces the engine joins on: ``mdns_service_start`` is given ``nr_stealth_mdns_interfaces()``, which is ``"127.0.0.1;"``
(dom/media/webrtc/transport/nr_stealth_network.cpp:229), and the engine joins each address it is given (lib.rs:138-145) and sends through the first
(lib.rs:150-153). So the listener joins on 127.0.0.1 and nothing else.
The record (``write``): JSON lines, the first line ``{"kind": "listener", ...}`` (how the bind and the join went, and the packet counts), then one
line per packet: ``m`` (``time.perf_counter()`` of the test process, the scale of the page timeline once joined by the launch's ``started_m``), ``t`` (wall
clock), ``src`` ([address, port]), ``bytes``, ``kind`` (``query``, ``response`` or ``unparsed``), ``id``, ``questions`` ([{name, type, unicast_bit}]) and
``answers`` ([{name, type, ttl, data}]) as read by a minimal DNS parse.
"""
from __future__ import annotations
import ipaddress
import json
import socket
import struct
import sys
import threading
import time
GROUP = "224.0.0.251"
#: The engine's group, and the one interface it joins on (nr_stealth_mdns_interfaces).
MDNS_ADDRESS = (GROUP, 5353)
JOIN_INTERFACE = "127.0.0.1"
_TYPES = {1: "A", 12: "PTR", 16: "TXT", 28: "AAAA", 33: "SRV", 255: "ANY"}
def _name(data: bytes, offset: int, depth: int = 0):
"""The domain name at ``offset`` (compression followed) and the offset after it in the record the name started in."""
labels, end, jumped = [], None, False
while True:
if offset >= len(data) or depth > 20:
raise ValueError("name out of range")
length = data[offset]
if length == 0:
offset += 1
break
if length & 0xC0 == 0xC0:
pointer = ((length & 0x3F) << 8) | data[offset + 1]
if end is None:
end = offset + 2
offset, jumped, depth = pointer, True, depth + 1
continue
labels.append(data[offset + 1: offset + 1 + length].decode("utf-8", "replace"))
offset += 1 + length
return ".".join(labels), (end if jumped else offset)
def parse(data: bytes) -> dict:
"""A DNS message, minimally: its id, whether it is a query or a response, the questions and the answers."""
identifier, flags, qd, an, ns, ar = struct.unpack("!6H", data[:12])
out = {"id": identifier, "kind": "response" if flags & 0x8000 else "query", "counts": [qd, an, ns, ar], "questions": [], "answers": []}
offset = 12
for _ in range(qd):
name, offset = _name(data, offset)
qtype, qclass = struct.unpack("!HH", data[offset: offset + 4])
offset += 4
out["questions"].append({"name": name, "type": _TYPES.get(qtype, qtype), "unicast_bit": bool(qclass & 0x8000)})
for _ in range(an + ns + ar):
name, offset = _name(data, offset)
rtype, _rclass, ttl, length = struct.unpack("!HHIH", data[offset: offset + 10])
offset += 10
raw = data[offset: offset + length]
if rtype == 1 and length == 4:
value = str(ipaddress.IPv4Address(raw))
elif rtype == 28 and length == 16:
value = str(ipaddress.IPv6Address(raw))
else:
value = raw.hex()
out["answers"].append({"name": name, "type": _TYPES.get(rtype, rtype), "ttl": ttl, "data": value})
offset += length
return out
class MdnsListener:
def __init__(self):
self.packets = []
#: What happened to the listener itself: the bind, the join, a read or a parse that failed. Never raised.
self.status = []
self._socket = None
self._thread = None
self._stop = threading.Event()
def start(self) -> "MdnsListener":
try:
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
if sys.platform != "win32" and hasattr(socket, "SO_REUSEPORT"):
sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEPORT, 1)
sock.bind((GROUP if sys.platform != "win32" else "0.0.0.0", MDNS_ADDRESS[1]))
self.status.append({"what": "bound", "address": sock.getsockname()[0], "port": sock.getsockname()[1]})
except Exception as exc:
self.status.append({"what": "bind failed: the listener hears nothing", "error": repr(exc)})
return self
try:
sock.setsockopt(socket.IPPROTO_IP, socket.IP_ADD_MEMBERSHIP, socket.inet_aton(GROUP) + socket.inet_aton(JOIN_INTERFACE))
self.status.append({"what": "joined", "group": GROUP, "interface": JOIN_INTERFACE})
except Exception as exc:
self.status.append({"what": "join failed", "group": GROUP, "interface": JOIN_INTERFACE, "error": repr(exc)})
try:
sock.settimeout(0.2)
self._socket = sock
self._thread = threading.Thread(target=self._run, name="mdns-listener", daemon=True)
self._thread.start()
except Exception as exc:
self.status.append({"what": "no reader thread", "error": repr(exc)})
return self
def _run(self) -> None:
sock = self._socket
while not self._stop.is_set():
try:
data, source = sock.recvfrom(9000)
except socket.timeout:
continue
except Exception as exc:
if not self._stop.is_set():
self.status.append({"what": "read failed: the listener stops", "error": repr(exc)})
return
record = {"m": round(time.perf_counter(), 6), "t": round(time.time(), 4), "src": [source[0], source[1]], "bytes": len(data)}
try:
record.update(parse(data))
except Exception as exc:
record.update(kind="unparsed", error=repr(exc), hex=data[:64].hex())
self.packets.append(record)
def stop(self) -> None:
self._stop.set()
try:
if self._socket is not None:
self._socket.close()
except Exception:
pass
if self._thread is not None:
self._thread.join()
def summary(self) -> dict:
kinds = {}
for packet in list(self.packets):
kinds[packet["kind"]] = kinds.get(packet["kind"], 0) + 1
return {"packets": len(self.packets), "by_kind": kinds, "status": list(self.status)}
def write(self, path) -> None:
with open(path, "w", encoding="utf-8") as out:
out.write(json.dumps(dict(kind="listener", group=GROUP, join_interface=JOIN_INTERFACE, **self.summary()), default=str) + "\n")
for packet in list(self.packets):
out.write(json.dumps(packet, default=str) + "\n")
+69
View File
@@ -0,0 +1,69 @@
"""The `goto` of the tests of pages that move on their own (`test_a_page_that_moves_on_e2e.py`), and the model of where the frame goes."""
from __future__ import annotations
def _landing(url: str) -> str:
"""Where the page of `url` sends itself: /landed with the query of its round, which no other round of the module has."""
return "/landed" + url[url.index("?"):]
#: The pages (by address) the frame may still go with, for each page of the browser (by `id`): the page sent last when `goto` answered, and, from a
#: `goto` that raised, every page it may have gone with (`_goto`). `forget` takes a page out when its test ends: an `id` is reused.
_SENT: dict = {}
#: An optional hook for the evidence a failing test leaves: called as ``note(what, **fields)`` where `_goto` sends, hears the answer and hears the error.
#: The test module sets it; it only listens and changes no wait or assertion.
note = None
def forget(page) -> None:
_SENT.pop(id(page), None)
def _goto(page, url, *, the_page_before_may_move, our_page_may_stop_ours, **kwargs) -> frozenset:
"""`page.goto`, and the pages the frame may go with: ``{url}`` when `goto` answers.
- ``the_page_before_may_move``: the pages sent before ours may still be moving (the rounds of the read test go on
while they do, module docstring). A `location.replace` of one of them may win: `goto` says ours was interrupted by it, or
stopped (NS_BINDING_ABORTED), and the frame lands on the landing of THAT page.
- ``our_page_may_stop_ours``: an engine before firefox-68, where `goto` may say NS_BINDING_ABORTED for our own
document, which had committed and then moved
(`test_networkidle_is_reached_only_on_the_page_that_replaced_a_document_still_arriving`); the frame then lands on
our landing.
When `goto` raises, the frame may still go with EITHER page: Playwright raises "interrupted" as soon as a different navigation commits,
while ours goes on, commits and moves to its own landing (run 44688029161: x50-4 raised for the landing of x50-3, and the frame then
navigated to the landing of x50-4). Nothing here knows which one it is, so the pages that may be moving are all of the pages before and
ours, and the next round accepts the landing of any of them. Stock Playwright behaves the same: the model was the test's.
Any other answer is red: an error that is neither answer, an "interrupted" that names a page that cannot be moving, and a navigation that
never answers. The detector of that last one is the timeout of the `goto` itself (each caller passes one): a bound of the test stricter
than it only judged the speed of the machine."""
from invisible_playwright.sync_api import Error
before = _SENT.get(id(page), frozenset()) if the_page_before_may_move else frozenset()
if note:
note("goto", url=url, before=sorted(before))
try:
page.goto(url, **kwargs)
if note:
note("goto-answered", url=url)
except Error as e:
text = str(e)
if note:
note("goto-raised", url=url, error=text[:300])
if "NS_BINDING_ABORTED" in text:
ends = tuple(_landing(u) for u in sorted(before | ({url} if our_page_may_stop_ours else frozenset())))
assert ends, e
page.wait_for_url(lambda u: u.endswith(ends), timeout=30_000)
else:
assert before, e
assert "is interrupted by another navigation to" in text, e
named = text.split("another navigation to")[1]
assert any(_landing(u) in named for u in before), (e, sorted(before))
possible = before | {url}
else:
possible = frozenset({url})
_SENT[id(page)] = possible
return possible
+99
View File
@@ -0,0 +1,99 @@
"""Reads the engine's own Juggler trace (``INVISIBLE_JUGGLER_TRACE_DIR``, `Trace.js`) for the line the parent writes when it moves a navigation.
The parent decides, synchronously (``DocumentLoadListener::TriggerProcessSwitch``), that a document load leaves the docShell that started it, and
tells the registry (observer topic ``juggler-navigation-moved``). The registry writes one line in the trace:
{"proc": "parent", "where": "navigations", "what": "onNavigationMoved",
"detail": {"frameId": "mainframe-<browser id>", "navigationId": "nav-<load id>",
"origin": {"browsingContextId": <id>, "childId": <id>}}}
``origin`` is the browsing context the load LEFT and the child id of the process that held it (0 is the parent process). The load is found by the
address the client sent: the registry writes ``onDocumentRequest`` with the same ``navigationId`` and the ``url`` of the request. A docShell that tells
the end of a navigation tells it with a ``reporter`` of the same shape (``onNavigationAborted``, ``onStateChange abort``): the docShell the load left is
the one whose reporter is ``origin``.
"""
from __future__ import annotations
import json
import pathlib
WHERE = "navigations"
MOVED = "onNavigationMoved"
REQUESTED = "onDocumentRequest"
def read_trace(trace_dir) -> list:
"""Every line of every file of the engine's trace folder, as dicts. A line that is not whole (the engine may still be writing) is left out."""
lines = []
for path in sorted(pathlib.Path(trace_dir).glob("*.jsonl")):
for raw in path.read_text(encoding="utf-8", errors="replace").splitlines():
try:
line = json.loads(raw)
except ValueError:
continue
if isinstance(line, dict):
lines.append(line)
return lines
def _detail(line) -> dict:
detail = line.get("detail")
return detail if isinstance(detail, dict) else {}
def navigation_ids_of(lines, url) -> set:
"""The ids of the navigations whose document request was for exactly ``url``."""
return {_detail(l).get("navigationId") for l in lines
if l.get("where") == WHERE and l.get("what") == REQUESTED and _detail(l).get("url") == url} - {None}
def moved_lines(lines, navigation_ids=None) -> list:
"""The ``onNavigationMoved`` lines, all of them or those of the given navigations."""
return [l for l in lines if l.get("where") == WHERE and l.get("what") == MOVED
and (navigation_ids is None or _detail(l).get("navigationId") in navigation_ids)]
def reporters_of(lines, navigation_ids, frame_id) -> list:
"""The ``(browsingContextId, childId)`` of every docShell that told something about these navigations in this frame, in the lines that carry a ``reporter``."""
out = []
for l in lines:
d = _detail(l)
reporter = d.get("reporter")
if d.get("navigationId") in navigation_ids and d.get("frameId") == frame_id and isinstance(reporter, dict):
out.append((reporter.get("browsingContextId"), reporter.get("childId")))
return out
def moved_origin(lines, url) -> tuple:
"""-> ``(browsingContextId, childId)`` the load of ``url`` left, said by exactly one ``onNavigationMoved`` line of its navigation.
Raises AssertionError with what the trace holds when the load is not in the trace (nothing proves anything then), when no line or more than one
is for it, when the line is not of a main frame or its origin is not a browsing context in a child process, or when a docShell that told the end
of this navigation is not the one the load left."""
ids = navigation_ids_of(lines, url)
assert ids, "the trace has no document request for %s: the engine's trace is not on, or the navigation was not seen" % url
found = moved_lines(lines, ids)
assert len(found) == 1, "%d onNavigationMoved line(s) for %s (navigations %s): %s" % (len(found), url, sorted(ids), found)
detail = _detail(found[0])
origin = detail.get("origin") or {}
assert str(detail.get("frameId", "")).startswith("mainframe-"), found[0]
bc, child = origin.get("browsingContextId"), origin.get("childId")
assert isinstance(bc, int) and bc > 0, "the origin names no browsing context: %s" % found[0]
assert isinstance(child, int) and child > 0, "the origin is not a content process (0 is the parent process): %s" % found[0]
told = set(reporters_of(lines, ids, detail["frameId"]))
assert told <= {(bc, child)}, "a docShell other than the one the load left told its end: %s, the origin is %s" % (sorted(told), (bc, child))
return bc, child
def assert_replaced_in_the_same_process(before, after) -> None:
"""Two origins, ``(browsingContextId, childId)``, of two loads one after the other of the same top-level frame: the second load left the browsing
context the first one created (the parent replaces the browsing context of a top-level navigation that can enter the back/forward cache), in the
process the first one left, which is also the process it went on in (same site)."""
assert before[1] == after[1], "a same-site load left another process: %s then %s" % (before, after)
assert before[0] != after[0], "the browsing context was not replaced: %s then %s" % (before, after)
def assert_nothing_moved_since(lines, already) -> None:
"""``already`` is the number of ``onNavigationMoved`` lines the trace held when the load began: it holds no more."""
found = moved_lines(lines)
assert len(found) == already, "the engine told that a navigation moved, and none left its process: %s" % found[already:]
+228
View File
@@ -0,0 +1,228 @@
"""A test that is not e2e never leaves the machine: every connection, datagram and name lookup it makes goes to this host or is refused.
The markers say it already (pyproject.toml: ``unit`` is "no network", ``integration`` is "no network"), and nothing enforced it:
``tests/unit/test_config_public.py`` composed the default prefs with no declared exit, the core asked api.ipify.org and icanhazip.com
where it leaves from, and the test failed on a machine whose network refused them. A test cannot fail for the reasons of a third party.
:func:`install` patches the four doors of the standard library that every client in the process goes through (``socket.socket.connect``,
``connect_ex`` and ``sendto``, and ``socket.getaddrinfo``): a destination on this host passes, anything else is refused with
:class:`LeftTheMachine` (a ``ConnectionRefusedError``, so the code under test sees what an offline machine shows it) AND recorded, so the test
fails at its teardown even when the code under test swallowed the refusal. The record names the test, the door and the destination.
asyncio has doors of its own, and on Windows they skip the four above: the Proactor loop connects with ``ConnectEx`` and sends datagrams with
``WSASendTo`` (``_overlapped``), never through ``socket.socket``. So the guard also patches the loop methods every asyncio client goes through, for
both loop kinds: ``BaseEventLoop.create_connection`` and ``create_datagram_endpoint`` (``remote_addr``), ``sock_connect`` and ``sock_sendto`` of the
selector and of the Proactor loop, and the Proactor datagram transport's ``sendto``.
What it cannot see, on any system: a socket made from ``_socket`` directly or used through ``_overlapped`` by hand (no library of this project
does), native code in the same process, and a child process (a subprocess has its own interpreter: the e2e are where a browser runs).
On this host: a loopback address (127/8, ::1), the unspecified address (0.0.0.0, ::, which a connect reaches on this host), a name that is
``localhost`` or ends in ``.localhost``, and an AF_UNIX path. The documentation ranges (192.0.2/24, 198.51.100/24, 203.0.113/24, 2001:db8::/32)
pass too: they are never routed, and the lab gives one of them to an interface of this host (the exit of the lab, tests/_lab_egress.py).
And the address this host sends from (its default route's, tests/_host_address.py): a relay of the tests that leaves from the address of the
host is on this host, and a datagram to it never leaves the machine.
"""
from __future__ import annotations
import ipaddress
import socket
import threading
from typing import Any, List, Optional, Sequence, Tuple
_DOCUMENTATION = tuple(ipaddress.ip_network(n) for n in ("192.0.2.0/24", "198.51.100.0/24", "203.0.113.0/24", "2001:db8::/32"))
RULE = ("a test that is not e2e never leaves the machine (pyproject.toml markers: unit and integration are 'no network'): "
"a test cannot fail for the reasons of a third party")
FIX = ("declare the value the code would ask the network for (timezone=, locale=, proxy= with a local gateway), use a server of the tests "
"on loopback (tests/_servers.py, the local_egress_echo fixture), or mark the test e2e if it is one")
#: The ONE file whose job is to ask a third party, and the hosts it may ask. Nothing else is declared, and a new entry is a decision, not a fix.
#: ``tests/test_version_is_not_taken.py`` is the version gate of a pull request: it asks the index whether the version the change proposes
#: is already published, which only the index can answer. It is skipped unless ``IPW_CHECK_VERSION`` is set, which only the ``version`` job
#: of tests.yml does. Its host is allowed for its name lookup and for the addresses that lookup answered, nothing else.
DECLARED_THIRD_PARTIES = {
"tests/test_version_is_not_taken.py": ("pypi.org",),
}
class LeftTheMachine(ConnectionRefusedError):
"""A destination outside this host, refused by the guard of the tests."""
def own_addresses() -> Tuple[str, ...]:
"""The addresses this host sends from, IPv4 and IPv6 (the source its default route picks). A UDP connect sends no packet; a family with
no route has none. Read BEFORE the doors are patched."""
found = []
for family, probe in ((socket.AF_INET, ("192.0.2.1", 9)), (socket.AF_INET6, ("2001:db8::1", 9))):
try:
with socket.socket(family, socket.SOCK_DGRAM) as s:
s.connect(probe)
found.append(s.getsockname()[0].split("%", 1)[0])
except OSError:
pass
return tuple(found)
def is_on_this_host(host: Any, own: Sequence[str] = ()) -> bool:
"""Whether ``host`` (an address, a name, or None) is on this host, the way the guard decides it; ``own`` are the addresses of this host
(:func:`own_addresses`)."""
if host is None:
return True
if isinstance(host, bytes):
host = host.decode("ascii", "replace")
host = str(host).strip("[]").split("%", 1)[0]
if host == "" or host.lower() == "localhost" or host.lower().endswith(".localhost"):
return True
try:
address = ipaddress.ip_address(host)
except ValueError:
return False # a name: resolving it is already a question to the network
if getattr(address, "ipv4_mapped", None) is not None:
address = address.ipv4_mapped
return (address.is_loopback or address.is_unspecified or any(address in net for net in _DOCUMENTATION)
or any(address == ipaddress.ip_address(mine) for mine in own))
def _destination(address: Any, own: Sequence[str] = ()) -> Optional[str]:
"""``host:port`` of a socket address that leaves the machine, or None when it does not (AF_UNIX paths and this host)."""
if not isinstance(address, tuple) or not address:
return None # an AF_UNIX path or an abstract name: this host
host = address[0]
if is_on_this_host(host, own):
return None
return "%s:%s" % (host, address[1] if len(address) > 1 else "?")
class Guard:
"""The record of one test: what it tried outside the machine. Thread-safe: a client thread of the test is recorded too."""
def __init__(self, test: str) -> None:
self.test = test
self.attempts: List[str] = []
self._lock = threading.Lock()
def refuse(self, door: str, destination: str) -> LeftTheMachine:
sentence = "%s %s" % (door, destination)
with self._lock:
if sentence not in self.attempts:
self.attempts.append(sentence)
return LeftTheMachine("WHERE: %s. WHAT: %s, outside this host, refused. FIX: %s. RULE: %s." % (self.test, sentence, FIX, RULE))
def verdict(self) -> Optional[str]:
"""The failure of the test, or None when it stayed on this host."""
if not self.attempts:
return None
return ("WHERE: %s. WHAT: the test tried to leave the machine: %s (each was refused). FIX: %s. RULE: %s."
% (self.test, "; ".join(self.attempts), FIX, RULE))
def install(monkeypatch: Any, test: str) -> Guard:
"""Patch the four doors for the duration of ``monkeypatch``; return the record of ``test``."""
guard = Guard(test)
declared_hosts = DECLARED_THIRD_PARTIES.get(test.split("::", 1)[0].replace("\\", "/"), ())
answered = set() # the addresses a lookup of a declared host answered: a connection to them is that host
own = tuple(own_addresses())
def mine():
return own + tuple(answered)
connect, connect_ex, sendto, getaddrinfo = (socket.socket.connect, socket.socket.connect_ex, socket.socket.sendto,
socket.getaddrinfo)
def guarded_connect(self, address):
where = _destination(address, mine())
if where is not None:
raise guard.refuse("connect to", where)
return connect(self, address)
def guarded_connect_ex(self, address):
where = _destination(address, mine())
if where is not None:
raise guard.refuse("connect to", where)
return connect_ex(self, address)
def guarded_sendto(self, data, *rest):
where = _destination(rest[-1] if rest else None, mine())
if where is not None:
raise guard.refuse("datagram to", where)
return sendto(self, data, *rest)
def guarded_getaddrinfo(host, *args, **kwargs):
if isinstance(host, str) and host.lower() in declared_hosts:
found = getaddrinfo(host, *args, **kwargs)
answered.update(info[4][0] for info in found)
return found
if not is_on_this_host(host, mine()):
raise guard.refuse("name lookup of", str(host))
return getaddrinfo(host, *args, **kwargs)
_install_asyncio(monkeypatch, guard, mine)
monkeypatch.setattr(socket.socket, "connect", guarded_connect)
monkeypatch.setattr(socket.socket, "connect_ex", guarded_connect_ex)
monkeypatch.setattr(socket.socket, "sendto", guarded_sendto)
monkeypatch.setattr(socket, "getaddrinfo", guarded_getaddrinfo)
return guard
def _install_asyncio(monkeypatch: Any, guard: Guard, mine: Any) -> None:
"""The asyncio doors (module docstring), for the selector loop and, where it exists, the Proactor loop."""
import asyncio.base_events as base_events
import asyncio.selector_events as selector_events
loops = [selector_events.BaseSelectorEventLoop]
datagram_transports = []
try:
import asyncio.proactor_events as proactor_events
loops.append(proactor_events.BaseProactorEventLoop)
datagram_transports.append(proactor_events._ProactorDatagramTransport)
except ImportError: # pragma: no cover - the module exists on every system; its loop runs only on Windows
pass
create_connection = base_events.BaseEventLoop.create_connection
create_datagram_endpoint = base_events.BaseEventLoop.create_datagram_endpoint
async def guarded_create_connection(self, protocol_factory, host=None, port=None, *args, **kwargs):
if host is not None and kwargs.get("sock") is None and not is_on_this_host(host, mine()):
raise guard.refuse("asyncio connect to", "%s:%s" % (host, port))
return await create_connection(self, protocol_factory, host, port, *args, **kwargs)
async def guarded_create_datagram_endpoint(self, protocol_factory, local_addr=None, remote_addr=None, **kwargs):
where = _destination(remote_addr, mine())
if where is not None:
raise guard.refuse("asyncio datagram endpoint to", where)
return await create_datagram_endpoint(self, protocol_factory, local_addr=local_addr, remote_addr=remote_addr, **kwargs)
monkeypatch.setattr(base_events.BaseEventLoop, "create_connection", guarded_create_connection)
monkeypatch.setattr(base_events.BaseEventLoop, "create_datagram_endpoint", guarded_create_datagram_endpoint)
for loop in loops:
sock_connect, sock_sendto = loop.sock_connect, loop.sock_sendto
def make(sock_connect=sock_connect, sock_sendto=sock_sendto):
async def guarded_sock_connect(self, sock, address):
where = _destination(address, mine())
if where is not None:
raise guard.refuse("asyncio connect to", where)
return await sock_connect(self, sock, address)
async def guarded_sock_sendto(self, sock, data, address):
where = _destination(address, mine())
if where is not None:
raise guard.refuse("asyncio datagram to", where)
return await sock_sendto(self, sock, data, address)
return guarded_sock_connect, guarded_sock_sendto
guarded_sock_connect, guarded_sock_sendto = make()
monkeypatch.setattr(loop, "sock_connect", guarded_sock_connect)
monkeypatch.setattr(loop, "sock_sendto", guarded_sock_sendto)
for transport in datagram_transports:
def make_sendto(sendto=transport.sendto):
def guarded_sendto(self, data, addr=None):
where = _destination(addr, mine())
if where is not None:
raise guard.refuse("asyncio datagram to", where)
return sendto(self, data, addr)
return guarded_sendto
monkeypatch.setattr(transport, "sendto", make_sendto())
+200
View File
@@ -0,0 +1,200 @@
"""Where the operating system's own cursor is while a headed browser window is on the desktop the test runs on.
A real window that appears under the OS cursor receives a native ``WM_MOUSEMOVE`` for it, and the first native move of a process always passes Gecko's
``LastMouseMoveData`` filter, so the page sees ``mousemove`` at the cursor's place with ``buttons=0``, at a moment the test does not choose. On a GitHub
Windows runner the cursor sits at (512, 384) and the headed window covers (-8, -8) to (1928, 1040): the move reached the page once in the middle of a drag
(``test_drag_motion.py::test_a_real_page_sees_a_drag_that_travelled`` saw ``mousemove 512,299 buttons=0`` after the press). The engine keeps delivering native
input to content, so the arrangement is the test's: the cursor is parked on a point of the desktop that no window of the browser covers, before the browser
starts, and a test that records pointer events checks it still is when its gesture begins.
* Windows: ``user32`` through ctypes. The windows are the visible top-level ones of the processes below the test process (the browsers it launched), seen from
the desktop the test runs on: a ``headless=True`` browser runs on a Win32 desktop of its own (``make_virtual_display``), is not enumerated here and cannot
receive the interactive cursor.
* Linux and macOS: nothing to do. The Linux e2e run under ``xvfb-run``: an X server with virtual pointer and keyboard devices (XTEST) and no physical one,
so nothing moves a pointer there; every function answers "outside" and ``park`` does nothing.
"""
from __future__ import annotations
import ctypes
import os
import sys
from typing import List, Optional, Sequence, Tuple
#: ``(left, top, right, bottom)`` as ``GetWindowRect`` gives it: ``right`` and ``bottom`` are the first pixel outside.
Rect = Tuple[int, int, int, int]
Point = Tuple[int, int]
#: How far from every window the parked cursor is, in pixels: a window is moved or grown by a border or a shadow, and the cursor must stay outside of it.
MARGIN = 8
class TheCursorIsInside(AssertionError):
"""The OS cursor is over a window of the browser while a gesture is about to start."""
class TheCursorCannotBeParked(RuntimeError):
"""No point of the desktop is free of the browser's windows, or the system did not move the cursor."""
def _inflate(rect: Rect, margin: int) -> Rect:
return (rect[0] - margin, rect[1] - margin, rect[2] + margin, rect[3] + margin)
def _contains(rect: Rect, point: Point) -> bool:
return rect[0] <= point[0] < rect[2] and rect[1] <= point[1] < rect[3]
def cursor_is_outside(window_rects: Sequence[Rect], cursor: Optional[Point] = None, margin: int = 0, *,
api: Optional["_Win32"] = None) -> bool:
"""True when ``cursor`` (read from the system when None) is outside every rectangle, ``margin`` pixels beyond its edge included.
Not Windows: True, there is no OS cursor that reaches a window."""
if cursor is None:
api = api or _api()
if api is None:
return True
cursor = api.cursor_position()
return not any(_contains(_inflate(r, margin), cursor) for r in window_rects)
def park_outside(window_rects: Sequence[Rect], screen_rect: Rect, margin: int = MARGIN) -> Point:
"""A pixel of the virtual screen that is at least ``margin`` pixels from every window rectangle: the bottom-right corner when it is free.
``screen_rect`` is ``(left, top, right, bottom)`` of the virtual screen, ``right`` and ``bottom`` exclusive (its origin is negative when a monitor lies left of or
above the primary one). The candidates are the screen's edges and the places just beyond each window's inflated edges; a free pixel exists only if one
of them is free (the free pixel can be slid left and up until it touches an edge, and it stays free), so a ``TheCursorCannotBeParked`` is exact."""
left, top, right, bottom = screen_rect
if right <= left or bottom <= top:
raise TheCursorCannotBeParked(
"park_outside: the virtual screen %r is empty. Where: the screen rectangle read from the system. What: no pixel to put the cursor on. "
"Fix: run the e2e on an interactive desktop session." % (screen_rect,))
inflated = [_inflate(r, margin) for r in window_rects]
xs = sorted({right - 1, left, *(min(max(r[2], left), right - 1) for r in inflated), *(min(max(r[0] - 1, left), right - 1) for r in inflated)},
reverse=True)
ys = sorted({bottom - 1, top, *(min(max(r[3], top), bottom - 1) for r in inflated), *(min(max(r[1] - 1, top), bottom - 1) for r in inflated)},
reverse=True)
for y in ys:
for x in xs:
if not any(_contains(r, (x, y)) for r in inflated):
return (x, y)
raise TheCursorCannotBeParked(
"park_outside: the windows %r cover every pixel of the screen %r with a margin of %d. Where: the headed browser window the test launched. What: the "
"OS cursor would be over the page whatever the point, and a native mouse move would reach it. Fix: shrink the window below the screen (the test's own "
"geometry; it is not this helper's to change) or run the test on a bigger desktop." % (list(window_rects), screen_rect, margin))
class _Win32:
"""What the desktop answers, by ``user32``. One object so a test can stand a fake in for it."""
def __init__(self) -> None:
from ctypes import wintypes
self.wintypes = wintypes
self.user32 = ctypes.WinDLL("user32", use_last_error=True)
u = self.user32
u.GetCursorPos.argtypes = (ctypes.POINTER(wintypes.POINT),)
u.GetCursorPos.restype = wintypes.BOOL
u.SetCursorPos.argtypes = (ctypes.c_int, ctypes.c_int)
u.SetCursorPos.restype = wintypes.BOOL
u.GetSystemMetrics.argtypes = (ctypes.c_int,)
u.GetSystemMetrics.restype = ctypes.c_int
u.GetWindowRect.argtypes = (wintypes.HWND, ctypes.POINTER(wintypes.RECT))
u.GetWindowRect.restype = wintypes.BOOL
u.IsWindowVisible.argtypes = (wintypes.HWND,)
u.IsWindowVisible.restype = wintypes.BOOL
u.IsIconic.argtypes = (wintypes.HWND,)
u.IsIconic.restype = wintypes.BOOL
u.GetWindowThreadProcessId.argtypes = (wintypes.HWND, ctypes.POINTER(wintypes.DWORD))
u.GetWindowThreadProcessId.restype = wintypes.DWORD
self.enum_proc = ctypes.WINFUNCTYPE(wintypes.BOOL, wintypes.HWND, wintypes.LPARAM)
u.EnumWindows.argtypes = (self.enum_proc, wintypes.LPARAM)
u.EnumWindows.restype = wintypes.BOOL
def cursor_position(self) -> Point:
point = self.wintypes.POINT()
if not self.user32.GetCursorPos(ctypes.byref(point)):
raise TheCursorCannotBeParked(
"GetCursorPos failed (error %d). Where: user32, on the desktop the test runs on. What: the OS cursor cannot be read. Fix: run the e2e on an "
"interactive desktop session (not a locked screen or a service)." % ctypes.get_last_error())
return (point.x, point.y)
def set_cursor_position(self, x: int, y: int) -> None:
self.user32.SetCursorPos(x, y)
def screen(self) -> Rect:
"""The virtual screen: ``SM_XVIRTUALSCREEN``, ``SM_YVIRTUALSCREEN``, ``SM_CXVIRTUALSCREEN``, ``SM_CYVIRTUALSCREEN``."""
x, y, w, h = (self.user32.GetSystemMetrics(n) for n in (76, 77, 78, 79))
return (x, y, x + w, y + h)
def windows_below(self, root_pid: int) -> List[Rect]:
"""The rectangles of the visible, not minimised, top-level windows of the processes below ``root_pid``."""
import psutil
try:
pids = {p.pid for p in psutil.Process(root_pid).children(recursive=True)}
except psutil.Error:
return []
found: List[Rect] = []
def each(hwnd, _):
owner = self.wintypes.DWORD()
self.user32.GetWindowThreadProcessId(hwnd, ctypes.byref(owner))
if owner.value in pids and self.user32.IsWindowVisible(hwnd) and not self.user32.IsIconic(hwnd):
rect = self.wintypes.RECT()
if self.user32.GetWindowRect(hwnd, ctypes.byref(rect)) and rect.right > rect.left and rect.bottom > rect.top:
found.append((rect.left, rect.top, rect.right, rect.bottom))
return True
self.user32.EnumWindows(self.enum_proc(each), 0)
return found
def _is_windows() -> bool:
return sys.platform == "win32"
def _api() -> Optional[_Win32]:
return _Win32() if _is_windows() else None
def browser_windows(root_pid: Optional[int] = None, *, api: Optional[_Win32] = None) -> List[Rect]:
"""The rectangles of the windows of the browsers below ``root_pid`` (the test process by default) on this desktop; empty when not Windows."""
api = api or _api()
if api is None:
return []
return api.windows_below(os.getpid() if root_pid is None else root_pid)
def park(root_pid: Optional[int] = None, *, api: Optional[_Win32] = None) -> Optional[Point]:
"""Windows: put the OS cursor on a point no window of the browsers below ``root_pid`` covers and read it back. Returns the point; None when not Windows.
Called before the browser starts there is no window yet and the point is the bottom-right corner of the virtual screen, where the engine places no window."""
api = api or _api()
if api is None:
return None
target = park_outside(api.windows_below(os.getpid() if root_pid is None else root_pid), api.screen())
api.set_cursor_position(*target)
read_back = api.cursor_position()
if read_back != target:
raise TheCursorCannotBeParked(
"SetCursorPos(%d, %d) left the cursor at %r. Where: user32, on the desktop the test runs on. What: the OS cursor cannot be moved, so a native "
"mouse move for it can reach a window of the browser mid-gesture. Fix: run the e2e on an interactive desktop session (not a locked screen "
"or a service), with no other program holding the cursor." % (target[0], target[1], read_back))
return target
def require_outside(root_pid: Optional[int] = None, *, api: Optional[_Win32] = None, margin: int = 0) -> None:
"""The precondition of a gesture a test judges by the pointer events the page records: the OS cursor is outside every window of the browsers.
Raises ``TheCursorIsInside`` otherwise, with the cursor and the windows. Not Windows: nothing."""
api = api or _api()
if api is None:
return
windows = api.windows_below(os.getpid() if root_pid is None else root_pid)
cursor = api.cursor_position()
if not cursor_is_outside(windows, cursor, margin):
raise TheCursorIsInside(
"the OS cursor is at %r, inside the browser window(s) %r, when a pointer gesture is about to start. Where: the desktop the test runs on. What: "
"a native WM_MOUSEMOVE for it passes Gecko's first-move filter and reaches the page as a mousemove with buttons=0 at a moment of the "
"system's choosing, in the middle of the gesture the test records. Fix: park the cursor outside the window before the browser starts "
"(the autouse fixture `_the_os_cursor_is_outside_the_browser_window` of tests/conftest.py does it for every e2e test on Windows)." % (cursor, windows))
+186
View File
@@ -0,0 +1,186 @@
"""What the window e2e tests ask the operating system itself: which window holds the input focus, on a display of the test's own.
A page's ``document.hasFocus()`` is what the engine reports. A test that judges "the first session kept the focus when another one took the display" must
first know that the OS did give the focus to the second session's window; otherwise a green means only that nothing happened (the second window never took
it, or took it later than the read). The OS answers that without the engine:
* Linux: the X input focus (``XGetInputFocus`` on the display the sessions share); the display is a private Xvfb started for the test (``a_display_of_its_own``),
so no other test's headed window moves the focus in it. No window manager runs there, so nobody ever sets the X input focus: it stays ``PointerRoot``
and GDK activates whichever toplevel is under the pointer (``has_pointer_focus``, ``gdk/x11/gdkdevicemanager-core-x11.c``), and Firefox raises a window
itself only when it is not active already (``nsWindow::SetFocus``, ``gtk_window_present_with_time``). The test therefore does what a window manager does
when the user clicks a window: ``XSetInputFocus`` on the toplevel the step names (found by its ``_NET_WM_NAME``), and reads ``XGetInputFocus`` back;
* Windows: the foreground window (``GetForegroundWindow``), the window of the session found by the title its page gave it.
"""
from __future__ import annotations
import contextlib
import ctypes
import subprocess
import sys
import threading
from typing import Iterator, Optional
#: ``RevertToParent`` and ``CurrentTime`` of ``XSetInputFocus`` (as GDK's own ``gdk_x11_window_focus`` without a window manager); ``IsViewable``.
_REVERT_TO_PARENT, _CURRENT_TIME, _IS_VIEWABLE = 2, 0, 2
class _XWindowAttributes(ctypes.Structure):
_fields_ = [("x", ctypes.c_int), ("y", ctypes.c_int), ("width", ctypes.c_int), ("height", ctypes.c_int), ("border_width", ctypes.c_int),
("depth", ctypes.c_int), ("visual", ctypes.c_void_p), ("root", ctypes.c_ulong), ("c_class", ctypes.c_int), ("bit_gravity", ctypes.c_int),
("win_gravity", ctypes.c_int), ("backing_store", ctypes.c_int), ("backing_planes", ctypes.c_ulong), ("backing_pixel", ctypes.c_ulong),
("save_under", ctypes.c_int), ("colormap", ctypes.c_ulong), ("map_installed", ctypes.c_int), ("map_state", ctypes.c_int),
("all_event_masks", ctypes.c_long), ("your_event_mask", ctypes.c_long), ("do_not_propagate_mask", ctypes.c_long),
("override_redirect", ctypes.c_int), ("screen", ctypes.c_void_p)]
#: An X error (a window gone between two requests, a focus asked for a window not yet viewable) is ignored instead of ending the process as Xlib's
#: default handler does; the wait that asked reads the focus again on its next look.
_X_ERROR_HANDLER = ctypes.CFUNCTYPE(ctypes.c_int, ctypes.c_void_p, ctypes.c_void_p)
_ignore_x_error = _X_ERROR_HANDLER(lambda display, event: 0)
@contextlib.contextmanager
def a_display_of_its_own(monkeypatch) -> Iterator[str]:
"""Linux: a private Xvfb (the number chosen by the server, ``-displayfd``), set as ``DISPLAY`` for the test and stopped at its end.
Two headed sessions started inside it see each other and nothing else; the Xvfb of ``xvfb-run`` that the parallel workers share is never touched."""
process = subprocess.Popen(["Xvfb", "-displayfd", "1", "-screen", "0", "1920x1080x24", "-nolisten", "tcp"],
stdout=subprocess.PIPE, stderr=subprocess.DEVNULL, text=True)
answer = {}
reader = threading.Thread(target=lambda: answer.setdefault("line", process.stdout.readline()), daemon=True)
reader.start()
try:
reader.join(60)
number = answer.get("line", "").strip()
assert number.isdigit(), "the private Xvfb did not give a display number (it said %r, exit %r)" % (number, process.poll())
monkeypatch.setenv("DISPLAY", ":" + number)
for name in ("WAYLAND_DISPLAY", "XAUTHORITY"):
monkeypatch.delenv(name, raising=False)
yield ":" + number
finally:
process.terminate()
try:
process.wait(30)
except subprocess.TimeoutExpired:
process.kill()
process.wait(30)
process.stdout.close()
class XFocus:
"""The X input focus of a display, read and given through a connection of its own (libX11, as the engine's own client library)."""
def __init__(self, display: str) -> None:
x11 = self.x11 = ctypes.CDLL("libX11.so.6")
ulong_p, int_p = ctypes.POINTER(ctypes.c_ulong), ctypes.POINTER(ctypes.c_int)
x11.XOpenDisplay.restype, x11.XOpenDisplay.argtypes = ctypes.c_void_p, (ctypes.c_char_p,)
x11.XSetErrorHandler.argtypes = (_X_ERROR_HANDLER,)
x11.XDefaultRootWindow.restype, x11.XDefaultRootWindow.argtypes = ctypes.c_ulong, (ctypes.c_void_p,)
x11.XInternAtom.restype, x11.XInternAtom.argtypes = ctypes.c_ulong, (ctypes.c_void_p, ctypes.c_char_p, ctypes.c_int)
x11.XQueryTree.argtypes = (ctypes.c_void_p, ctypes.c_ulong, ulong_p, ulong_p, ctypes.POINTER(ulong_p), ctypes.POINTER(ctypes.c_uint))
x11.XGetWindowAttributes.argtypes = (ctypes.c_void_p, ctypes.c_ulong, ctypes.POINTER(_XWindowAttributes))
x11.XGetWindowProperty.argtypes = (ctypes.c_void_p, ctypes.c_ulong, ctypes.c_ulong, ctypes.c_long, ctypes.c_long, ctypes.c_int, ctypes.c_ulong,
ulong_p, int_p, ulong_p, ulong_p, ctypes.POINTER(ctypes.c_void_p))
x11.XFree.argtypes = (ctypes.c_void_p,)
x11.XSetInputFocus.argtypes = (ctypes.c_void_p, ctypes.c_ulong, ctypes.c_int, ctypes.c_ulong)
x11.XSync.argtypes = (ctypes.c_void_p, ctypes.c_int)
x11.XGetInputFocus.argtypes = (ctypes.c_void_p, ulong_p, int_p)
x11.XCloseDisplay.argtypes = (ctypes.c_void_p,)
x11.XSetErrorHandler(_ignore_x_error)
self.connection = x11.XOpenDisplay(display.encode())
assert self.connection, "no connection to the display %r" % display
self.root = x11.XDefaultRootWindow(self.connection)
self.net_wm_name = x11.XInternAtom(self.connection, b"_NET_WM_NAME", False)
self.utf8_string = x11.XInternAtom(self.connection, b"UTF8_STRING", False)
def holder(self) -> int:
window, revert = ctypes.c_ulong(), ctypes.c_int()
self.x11.XGetInputFocus(self.connection, ctypes.byref(window), ctypes.byref(revert))
return int(window.value)
def _title(self, window: int) -> str:
kind, size, count, left, data = ctypes.c_ulong(), ctypes.c_int(), ctypes.c_ulong(), ctypes.c_ulong(), ctypes.c_void_p()
if self.x11.XGetWindowProperty(self.connection, window, self.net_wm_name, 0, 1024, False, self.utf8_string, ctypes.byref(kind),
ctypes.byref(size), ctypes.byref(count), ctypes.byref(left), ctypes.byref(data)) != 0 or not data.value:
return ""
try:
return ctypes.string_at(data.value, count.value).decode("utf-8", "replace") if size.value == 8 else ""
finally:
self.x11.XFree(data)
def _viewable(self, window: int) -> bool:
attributes = _XWindowAttributes()
return bool(self.x11.XGetWindowAttributes(self.connection, window, ctypes.byref(attributes))) and attributes.map_state == _IS_VIEWABLE
def window_titled(self, title: str) -> Optional[int]:
"""The one viewable toplevel (a child of the root: no window manager reparents it) whose ``_NET_WM_NAME`` starts with ``title``, or None."""
root, parent, children, count = ctypes.c_ulong(), ctypes.c_ulong(), ctypes.POINTER(ctypes.c_ulong)(), ctypes.c_uint()
if not self.x11.XQueryTree(self.connection, self.root, ctypes.byref(root), ctypes.byref(parent), ctypes.byref(children), ctypes.byref(count)):
return None
try:
windows = [int(children[i]) for i in range(count.value)]
finally:
if children:
self.x11.XFree(children)
found = [window for window in windows if self._title(window).startswith(title) and self._viewable(window)]
return found[0] if len(found) == 1 else None
def ask_for_the_foreground(self, window: int) -> int:
"""What a window manager does when the user clicks the window (none runs on this display): ``XSetInputFocus`` on it, then the focus is read back."""
self.x11.XSetInputFocus(self.connection, window, _REVERT_TO_PARENT, _CURRENT_TIME)
self.x11.XSync(self.connection, False)
return self.holder()
def close(self) -> None:
self.x11.XCloseDisplay(self.connection)
self.connection = None
class ForegroundWindow:
"""Windows: the foreground window of the desktop the sessions run on, and the Firefox window a title names."""
def __init__(self) -> None:
from ctypes import wintypes
self.user32 = ctypes.WinDLL("user32", use_last_error=True)
self.user32.GetForegroundWindow.restype = wintypes.HWND
self.user32.SetForegroundWindow.argtypes = (wintypes.HWND,)
self.enum = ctypes.WINFUNCTYPE(wintypes.BOOL, wintypes.HWND, wintypes.LPARAM)
def holder(self) -> int:
return self.user32.GetForegroundWindow() or 0
def window_titled(self, title: str) -> Optional[int]:
"""The one visible top-level Firefox window whose title starts with ``title``, or None (none, or more than one)."""
found = []
def each(hwnd, _):
name, text = ctypes.create_unicode_buffer(256), ctypes.create_unicode_buffer(512)
self.user32.GetClassNameW(hwnd, name, 256)
self.user32.GetWindowTextW(hwnd, text, 512)
if name.value.startswith("MozillaWindowClass") and text.value.startswith(title) and self.user32.IsWindowVisible(hwnd):
found.append(hwnd)
return True
self.user32.EnumWindows(self.enum(each), 0)
return found[0] if len(found) == 1 else None
def ask_for_the_foreground(self, hwnd: int) -> int:
"""What a user does by clicking the window: the system may refuse it, and then the foreground is what the test reads."""
self.user32.SetForegroundWindow(hwnd)
return self.holder()
def host_monitor_size() -> Optional[tuple]:
"""Windows: the primary monitor in device pixels (the reading of a per-monitor-aware process, whatever the test's own awareness is); None elsewhere."""
if sys.platform != "win32":
return None
user32 = ctypes.WinDLL("user32")
user32.SetThreadDpiAwarenessContext.restype = ctypes.c_void_p
user32.SetThreadDpiAwarenessContext.argtypes = (ctypes.c_void_p,)
previous = user32.SetThreadDpiAwarenessContext(ctypes.c_void_p(-4))
try:
return (user32.GetSystemMetrics(0), user32.GetSystemMetrics(1))
finally:
if previous:
user32.SetThreadDpiAwarenessContext(ctypes.c_void_p(previous))
+151
View File
@@ -0,0 +1,151 @@
"""What a popup twin records about each element it clicks, so that a red run says what the click and the geometry were, and a green run leaves the numbers to compare.
A twin that clicks an element and waits for a popup (the select dropdown) used to say "the dropdown did not open" and nothing about the click: where it was sent, at which scale, what the
element's box was in its document and in the window, and what the popup was doing. This module is what the twin keeps for each element, and writes:
* ``click``: the point in CSS pixels, and the point the driver sent (the unit it is in and the device point it makes: CSS times the scale the driver knows);
* ``scales``: the record of ``Driver.scales()`` (the page's and the chrome's ``devicePixelRatio`` and the real scale of the screen), once per browser;
* ``select_rect``: ``getBoundingClientRect`` of the element inside its own document, and, for an element of a frame, ``iframe_rect``: the frame element's box in the top document;
* ``mozInnerScreen``: ``window.mozInnerScreenX/Y`` of the top document and, for a frame, of the frame's document;
* ``activation_at_click`` and ``activation_after_click``: whether the window was the active one, and had the focus, when the click was sent and right after (``look_at_activation``): chrome
``Services.focus.activeWindow === win``, ``win.document.hasFocus()``, the browsing context's ``isActive`` (``win.gBrowser.selectedBrowser.browsingContext.isActive``), the top content document's
``hasFocus()`` and ``visibilityState``, and the driver's ack of the click when it has one (``last_click_ack``); a popup that does not open for a window that was not active is not a popup that is at the wrong place;
* ``popup``: the state after the click (the first look), the last look of the wait (at the deadline) and, when the popup did not reach the state, a second look (the select test: a short wait on the same condition, so that a popup that comes late is seen to come late).
A read that fails is recorded in ``errors`` and never raised: the diagnosis must not replace the finding. The record is in the message of the failure and, on a runner (``RUNNER_TEMP`` set), in
``$RUNNER_TEMP/invpw-evidence/popup-diagnostics/<case>-<browser>.json``, the folder every e2e job uploads (see ``_watchdog_log``), whatever the result.
"""
from __future__ import annotations
import json
import os
from pathlib import Path
from typing import Any, Dict, Mapping, Optional, Sequence
from _watchdog_log import EVIDENCE_FOLDER
#: The folder of this evidence inside ``$RUNNER_TEMP/invpw-evidence``.
SUBFOLDER = "popup-diagnostics"
#: The top document: the element's box, the frame element's box, the window's place on the screen. Both ids are given by the page of the twin.
TOP_GEOMETRY_JS = """(() => {
const box = id => { const e = document.getElementById(id); if (!e) { return null; } const b = e.getBoundingClientRect(); return {x: b.x, y: b.y, w: b.width, h: b.height}; };
return {select: box(%(select)s), iframe: box(%(iframe)s), mozInnerScreen: [window.mozInnerScreenX, window.mozInnerScreenY], scroll: [window.scrollX, window.scrollY]};
})()"""
#: The document of a frame: the element's box inside it and its own place on the screen.
FRAME_GEOMETRY_JS = """(() => {
const e = document.getElementById(%(select)s); const b = e ? e.getBoundingClientRect() : null;
return {select: b && {x: b.x, y: b.y, w: b.width, h: b.height}, mozInnerScreen: [window.mozInnerScreenX, window.mozInnerScreenY], scroll: [window.scrollX, window.scrollY]};
})()"""
#: Chrome scope: the window's activation and focus, and the browsing context of the selected tab. ``win`` is the most recent browser window, as every chrome script of the twins reads it.
ACTIVATION_JS = """
const win = Services.wm.getMostRecentWindow("navigator:browser");
return JSON.stringify({
active_window: Services.focus.activeWindow === win,
window_has_focus: win.document.hasFocus(),
browsing_context_is_active: win.gBrowser.selectedBrowser.browsingContext.isActive,
});
"""
#: The top content document, read through the driver (``driver.eval``): the same expression on every driver.
CONTENT_ACTIVATION_JS = """(() => ({hasFocus: document.hasFocus(), visibilityState: document.visibilityState}))()"""
def _failed(exc: BaseException) -> str:
return "%s: %s" % (type(exc).__name__, str(exc)[:300])
def look_at_geometry(driver: Any, in_frame: bool, select_id: str = "s", frame_id: str = "f") -> Dict[str, Any]:
"""The boxes and the window's place for one element, read before the click. ``driver.eval`` reads the top document, ``driver.eval_in_frame`` the frame's.
A read that fails leaves its field out and says why in ``errors``."""
ids = {"select": json.dumps(select_id), "iframe": json.dumps(frame_id)}
out: Dict[str, Any] = {"errors": {}}
top: Optional[Dict[str, Any]] = None
try:
top = driver.eval(TOP_GEOMETRY_JS % ids)
except Exception as exc: # noqa: BLE001 the diagnosis never replaces the finding
out["errors"]["top_document"] = _failed(exc)
top = top or {}
out["mozInnerScreen"] = {"top": top.get("mozInnerScreen")}
if not in_frame:
out["select_rect"] = top.get("select")
out["iframe_rect"] = None
else:
out["iframe_rect"] = top.get("iframe")
try:
inner = driver.eval_in_frame(FRAME_GEOMETRY_JS % ids)
out["select_rect"] = inner.get("select")
out["mozInnerScreen"]["frame"] = inner.get("mozInnerScreen")
except Exception as exc: # noqa: BLE001
out["errors"]["frame_document"] = _failed(exc)
out["select_rect"] = None
out["mozInnerScreen"]["frame"] = None
if not out["errors"]:
del out["errors"]
return out
def look_at_activation(driver: Any) -> Dict[str, Any]:
"""The window's activation and focus now: the chrome's (``ACTIVATION_JS``), the top content document's (``CONTENT_ACTIVATION_JS``) and the driver's ack of the click, when it keeps one
(``last_click_ack``, None otherwise). A read that fails leaves its part out and says why in ``errors``; the diagnosis never replaces the finding."""
out: Dict[str, Any] = {"errors": {}}
try:
out["chrome"] = driver.chrome.script(ACTIVATION_JS)
except Exception as exc: # noqa: BLE001
out["errors"]["chrome"] = _failed(exc)
try:
out["content"] = driver.eval(CONTENT_ACTIVATION_JS)
except Exception as exc: # noqa: BLE001
out["errors"]["content"] = _failed(exc)
out["click_ack"] = getattr(driver, "last_click_ack", None)
if not out["errors"]:
del out["errors"]
return out
def click_record(driver: Any, css: Sequence[float]) -> Dict[str, Any]:
"""The click as asked (CSS pixels) and as the driver sent it (``driver.last_click``: the point, its unit, the device point), as the driver wrote it."""
return {"css": list(css), "sent": getattr(driver, "last_click", None)}
class Diagnostics:
"""The record of one browser on one case: its scales and one entry per element."""
def __init__(self, case: str, browser: str) -> None:
self.case, self.browser = case, browser
self.scales: Optional[Dict[str, Any]] = None
self.entries: Dict[str, Dict[str, Any]] = {}
self.save_error: Optional[str] = None
def entry(self, name: str) -> Dict[str, Any]:
return self.entries.setdefault(name, {})
def record(self) -> Dict[str, Any]:
return {"case": self.case, "browser": self.browser, "scales": self.scales, "elements": self.entries}
def message(self, headline: str, name: str) -> str:
"""``headline``, then everything known about the element ``name`` and the scales, as one JSON line a reader can paste."""
body = {"case": self.case, "browser": self.browser, "element": name, "scales": self.scales, **self.entries.get(name, {})}
return "%s\n diagnostics: %s" % (headline, json.dumps(body, sort_keys=True))
def path(self, environ: Mapping[str, str]) -> Optional[Path]:
runner = environ.get("RUNNER_TEMP")
if not runner:
return None
return Path(runner) / EVIDENCE_FOLDER / SUBFOLDER / ("%s-%s.json" % (self.case, self.browser))
def save(self, environ: Optional[Mapping[str, str]] = None) -> Optional[Path]:
"""Writes the record where the jobs upload it; None off a runner. A failed write is kept in ``save_error`` and never raised: this runs while a finding may be on its way up."""
path = self.path(os.environ if environ is None else environ)
if path is None:
return None
try:
path.parent.mkdir(parents=True, exist_ok=True)
path.write_text(json.dumps(self.record(), indent=1, sort_keys=True) + "\n", encoding="utf-8")
except OSError as exc:
self.save_error = _failed(exc)
return None
return path
+111
View File
@@ -0,0 +1,111 @@
"""A popup opened the way a page opens one, and what it reads of its own window.
Shared by `test_popup_geometry_is_the_declared_frame_e2e.py` and by the inner-size test of
`test_fingerprint_surface.py`: both need a popup (`window.open` with features, from a click) whose document may carry an
iframe of another site (so, under Fission, in another process), and both read the window geometry from inside it.
The popup is read with a CONDITION, not a pause: the reading is repeated (with the client's events being read between two
looks) until the caller's `ready` holds or 30 s have passed, and the last reading is returned either way, so the caller's
assertion names what was read when it never settled.
"""
from __future__ import annotations
import threading
from typing import Any, Callable, Dict, Optional
from _fission_frames import Sites, wait_frame
from _waits import wait_until
#: The scale at which the declared window frame is the one of `WINDOW_FRAME_BY_DPR[1.0]`: border 8, popup UI 72, default
#: position 4 (device pixels, and CSS pixels at 1.0). The screen is the one the other surface tests pin.
PIN = {"screen.width": 1920, "screen.height": 1080, "screen.dpr": 1.0}
#: A second declared window frame that no runner has: a border of 6 and a popup UI of 53 above the content. The declared frame at scale 1.0 (8, 72) is the frame
#: of a retail Windows window, so a Windows runner's own popup has it too (outer - inner = 16 x 80) and a launch with the engine off cannot tell the declaration from
#: the host there; a launch declared with ANOTHER frame can (the prefs are applied last, over the core's declaration). The position of an unpositioned popup is not
#: declared: it is Firefox's own rule (browser.xhtml screenX/screenY = 4, the stagger, the clamp), the same under every frame.
OTHER_FRAME = {"zoom.stealth.screen.frame_border": 6, "zoom.stealth.screen.popup_ui": 53}
OTHER_BORDER, OTHER_POPUP_UI = 6, 53
READ = """() => ({iw: innerWidth, ih: innerHeight, ow: outerWidth, oh: outerHeight,
sx: screenX, sy: screenY, mx: mozInnerScreenX, my: mozInnerScreenY})"""
def in_a_thread_of_its_own(fn: Callable[[], Any], timeout: float = 300) -> Any:
"""Runs `fn` in a thread with no asyncio loop and gives back its result or raises its error.
For a module whose own fixture keeps a sync client open for the whole module: an open sync client leaves its loop marked as
running in its thread, and a second sync client started in that thread refuses with "Playwright Sync API inside the asyncio
loop". The second browser needs a thread of its own.
"""
box: Dict[str, Any] = {}
def run() -> None:
try:
box["value"] = fn()
except BaseException as exc: # handed back to the test's thread below
box["error"] = exc
worker = threading.Thread(target=run, name="second-sync-client", daemon=True)
worker.start()
worker.join(timeout)
if worker.is_alive():
raise AssertionError("the browser of the test did not end within %d s" % timeout)
if "error" in box:
raise box["error"]
return box.get("value")
def frame_of_the_declaration():
"""The window frame the core declares at scale 1.0: what the engine adds to a popup's inner size."""
from invisible_core.constants import WINDOW_FRAME_BY_DPR
return WINDOW_FRAME_BY_DPR[1.0]
def frame_extra(border: int, popup_ui: int):
"""What a popup adds to its inner size: (outer - inner) wide and high, for a border and a popup UI."""
return (2 * border, popup_ui + border)
def _plausible(reading: Dict[str, Any]) -> bool:
"""Every size of every window read is above 0: the window (and its frame, if any) has been laid out."""
return all(r["iw"] > 0 and r["ih"] > 0 and r["ow"] > 0 and r["oh"] > 0
for r in (reading["popup"], reading["frame"]) if r is not None)
def read_popup(binary: str, extra_prefs: Optional[Dict[str, Any]] = None, iframe: bool = False,
ready: Optional[Callable[[Dict[str, Any]], bool]] = None,
features: str = "width=500,height=400") -> Dict[str, Any]:
"""Open `window.open(url, 'p', features)` (default `width=500,height=400`) from a click and read it.
Returns `{"popup": {...}, "frame": {...} or None}` with `iw ih ow oh sx sy mx my` (innerWidth, innerHeight,
outerWidth, outerHeight, screenX, screenY, mozInnerScreenX, mozInnerScreenY) of the popup and, with `iframe`, of its
iframe (another site, 200x150). `ready(reading)` says when the reading has settled (default: every size above 0).
"""
from invisible_playwright import InvisiblePlaywright
with Sites() as s:
s.route("A", "/main", "<!doctype html><title>main</title><button id='open' onclick=\"window.open('%s', 'p', "
"'%s')\">open</button>" % (s.url("A", "/popup"), features))
frame_html = ("<iframe id='f' src='%s' style='position:absolute;left:0;top:0;width:200px;height:150px;border:0'>"
"</iframe>" % s.url("B", "/frame")) if iframe else ""
s.route("A", "/popup", "<!doctype html><title>popup</title>" + frame_html)
s.route("B", "/frame", "<!doctype html><title>frame</title>")
with InvisiblePlaywright(seed=42, pin=PIN, binary_path=binary, headless=True, humanize=False,
extra_prefs=extra_prefs) as browser:
page = browser.new_page()
page.goto(s.url("A", "/main"), wait_until="load", timeout=30000)
with page.expect_popup(timeout=30000) as info:
page.click("#open", timeout=30000)
popup = info.value
popup.wait_for_load_state("load", timeout=30000)
frame = wait_frame(popup, s.origin["B"], "/frame", seconds=30) if iframe else None
seen: Dict[str, Any] = {}
def settled() -> bool:
seen["now"] = {"popup": popup.evaluate(READ), "frame": frame.evaluate(READ) if frame else None}
return _plausible(seen["now"]) and (ready is None or bool(ready(seen["now"])))
wait_until(settled, 30, lambda: popup.wait_for_timeout(100))
return seen["now"]
+232
View File
@@ -0,0 +1,232 @@
"""A sampler of the processes below a pid, from before a launch to after it, and what proves it missed none: the e2e of the host GL probe.
Firefox on Linux probes the host's GL in a child of the parent: ``<GRE>/gfxtest glx -f <fd>`` (``GfxInfo::FireGLXTestProcess``, widget/gtk/GfxInfo.cpp;
Mozilla's code and logs call it ``glxtest``, the binary is ``gfxtest`` and ``glx`` is the probe it runs). It lives as long as it takes to load the host's GL,
answer through the pipe and be reaped by the parent, and a poll of the process tree can fall between two of its samples. So the sampler alone never says
"absent". The complete list is the kernel's: under the strace stand-in (``tests/_strace_stand_in.py``) every ``execve`` of every process of the browser's tree is
written to the log, because ptrace stops the process AT the call and it cannot run past it unseen. Every exec of a probe in that log must have been seen by
the sampler too (same pid, named as a probe), and the sampler must have run from before the launch to after the page had its WebGL context. A probe that
strace saw and the sampler did not, a sampler that did not cover the launch, a log that does not hold the browser's own exec, or a sampler that died on an
error is a PROBLEM that ``reconcile`` returns, and a test that asserts ``problems == []`` first is red then: a miss is reported, never read as "no probe".
``TreeSampler`` takes ``read`` (``root -> {pid: (name, ppid, cmdline)}``, psutil by default) and ``clock``, so the unit tests drive it with a fake tree and a
counter (tests/test_the_process_sampler_cannot_miss_a_short_lived_probe.py). No browser here.
"""
from __future__ import annotations
import os
import re
import threading
import time
from dataclasses import dataclass, field
from typing import Callable, Dict, Iterable, List, Optional, Tuple
#: The names of the probe's executable: ``gfxtest`` since Mozilla merged its probes into one binary, ``glxtest`` before.
PROBE_NAMES = ("gfxtest", "glxtest")
#: What strace has to write for ``read_witness``: the execs, and the clones that make the tree.
TRACE = "execve,clone,clone3,fork,vfork"
Tree = Dict[int, Tuple[str, Optional[int], List[str]]]
@dataclass
class Seen:
"""A process the sampler saw: every name and command line it had (a child is first seen before its exec, with its parent's name), its parent, and the
clock at the first and the last sample that held it."""
pid: int
ppid: Optional[int]
names: List[str]
cmds: List[List[str]]
first: float
last: float
def is_probe(self) -> bool:
return any(n in PROBE_NAMES for n in self.names) or any(c and os.path.basename(c[0]) in PROBE_NAMES for c in self.cmds)
def psutil_tree(root: int) -> Tree:
"""``{pid: (name, ppid, cmdline)}`` of every process below ``root`` now. A zombie keeps its name and parent and has no command line."""
import psutil
out: Tree = {}
try:
children = psutil.Process(root).children(recursive=True)
except psutil.Error:
return out
for proc in children:
try:
with proc.oneshot():
name, ppid = proc.name(), proc.ppid()
try:
cmd = proc.cmdline()
except psutil.Error:
cmd = []
except psutil.Error:
continue
out[proc.pid] = (name, ppid, list(cmd))
return out
class TreeSampler:
"""Samples the tree below ``root`` in a thread, as fast as it can (a step of ``step`` seconds between two reads, so the test's own client keeps the
interpreter), from ``start`` to ``stop``. ``start`` takes the first sample before it returns and ``stop`` takes a last one after the thread has ended,
so what happens between the two calls is inside the samples. ``first_sample`` is the clock when the first read ENDED, ``last_sample`` the clock when
the last read BEGAN: the window the sampler covers."""
def __init__(self, root: int, read: Callable[[int], Tree] = psutil_tree, clock: Callable[[], float] = time.monotonic, step: float = 0.001) -> None:
self.root = root
self._read = read
self._clock = clock
self._step = step
self.seen: Dict[int, Seen] = {}
self.samples = 0
self.first_sample: Optional[float] = None
self.last_sample: Optional[float] = None
self.error: Optional[BaseException] = None
self._stopped = threading.Event()
self._lock = threading.Lock()
self._thread: Optional[threading.Thread] = None
def start(self) -> "TreeSampler":
self._sample()
self._thread = threading.Thread(target=self._poll, name="tree-sampler", daemon=True)
self._thread.start()
return self
def stop(self) -> None:
self._stopped.set()
if self._thread is not None:
self._thread.join()
if self.error is None:
self._sample()
def _poll(self) -> None:
try:
while not self._stopped.is_set():
self._sample()
self._stopped.wait(self._step)
except BaseException as exc: # the verdict reports it: a sampler that died covered nothing after it
self.error = exc
def _sample(self) -> None:
began = self._clock()
tree = self._read(self.root)
ended = self._clock()
with self._lock:
for pid, (name, ppid, cmd) in tree.items():
seen = self.seen.get(pid)
if seen is None:
self.seen[pid] = Seen(pid, ppid, [name] if name else [], [list(cmd)] if cmd else [], began, began)
continue
seen.last = began
if name and name not in seen.names:
seen.names.append(name)
if cmd and list(cmd) not in seen.cmds:
seen.cmds.append(list(cmd))
if self.first_sample is None:
self.first_sample = ended
self.last_sample = began
self.samples += 1
def view(self) -> Tuple[Dict[int, Seen], Optional[float], Optional[float], Optional[BaseException]]:
with self._lock:
return dict(self.seen), self.first_sample, self.last_sample, self.error
# --------------------------------------------------------------------------------------------------------------------------------- the witness: strace
@dataclass
class Exec:
"""One ``execve`` of the strace log: the pid, the path, the arguments, and the result (``None`` when the log ends before it)."""
pid: int
path: str
argv: List[str] = field(default_factory=list)
result: Optional[int] = None
def ran(self) -> bool:
"""The exec replaced the process (0), or the log stops before saying (counted as run: it can only make a test red)."""
return self.result is None or self.result == 0
_EXECVE = re.compile(r'^(\d+)\s+execve\("((?:[^"\\]|\\.)*)",\s*\[(.*?)\]')
_RESUMED_EXECVE = re.compile(r"^(\d+)\s+<\.\.\. execve resumed>")
_RESULT = re.compile(r"\)\s+=\s+(-?\d+)")
_QUOTED = re.compile(r'"((?:[^"\\]|\\.)*)"')
def read_execs(lines: Iterable[str]) -> List[Exec]:
"""Every ``execve`` of a ``strace -f`` log (no timestamps), with its result: on its line, or on the ``<... execve resumed>`` line of its pid when
another thread interrupted it."""
out: List[Exec] = []
pending: Dict[int, Exec] = {}
for line in lines:
m = _EXECVE.match(line)
if m:
found = Exec(int(m.group(1)), m.group(2), _QUOTED.findall(m.group(3)))
out.append(found)
if "<unfinished ...>" in line:
pending[found.pid] = found
else:
r = _RESULT.search(line[m.end():])
found.result = int(r.group(1)) if r else None
continue
m = _RESUMED_EXECVE.match(line)
if m and int(m.group(1)) in pending:
r = _RESULT.search(line)
pending.pop(int(m.group(1))).result = int(r.group(1)) if r else None
return out
def is_probe_exec(found: Exec) -> bool:
return os.path.basename(found.path) in PROBE_NAMES
def is_glx_probe(found: Exec) -> bool:
"""The GLX probe: the probe's executable with ``glx`` as its command (``gfxtest glx -f <fd>``; ``vaapi``, ``v4l2`` and ``vulkan`` are other probes)."""
return is_probe_exec(found) and found.argv[1:2] == ["glx"]
def browser_parents(execs: Iterable[Exec], real_binary: str) -> List[int]:
"""The pids that executed the browser itself (the real binary, not a content process): the parent the probe is a child of."""
return [e.pid for e in execs if e.ran() and e.path == real_binary and "-contentproc" not in e.argv]
def reconcile(seen: Dict[int, Seen], first_sample: Optional[float], last_sample: Optional[float], error: Optional[BaseException],
execs: List[Exec], real_binary: str, launched_at: float, ready_at: Optional[float]) -> Tuple[List[Exec], List[str]]:
"""``(probes, problems)``: the execs of a probe that ran, and every reason the observation cannot be trusted. ``problems`` is empty only when strace
saw the browser start, the sampler ran from before ``launched_at`` to after ``ready_at`` (the page has its WebGL context), and every probe strace saw
the kernel exec was seen by the sampler under the same pid as a probe, and the other way round."""
problems = []
if error is not None:
problems.append("the sampler stopped on an error: %r" % (error,))
if first_sample is None or first_sample > launched_at:
problems.append("the sampler's first sample (%s) is not before the launch (%s): what the launch started first is not in it" % (first_sample, launched_at))
if ready_at is None:
problems.append("the page never had its WebGL context: the window of the launch has no end")
elif last_sample is None or last_sample < ready_at:
problems.append("the sampler's last sample (%s) is before the page had its WebGL context (%s): it stopped early" % (last_sample, ready_at))
if not browser_parents(execs, real_binary):
problems.append("strace wrote no execve of the browser (%s): the witness is empty, and an empty witness proves no absence" % real_binary)
probes = [e for e in execs if is_probe_exec(e) and e.ran()]
for e in probes:
s = seen.get(e.pid)
if s is None or not s.is_probe():
problems.append("strace saw pid %d exec %s and the sampler %s: the sampler missed a probe"
% (e.pid, " ".join(e.argv[:3]) or e.path, "never saw the pid" if s is None else "saw it only as %s" % (s.names or s.cmds)))
witnessed = {e.pid for e in probes}
for s in seen.values():
if s.is_probe() and s.pid not in witnessed:
problems.append("the sampler saw a probe (pid %d, %s) that strace never saw exec: the two do not watch the same tree" % (s.pid, s.names))
return probes, problems
def describe(seen: Dict[int, Seen], execs: List[Exec], origin: float) -> str:
"""Every process the sampler saw (seconds from ``origin``, names, pid, ppid, head of the command line) and every exec strace wrote."""
rows = ["processes seen below the test (first..last sample, from the launch):"]
for s in sorted(seen.values(), key=lambda s: (s.first, s.pid)):
head = " ".join(a[:80] for a in (s.cmds[-1] if s.cmds else [])[:4])
rows.append(" +%.3fs..+%.3fs pid=%d ppid=%s names=%s cmd=%s" % (s.first - origin, s.last - origin, s.pid, s.ppid, "/".join(s.names), head))
rows.append("execs strace wrote:")
for e in execs:
rows.append(" pid=%d result=%s %s" % (e.pid, e.result, " ".join(a[:80] for a in e.argv[:4]) or e.path))
return "\n".join(rows)
+105 -6
View File
@@ -21,10 +21,20 @@ test-only: the product never sets it) a content process that hosts a site is nam
The process gets its name before any document loads in it, so when a page of the site has run, its process already
answers to the site. Windows names no process (ProcessUtils_none.cpp): a test that looks at sites skips there and
says so.
Windows names no process, but the engine's own log names the type of every process it creates (`Setting remoteType of
process <pid> to <type>` when a process is born with its type, `Changing remoteType of process <pid> from prealloc to
<type>` when a spare one is given its site: `dom/ipc/ContentChild.cpp`, `RecvSetRemoteType`, log module `Process`). The
type of a process that hosts a site is `webIsolated=<site>^<attributes>` (`dom/ipc/RemoteType.cpp`, `Stringify`), the
same site the Linux name carries, and the process gets it before any document loads in it. So on Windows a test starts the
engine with `LOG_ENV` and a file base (`MOZ_LOG_FILE`), and `remote_types(base)` reads which type each process was given (by pid and time, a pid being reused);
liveness and the engine's own directory are still told by the process tree, so a process that has ended is not counted.
"""
from __future__ import annotations
import calendar
import os
import re
import sys
import pytest
@@ -57,9 +67,94 @@ def hosts_site(name, site):
return len(prefix) >= NAME_LENGTH or name[len(prefix)] == "^"
#: The environment that makes the engine write the type of each process it creates (`MOZ_LOG_FILE` is added by the
#: test: a file base in its own temporary folder). Used where the system names no process (Windows).
LOG_ENV = {"MOZ_LOG": "Process:5,timestamp,sync"}
_TYPE_GIVEN = re.compile(r"(?:Setting remoteType of process (\d+) to|Changing remoteType of process (\d+) from \S+ to) (\S+)")
#: The start of a line of `MOZ_LOG` with the `timestamp` option: `2026-11-22 10:11:12.123456 UTC - [Process 12: Thread]: ...`.
_LOG_TIME = re.compile(r"^(\d{4})-(\d\d)-(\d\d) (\d\d):(\d\d):(\d\d)\.(\d{6}) UTC - ")
#: How much earlier than the creation time of a process (psutil) its first log line may be stamped: the two clocks are
#: read at different moments of its birth.
BIRTH_SLACK = 0.25
def _natural(path):
"""The sort key that puts `base.child-2` before `base.child-10` (the plain order of names puts it after)."""
return [int(part) if part.isdigit() else part for part in re.split(r"(\d+)", path.name)]
def _stamp(line):
"""The time of a log line in seconds since the epoch (UTC), or None when the line carries no timestamp."""
match = _LOG_TIME.match(line)
if match is None:
return None
year, month, day, hour, minute, second, micro = (int(g) for g in match.groups())
return calendar.timegm((year, month, day, hour, minute, second)) + micro / 1e6
def remote_types(base):
"""`{pid: [(time, remote type), ...]}` of the processes the engine has logged to the files that start with the path
`base` (`MOZ_LOG_FILE`: the parent writes `base`, each child its own `base.child-N`), each list in the order of the
time the lines were logged (then the child number as a number, then the line). A pid alone does not name a process:
the system gives the number of an ended process to a later one, and a later process of another site must not
inherit the type of the old one. So the types stay stamped, and `type_of_process` chooses the ones of the process
instance in hand. A process that logs twice (a spare one, then the site it is given) has two entries, the last wins."""
entries = {}
for order, path in enumerate(sorted(base.parent.glob(base.name + "*"), key=_natural)):
for number, line in enumerate(path.read_text(encoding="utf-8", errors="replace").splitlines()):
match = _TYPE_GIVEN.search(line)
if match is None:
continue
stamp = _stamp(line)
key = (stamp if stamp is not None else float("-inf"), order, number)
entries.setdefault(int(match.group(1) or match.group(2)), []).append((key, stamp, match.group(3)))
return {pid: [(stamp, remote_type) for _key, stamp, remote_type in sorted(found, key=lambda entry: entry[0])]
for pid, found in entries.items()}
def type_of_process(types, pid, created):
"""The remote type the process `pid` born at `created` (epoch seconds, `psutil.Process.create_time()`) was given: the
last one logged for the pid at or after its birth (less `BIRTH_SLACK`). Entries logged before the process existed
are the ones of an earlier process that had the same pid, and are ignored. A line with no timestamp counts for any
birth. `""` when the process has not logged its type yet."""
chosen = ""
for stamp, remote_type in types.get(pid, ()):
if stamp is None or stamp >= created - BIRTH_SLACK:
chosen = remote_type
return chosen
def hosts_site_by_type(remote_type, site):
"""True when a process of the remote type `remote_type` hosts `site` (`http://a.test`): `<kind>=<site>` or
`<kind>=<site>^<attributes>`. A process with no site (`web`, `prealloc`, `privilegedabout`, `extension`) has no `=`."""
meta = remote_type.partition("=")[2]
return meta == site or meta.startswith(site + "^")
def site_pids_by_type(processes, site, types, engine_dir=None):
"""Like `site_pids`, told by the remote types the engine logged (`remote_types`) instead of by the process name."""
return _content_pids(processes, engine_dir, lambda proc, _name: hosts_site_by_type(_type_of(types, proc), site))
def _type_of(types, proc):
import psutil
try:
return type_of_process(types, proc.pid, proc.create_time())
except psutil.Error:
return ""
def site_pids(processes, site, engine_dir=None):
"""The pids, among `processes` (psutil-like), of the content processes (`-contentproc ... tab`) that host `site`;
with `engine_dir`, only those of the engine in that directory."""
return _content_pids(processes, engine_dir, lambda _proc, name: hosts_site(name, site))
def _content_pids(processes, engine_dir, hosts):
import psutil
pids = set()
@@ -70,19 +165,23 @@ def site_pids(processes, site, engine_dir=None):
name, cmd = proc.name(), proc.cmdline()
except psutil.Error:
continue
if "-contentproc" in cmd and cmd and cmd[-1] == "tab" and hosts_site(name, site):
if "-contentproc" in cmd and cmd and cmd[-1] == "tab" and hosts(proc, name):
pids.add(proc.pid)
return pids
def site_processes_below(root_pid, site, engine_dir=None):
"""The pids of the processes below `root_pid` that host `site`. Off Linux the test skips: no name says it."""
def site_processes_below(root_pid, site, engine_dir=None, types=None):
"""The pids of the processes below `root_pid` that host `site`. On Linux the name of the process says it; on Windows
`types` (a function that returns `remote_types(base)` of the engine's log, see `LOG_ENV`) does. With neither, the test
skips: no name says it."""
import psutil
if not sys.platform.startswith("linux"):
pytest.skip("only Linux names a content process by the site it hosts; %s names none" % sys.platform)
if not sys.platform.startswith("linux") and types is None:
pytest.skip("only Linux names a content process by the site it hosts; %s names none (pass `types`)" % sys.platform)
try:
children = psutil.Process(root_pid).children(recursive=True)
except psutil.Error:
return set()
return site_pids(children, site, engine_dir)
if sys.platform.startswith("linux"):
return site_pids(children, site, engine_dir)
return site_pids_by_type(children, site, types(), engine_dir)
+319
View File
@@ -0,0 +1,319 @@
"""The retail reference of the chrome-scope twins: RETAIL Firefox 159, driven by Marionette alone (no Playwright), headed on a display of its own (the wrapper's mechanism); and one driver for it and for ours.
Playwright's own Firefox is not a reference for the popups the browser chrome opens (a select dropdown, a tooltip): nothing says its build takes ``-marionette``, and it is not the
browser a user runs. The reference of these twins is the official retail build, the one the capture rounds of RetailCaptures measured. The chrome-scope relations (the popup against its
element, the tooltip against the pointer) are read in the same way on both sides, from chrome scope through Marionette; the page and its input are driven by one small interface (``Driver``):
``goto``, ``eval`` (a JavaScript expression of the top document, as JSON), ``move``, ``click`` (the point of the top document, CSS pixels), ``wait_for_timeout`` and ``chrome``.
WHERE THE RETAIL BINARY COMES FROM. The file named by the environment variable ``INVPW_RETAIL_FIREFOX`` (the path of ``firefox.exe`` on Windows, of ``firefox`` on Linux, where the reference is Mozilla's own Linux 159 build, fetched and verified the same way
and extracted to ``<work>/extracted/firefox/firefox``): a missing variable or file is RED ("MISSING REFERENCE, reference unavailable"), never a skip. The launcher is the same on both: no ``.exe``, the display is one of its own, made as the wrapper makes ours (``_stock_twin.OwnDisplay``: ``make_virtual_display()``, an Xvfb on Linux, the desktop of the job on Windows), not the job's: the rows run pytest without xvfb-run.
The legs of the rows ``wrapper.e2e.stock_twin.select`` and ``wrapper.e2e.stock_twin.tooltip`` put it there with the mechanism the retail captures already use, in the repository oss-invisible/core: ``scripts/retail/firefox_build.py fetch
--version 159.0 --work DIR`` (it downloads ``Firefox Setup 159.0.exe`` and SHA256SUMS and SHA256SUMS.asc from archive.mozilla.org, checks the signature against the release key committed in
``captures/runner/``, checks the installer's sha256 against SHA256SUMS, extracts it with 7z and writes DIR/build.json with the path of firefox.exe).
HOW IT IS LAUNCHED (what ``scripts/retail/window_geometry/run_scale.py`` does for the captures): ``firefox -no-remote -profile <empty directory> -marionette``, with ``-remote-allow-system-access`` for the
chrome scope; the profile holds only ``user.js`` with ``marionette.port`` 0 (a free port, written to ``MarionetteActivePort``) and ``layout.css.devPixelsPerPx`` (the display scale of the case, the pref
ours and stock are launched with), and the prefs that stop the first-run pages. No policy file. The browser is closed with its whole tree when the block ends.
"""
from __future__ import annotations
import json
import os
import shutil
import subprocess
import tempfile
import time
from pathlib import Path
from typing import Any, Callable, Dict, Optional, Tuple
from _stock_twin import MARIONETTE_ARGS, SCALES_JS, BrokenControl, Chrome, OwnDisplay
from _waits import wait_until
from _window_origin import CASES, DEADLINE_S, launch_case
ENV_VARIABLE = "INVPW_RETAIL_FIREFOX"
#: What the profile of the retail browser holds besides the two prefs of the case: the first-run pages and the updater are off, nothing else.
PROFILE_PREFS = {
"marionette.port": 0,
"browser.shell.checkDefaultBrowser": False,
"browser.aboutwelcome.enabled": False,
"browser.startup.page": 0,
"browser.startup.homepage": "about:blank",
"startup.homepage_welcome_url": "",
"startup.homepage_override_url": "",
"browser.startup.homepage_override.mstone": "ignore",
"datareporting.policy.dataSubmissionPolicyBypassNotification": True,
"toolkit.telemetry.reportingpolicy.firstRun": False,
"app.update.auto": False,
"app.update.checkInstallTime": False,
"browser.tabs.warnOnClose": False,
}
PAGE_SCALES_EXPR = "({devicePixelRatio: window.devicePixelRatio, inner: [innerWidth, innerHeight], screen: [screen.width, screen.height]})"
class MissingReference(AssertionError):
"""No retail binary to compare with: red, and no finding about ours."""
def retail_executable() -> str:
path = os.environ.get(ENV_VARIABLE, "")
if not path or not Path(path).is_file():
raise MissingReference("MISSING REFERENCE, no finding about ours: %s names no retail Firefox 159 (%r). The leg of the rows wrapper.e2e.stock_twin.select and wrapper.e2e.stock_twin.tooltip installs it with "
"oss-invisible/core scripts/retail/firefox_build.py fetch --version 159.0 and sets the variable to the path of firefox.exe" % (ENV_VARIABLE, path))
return path
def _user_js(prefs: Dict[str, Any]) -> str:
return "".join("user_pref(%s, %s);\n" % (json.dumps(name), json.dumps(value)) for name, value in sorted(prefs.items()))
class Driver:
"""What a twin does with a page, on any browser. ``chrome.script(js, args)`` is chrome scope through Marionette."""
chrome: Any
#: Which browser this is, in the names of a record and of its evidence file.
kind = "driver"
#: The last ``click``, as the driver sent it: ``{"point": [x, y], "unit": ..., "device": [x, y]}`` (None before the first click).
last_click: Optional[Dict[str, Any]] = None
def goto(self, url: str) -> None:
raise NotImplementedError
def eval(self, expression: str) -> Any:
"""The value of a JavaScript expression in the top document (a JSON-able value)."""
raise NotImplementedError
def eval_in_frame(self, expression: str) -> Any:
"""The value of a JavaScript expression in the document of the first frame of the top document (a JSON-able value)."""
raise NotImplementedError
def move(self, x: float, y: float, steps: int = 1) -> None:
raise NotImplementedError
def click(self, x: float, y: float) -> None:
raise NotImplementedError
def wait_for_timeout(self, ms: int) -> None:
raise NotImplementedError
def scales(self) -> Dict[str, Any]:
"""The record of the scales: the page's (declared) and the chrome's, with the real ones of the screen."""
out = {"page": self.eval(PAGE_SCALES_EXPR)}
out.update(self.chrome.script(SCALES_JS))
return out
class PlaywrightDriver(Driver):
"""Ours: a page of the wrapper's client, and the chrome of the engine through Marionette."""
kind = "ours"
def __init__(self, page, chrome: Chrome) -> None:
self.page, self.chrome = page, chrome
def goto(self, url: str) -> None:
self.page.goto(url, wait_until="load", timeout=30000)
def eval(self, expression: str) -> Any:
return self.page.evaluate("() => (%s)" % expression)
def eval_in_frame(self, expression: str) -> Any:
frames = [frame for frame in self.page.frames if frame != self.page.main_frame]
return frames[0].evaluate("() => (%s)" % expression)
def move(self, x: float, y: float, steps: int = 1) -> None:
self.page.mouse.move(x, y, steps=steps)
def click(self, x: float, y: float) -> None:
# the client sends the point in CSS pixels of the page; the device point is that times the page's (declared) scale
try:
scale = self.page.evaluate("() => window.devicePixelRatio")
device: Optional[list] = [x * scale, y * scale]
except Exception: # noqa: BLE001 a record of the click never stops the click
device = None
self.last_click = {"point": [x, y], "unit": "CSS pixels of the page, as page.mouse.click sends them", "device": device}
self.page.mouse.click(x, y)
def wait_for_timeout(self, ms: int) -> None:
self.page.wait_for_timeout(ms)
class RetailChrome:
def __init__(self, session: "RetailSession") -> None:
self._session = session
def script(self, script: str, args: Tuple[Any, ...] = ()) -> Dict[str, Any]:
return json.loads(self._session.call("chrome", "WebDriver:ExecuteScript", {"script": script, "args": list(args)})["value"])
#: Moves and presses at a point of the browser's content, from chrome, through the widget: a point of the top document (CSS pixels) plus the content area's own place in the window. Firefox 159's chrome
#: input is ``Window.synthesizeMouseEvent`` (offsets in CSS pixels of that window, a dictionary of Mozilla's fields for the event and one for the options); ``nsIDOMWindowUtils`` has no ``sendMouseEvent``
#: in 159 (tests/test_the_chrome_calls_of_the_tests_exist_in_firefox.py reads the names from Mozilla's sources). ``inputSource: 1`` is a mouse, as a user's.
#: ``isAsyncEnabled: true`` is the field of Mozilla's SynthesizeMouseEventOptions that Mozilla's own EventUtils.js sets when a test asks for ``asyncEnabled`` (EventUtils.js, synthesizeMouse, around
#: lines 784-851, passes it as ``isAsyncEnabled``). Without it (the webidl default is false) nsContentUtils::SendMouseEvent dispatches through ``widget->DispatchEvent`` and never through APZ
#: (nsContentUtils.cpp 10552-10560 at FIREFOX_159_0_RELEASE), the event has no valid layers id, and EventStateManager::DispatchCrossProcessEvent falls back to the TOP process
#: (EventStateManager.cpp 2199): a frame in another process never gets the move or the click, and the tooltip and the select of that frame fail on retail for a reason that is the driver's.
SEND_JS = """
const [type, x, y, button, clicks] = arguments;
const win = Services.wm.getMostRecentWindow("navigator:browser");
const b = win.gBrowser.selectedBrowser.getBoundingClientRect();
win.focus();
win.synthesizeMouseEvent(type, b.left + x, b.top + y, {button, clickCount: clicks, modifiers: 0, inputSource: 1}, {ignoreRootScrollFrame: false, isDOMEventSynthesized: true, isAsyncEnabled: true});
return JSON.stringify({ok: true, at: [b.left + x, b.top + y], dpr: win.devicePixelRatio});
"""
SIZE_JS = """
const win = Services.wm.getMostRecentWindow("navigator:browser");
return JSON.stringify({outer: [win.outerWidth, win.outerHeight], inner: [win.innerWidth, win.innerHeight]});
"""
class RetailSession:
"""Retail Firefox 159 with Marionette, headed, one profile; closed with its whole tree."""
def __init__(self, executable: str, dpr: float) -> None:
self.executable, self.dpr = executable, dpr
self._context: Optional[str] = None
self._process: Optional[subprocess.Popen] = None
self._profile: Optional[str] = None
self._marionette = None
self._display: Optional[OwnDisplay] = None
def __enter__(self) -> "RetailSession":
import webfont_probe
try:
self._profile = tempfile.mkdtemp(prefix="invpw-retail-")
prefs = dict(PROFILE_PREFS)
prefs["layout.css.devPixelsPerPx"] = str(self.dpr)
Path(self._profile, "user.js").write_text(_user_js(prefs), encoding="utf-8")
self._display = OwnDisplay().__enter__()
env = self._display.environ(dict(os.environ, MOZ_REMOTE_ALLOW_SYSTEM_ACCESS="1", MOZ_CRASHREPORTER_DISABLE="1"))
self._process = subprocess.Popen([self.executable, "-no-remote", "-profile", self._profile] + MARIONETTE_ARGS + ["about:blank"], env=env,
stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL)
port = webfont_probe.marionette_active_port(Path(self._profile), timeout=120)
self._marionette = webfont_probe._Marionette(port)
self._marionette.call("WebDriver:NewSession", {"capabilities": {"alwaysMatch": {}}})
except BaseException:
self.__exit__(None, None, None)
raise
return self
def call(self, context: str, command: str, params: Dict[str, Any]) -> Any:
if self._context != context:
self._marionette.call("Marionette:SetContext", {"value": context})
self._context = context
return self._marionette.call(command, params)
def set_window_size(self, outer: Tuple[float, float]) -> Dict[str, Any]:
"""Sets the window's outer size to ``outer`` (CSS pixels of the chrome), at the origin of the screen, and reads back the sizes the chrome window answers."""
self.call("content", "WebDriver:SetWindowRect", {"x": 0, "y": 0, "width": int(outer[0]), "height": int(outer[1])})
read = SIZE_JS
out: Dict[str, Any] = {}
for _ in range(int(DEADLINE_S * 10)):
out = json.loads(self.call("chrome", "WebDriver:ExecuteScript", {"script": read, "args": []})["value"])
if out["outer"] == [outer[0], outer[1]]:
break
time.sleep(0.1)
return out
def __exit__(self, *exc) -> None:
if self._marionette is not None:
self._marionette.close()
if self._process is not None:
try:
import psutil
root = psutil.Process(self._process.pid)
for child in root.children(recursive=True):
try:
child.kill()
except psutil.Error:
pass
root.kill()
except Exception: # the process is gone already
pass
try:
self._process.wait(30)
except Exception:
pass
if self._display is not None:
self._display.__exit__(None, None, None)
self._display = None
if self._profile is not None:
shutil.rmtree(self._profile, ignore_errors=True)
class RetailDriver(Driver):
kind = "retail"
def __init__(self, session: RetailSession) -> None:
self.session = session
self.chrome = RetailChrome(session)
def goto(self, url: str) -> None:
self.session.call("content", "WebDriver:Navigate", {"url": url})
wait_until(lambda: self.eval("document.readyState") == "complete", DEADLINE_S, lambda: self.wait_for_timeout(100))
def eval(self, expression: str) -> Any:
value = self.session.call("content", "WebDriver:ExecuteScript", {"script": "return JSON.stringify(%s);" % expression, "args": []})["value"]
return json.loads(value) if value is not None else None
def eval_in_frame(self, expression: str) -> Any:
"""Through Marionette: the first frame element becomes the context of the script, and the top document is the context again when the read ends."""
found = self.session.call("content", "WebDriver:FindElement", {"using": "css selector", "value": "iframe"})["value"]
self.session.call("content", "WebDriver:SwitchToFrame", {"id": found})
try:
value = self.session.call("content", "WebDriver:ExecuteScript", {"script": "return JSON.stringify(%s);" % expression, "args": []})["value"]
finally:
self.session.call("content", "WebDriver:SwitchToParentFrame", {})
return json.loads(value) if value is not None else None
def _send(self, kind: str, x: float, y: float, button: int = 0, clicks: int = 0) -> Dict[str, Any]:
return self.chrome.script(SEND_JS, (kind, x, y, button, clicks))
def move(self, x: float, y: float, steps: int = 1) -> None:
# the pointer comes to the point in ``steps`` moves from the last one it made (a move to the point it is on makes no event, as on every browser)
last = getattr(self, "_at", (x - 1, y - 1))
for i in range(1, steps + 1):
self._send("mousemove", last[0] + (x - last[0]) * i / steps, last[1] + (y - last[1]) * i / steps)
self._at = (x, y)
def click(self, x: float, y: float) -> None:
self.move(x, y)
down = self._send("mousedown", x, y, 0, 1)
self._send("mouseup", x, y, 0, 1)
# the point goes to the window's widget in CSS pixels of the chrome (the content area's place added); the device point is that times the chrome's scale
at, scale = down.get("at"), down.get("dpr")
self.last_click = {"point": at, "unit": "CSS pixels of the chrome window, as Window.synthesizeMouseEvent takes them",
"device": [at[0] * scale, at[1] * scale] if at and scale else None}
def wait_for_timeout(self, ms: int) -> None:
time.sleep(ms / 1000.0)
def run_retail_twin(case: str, firefox_binary: str, measure: Callable[[Driver], Dict[str, Any]]) -> Tuple[Dict[str, Any], Dict[str, Any]]:
"""(retail's record, ours): the same ``measure(driver)`` on our engine and on the retail reference, one browser at a time. Needs MOZ_REMOTE_ALLOW_SYSTEM_ACCESS=1 for ours.
Ours goes first, for its window: the retail window is given the SAME outer size as ours (the maximized window of the case's declared screen, as ``launch_case`` makes it, read from the
chrome window's ``outerWidth`` and ``outerHeight``), and the inner sizes both chrome windows answer are compared before anything is measured: when they differ the verdict is BROKEN CONTROL,
not a finding about ours. Both sizes are in each record (``scales.chrome_outer``, ``scales.chrome_inner``), with the size the retail window was asked (``scales.window_asked_outer``)."""
executable = retail_executable()
with launch_case(firefox_binary, case, extra_args=MARIONETTE_ARGS, extra_prefs={"marionette.port": 0}) as browser:
page = browser.new_page() # first: the window the session below waits for
chrome = Chrome(page)
try:
ours = measure(PlaywrightDriver(page, chrome))
finally:
chrome.close()
asked = ours["scales"]["chrome_outer"]
with RetailSession(executable, CASES[case][0]) as session:
got = session.set_window_size((asked[0], asked[1]))
if got.get("outer") != asked or got.get("inner") != ours["scales"]["chrome_inner"]:
raise BrokenControl("BROKEN CONTROL, no finding about ours: the retail window was asked the outer size of ours %r and answers outer %r and inner %r; ours has inner %r (case %s)"
% (asked, got.get("outer"), got.get("inner"), ours["scales"]["chrome_inner"], case))
retail = measure(RetailDriver(session))
retail["scales"]["window_asked_outer"] = asked
return retail, ours
+210 -24
View File
@@ -33,11 +33,23 @@ answer as the service; the plain-HTTP endpoint ``api.ipify.org:80`` is still
answered here for the tests that ask it), and the UDP exit is what the fake STUN server puts in its XOR-MAPPED-ADDRESS.
Both are chosen by the test (``tcp_exit`` and ``udp_exit`` arguments).
Any other CONNECT is really forwarded, and any other UDP datagram is really
forwarded to its destination and the reply wrapped back, so a page, or an echo
server on 127.0.0.1, can be reached through the gateway and the test can
observe which road its bytes took (:attr:`Gateway.connects`,
:attr:`Gateway.datagrams`).
HERMETIC: a gateway of this module carries a CONNECT or a datagram only to the LAB (:func:`is_lab_destination`: loopback, the
documentation ranges of RFC 5737 and RFC 3849 the tests use as lab exits and servers, the addresses of this host's own interfaces, where a server
of a test may stand, and the name ``localhost``). These tests run in the gate of the candidate, where no test may depend on a real service, and the
browser behind a gateway makes background requests of its own (a name of the vendor, a captive-portal check, a telemetry endpoint): such a
destination is REFUSED, never forwarded (a CONNECT is answered with reply 2, "not allowed"; a datagram is dropped), and RECORDED
(:class:`LabGuard`: the time since the gateway started, the SOCKS5 address type, the destination as it was received - the NAME for type 3 -, the
port, the protocol, ``tcp`` or ``udp``, and the REASON: which rule refused it, the lab's or the narrower one of a subclass). The interfaces of this
host are read ONCE, when the guard is made (``psutil.net_if_addrs``, written once in the record with how they were read), and every decision of that
guard is taken against that reading: a browser that retries a refused destination hundreds of times costs a list append each, not a reading of the
host; a reading that fails RAISES (``_witness.HostInterfacesUnreadable``), it is never an empty list. The record is always written, when the gateway is closed, under
``$RUNNER_TEMP/invpw-evidence/<gateway>/<pid>-<ms>/refused-destinations.json`` (the folder the e2e jobs upload; off a runner nothing is
written), so that a reader sees what the browser asked for besides what the test drives. There is no option that reopens it. A subclass can only
narrow it (:meth:`Gateway._admits`); the destinations it serves itself (the fake STUN server, the page of ``WEB_NAME``, the exit questions) are
answered before it, and a name mapped to a local server by :meth:`Gateway._target` is judged by the server it maps to. What a test sees of the
road is :attr:`Gateway.connects`, :attr:`Gateway.datagrams` (every datagram the relay read, carried or dropped) and
:attr:`Gateway.guard`. :class:`Socks5TcpOnly` and the SOCKS5 server of ``test_proxy_socks_auth_e2e.py`` are hermetic the same way (same rule,
same record).
This is the ONE SOCKS5 gateway of the test suite. A road that needs more than the three above (a TURN server, a resolver,
a page, by NAME: ``tests/_turn_chain.py``) subclasses :class:`Gateway` and overrides the small hooks (:meth:`Gateway._route`,
@@ -46,7 +58,10 @@ ASSOCIATE, the relay or the round trip.
"""
from __future__ import annotations
import ipaddress
import json
import os
import pathlib
import select
import socket
import struct
@@ -55,7 +70,7 @@ import time
from typing import Callable, Dict, List, Optional, Set, Tuple
#: The name the product's STUN probe sends through the relay. The relay maps it
#: to the fake STUN server; every other destination is forwarded for real.
#: to the fake STUN server; every other destination is the lab's to carry or is refused (``LabGuard``).
STUN_NAME = "stun.l.google.com"
STUN_PORT = 19302
#: The same STUN server by NUMBER. A page cannot resolve a name behind the session (the engine forbids local
@@ -79,19 +94,18 @@ _MAGIC = b"\x21\x12\xa4\x42"
# ----------------------------------------------------------------------------------------------------------------
# The exit of a proxy that forwards for real. The question "where do I leave from" is HTTPS (api.ipify.org:443), and no gateway
# of the tests can answer a TLS request as the service: a proxy that FORWARDS (a CONNECT to anything outside loopback goes out for
# real) would carry it to the internet, and the answer would be the address of whatever machine runs the test (a GitHub runner
# that changes NAT in the middle of a session: ``ProxyEgressDrifted``). So such a proxy DECLARES its exit (``declare_exit``) and
# ``tests/_lab_egress.DeclaredExit`` answers the question with it; and as a backstop each of them refuses to forward the question
# (``asks_the_world``), which records it and makes the test fail (``nobody_asked_the_world``), so that a proxy that forgot to declare
# is a red with its name and not a flaky green.
# The exit of a proxy that relays CONNECTs. The question "where do I leave from" is HTTPS (api.ipify.org:443), and no gateway
# of the tests can answer a TLS request as the service. A gateway of this module is hermetic (a CONNECT outside the lab is refused, see
# ``LabGuard``), so the question could not reach the internet through it anyway; but the product would then be told no exit at all. So such a
# proxy DECLARES its exit (``declare_exit``) and ``tests/_lab_egress.DeclaredExit`` answers the question with it; and as a backstop each of
# them refuses the question itself (``asks_the_world``), which records it and makes the test fail (``nobody_asked_the_world``), so that a
# proxy that forgot to declare is a red with its name and not a flaky green.
# ----------------------------------------------------------------------------------------------------------------
#: The hosts of the services of the core that tell a caller its address (``invisible_core._geo._IP_ECHO_ENDPOINTS`` and
#: ``_IPV6_ECHO_ENDPOINTS``; ``tests/test_a_launch_asks_nobody_on_the_internet_where_it_leaves_from.py`` checks that this list covers them).
EXIT_SERVICES = ("api.ipify.org", "api6.ipify.org", "icanhazip.com", "ipv6.icanhazip.com", "checkip.amazonaws.com", "ifconfig.me")
#: ``host:port`` of a proxy of the tests that forwards for real -> the exit it declares. Filled by the proxies themselves.
#: ``host:port`` of a proxy of the tests that relays CONNECTs -> the exit it declares. Filled by the proxies themselves.
_DECLARED_EXITS: Dict[str, str] = {}
#: The questions of the exit that reached a forwarding proxy and were refused there: one sentence each, until a test reads them.
_WORLD_QUESTIONS: List[str] = []
@@ -103,7 +117,7 @@ def _endpoint(server: str) -> str:
def declare_exit(server: str, exit_ip: str) -> None:
"""The proxy at ``server`` forwards for real and says its exit is ``exit_ip``."""
"""The proxy at ``server`` relays CONNECTs and says its exit is ``exit_ip``."""
_DECLARED_EXITS[_endpoint(server)] = exit_ip
@@ -117,10 +131,10 @@ def declared_exit_of(server: Optional[str]) -> Optional[str]:
def asks_the_world(server: str, host: str, port: int) -> bool:
"""True, and the question is recorded, when a CONNECT to ``host:port`` is the question of the exit: the proxy must refuse it, not forward it."""
"""True, and the question is recorded, when a CONNECT to ``host:port`` is the question of the exit: the proxy must refuse it (the lab answers it with the declared exit)."""
if host.lower() not in EXIT_SERVICES:
return False
_WORLD_QUESTIONS.append("%s was asked %s:%d: the question of the exit reached a proxy that would have forwarded it to the internet" % (
_WORLD_QUESTIONS.append("%s was asked %s:%d: the question of the exit reached a proxy of the lab, which refuses it (its exit is declared, not asked of the internet)" % (
server, host, port))
return True
@@ -149,6 +163,140 @@ def _recv_exact(s: socket.socket, n: int) -> bytes:
return data
# ----------------------------------------------------------------------------------------------------------------
# The lab. A gateway of the tests forwards nothing that is not the lab's: the destination is refused and recorded.
# ----------------------------------------------------------------------------------------------------------------
#: The networks that are the lab's whatever the host: loopback, and the documentation ranges (RFC 5737 TEST-NET-1/2/3, RFC 3849) that the tests use
#: for their exits and their servers (nothing routes them: a test holds the ones a server stands at on ``lo``).
LAB_NETWORKS = tuple(ipaddress.ip_network(net) for net in (
"127.0.0.0/8", "::1/128", "192.0.2.0/24", "198.51.100.0/24", "203.0.113.0/24", "2001:db8::/32"))
#: The folder under ``$RUNNER_TEMP`` the e2e workflows upload (``invpw-evidence-*``).
EVIDENCE_FOLDER = "invpw-evidence"
def _own_interfaces() -> Dict[str, List[str]]:
"""The addresses assigned to each interface of this host (a server of a test stands at one of them), by interface name. It RAISES when they
cannot be listed (``_witness.HostInterfacesUnreadable``, or the ImportError of ``_witness``): never an empty list in place of an unreadable one."""
from _witness import read_host_interfaces
return read_host_interfaces()
def _own_addresses() -> Set[str]:
"""Every address of :func:`_own_interfaces` (raises as it does)."""
return {address for addresses in _own_interfaces().values() for address in addresses}
def _how_own_interfaces_are_read() -> str:
from _witness import how_host_interfaces_are_read
return how_host_interfaces_are_read()
def lab_refusal(host: str, own: Optional[Set[str]] = None) -> Optional[str]:
"""None when ``host`` (an address, or a name as a SOCKS5 client sent it) is the lab's: loopback, a documentation range, an address of one of this host's
own interfaces, or ``localhost``; otherwise WHY it is not, one sentence. Any other NAME is not the lab's: nothing here resolves a name for the internet's
sake, and the question would leave the machine. ``own`` is the addresses of this host's interfaces as a guard read them when it was made; None: they
are read now (:func:`_own_addresses`), only for an address outside loopback and the documentation ranges, and a reading that fails raises."""
text = host.strip().strip("[]").split("%", 1)[0].rstrip(".").lower()
try:
address = ipaddress.ip_address(text)
except ValueError:
if text == "localhost" or text.endswith(".localhost"):
return None
return "a name that is not localhost: a gateway of the tests resolves no name, the question would leave the machine"
mapped = getattr(address, "ipv4_mapped", None)
if mapped is not None:
address = mapped
if any(address in network for network in LAB_NETWORKS):
return None
read_at = "read at the decision" if own is None else "read when the gateway was made"
own = _own_addresses() if own is None else own
if address.compressed in own:
return None
return ("%s is not loopback, not in a documentation range and not one of the %d addresses of this host's interfaces %s"
% (address.compressed, len(own), read_at))
def is_lab_destination(host: str) -> bool:
"""Whether ``host`` is the lab's (:func:`lab_refusal` has no reason to refuse it)."""
return lab_refusal(host) is None
#: The address type of the SOCKS request the current thread last read (:meth:`Gateway._read_address`).
_REQUEST = threading.local()
class LabGuard:
"""What refuses a destination that is not the lab's and writes it down: one per gateway.
:meth:`admits` is asked with the destination as RECEIVED (``atyp`` is the SOCKS5 address type: 1 IPv4, 3 a name, 4 IPv6; ``protocol`` is ``"tcp"`` or
``"udp"``); ``target`` is where it would really go, as (host, port), when that is not the destination itself (a name a gateway maps to a local server): the lab's
decision is about the target. A refusal is recorded in :attr:`records` as a dict with ``t`` (seconds since ``t0``, the start of the gateway), ``atyp``,
``destination`` (as received), ``port``, ``protocol`` and ``reason`` (the rule that refused it). :meth:`write_evidence` leaves them, always, under
``$RUNNER_TEMP/invpw-evidence/<name>/``, with the interfaces of this host as the guard read them when it was made (:attr:`host_interfaces`) and how.
The interfaces are read ONCE, when the guard is made (a reading that fails raises there: the gateway is not made), and every decision is taken against
that reading: a refusal is a list append, synchronous, with no reading of the host."""
def __init__(self, name: str, t0: Optional[float] = None):
self.name = name
self.t0 = time.monotonic() if t0 is None else t0
#: Every refusal, in order.
self.records: List[dict] = []
#: The addresses of each interface of this host, read when the guard was made (raises if they cannot be read), and how they were read.
self.host_interfaces: Dict[str, List[str]] = _own_interfaces()
self.host_interfaces_read_by = _how_own_interfaces_are_read()
#: The same addresses as one set: what every decision of this guard is judged against.
self._own = {address for addresses in self.host_interfaces.values() for address in addresses}
self._lock = threading.Lock()
self._written = False
def admits(self, host: str, port: int, atyp: int, protocol: str, target: Optional[Tuple[str, int]] = None) -> bool:
reason = lab_refusal(host if target is None else target[0], self._own)
if reason is None:
return True
if target is not None and (target[0], target[1]) != (host, port):
reason = "mapped to %s:%d, and %s" % (target[0], target[1], reason)
self.refuse(host, port, atyp, protocol, reason=reason)
return False
def refuse(self, host: str, port: int, atyp: int, protocol: str, *, reason: str) -> None:
"""Write down a destination that was refused (by this guard's rule, or by the narrower rule of a subclass), with the ``reason``: which rule, one sentence."""
record = {"t": round(time.monotonic() - self.t0, 3), "atyp": atyp, "destination": host, "port": port, "protocol": protocol,
"reason": reason}
with self._lock:
self.records.append(record)
def refused(self, protocol: Optional[str] = None) -> List[Tuple[str, int]]:
"""Every refused destination as (destination as received, port), in order; of one protocol when asked."""
with self._lock:
return [(r["destination"], r["port"]) for r in self.records if protocol is None or r["protocol"] == protocol]
def evidence(self, extra: Optional[dict] = None) -> dict:
"""The record as it is written: the refusals, the interfaces of this host as read when the guard was made and how."""
with self._lock:
records = list(self.records)
return dict({"gateway": self.name, "refused": records,
"host_interfaces": {"read_by": self.host_interfaces_read_by, "read_at": "when the gateway was made",
"interfaces": self.host_interfaces}}, **(extra or {}))
def write_evidence(self, extra: Optional[dict] = None) -> Optional[pathlib.Path]:
"""Write the record, once (a gateway may be closed twice): the file written, or None off a runner (no ``$RUNNER_TEMP``) or when already written."""
runner_temp = os.environ.get("RUNNER_TEMP")
with self._lock:
if self._written:
return None
self._written = True
path = None
if runner_temp:
folder = pathlib.Path(runner_temp) / EVIDENCE_FOLDER / self.name / ("%d-%d" % (os.getpid(), int(time.time() * 1000)))
folder.mkdir(parents=True, exist_ok=True)
path = folder / "refused-destinations.json"
path.write_text(json.dumps(self.evidence(extra), indent=2), encoding="utf-8")
return path
class FakeStun:
"""A UDP STUN server that answers every binding request with ``mapped_ip``."""
@@ -215,10 +363,12 @@ class FakeStun:
class Gateway:
"""A SOCKS5 server. ``udp`` is ``"relay"`` or ``"refuse"`` (reply code 7)."""
#: Whether a CONNECT that is not special is forwarded for real, past loopback: such a gateway declares ``tcp_exit`` as its exit
#: Whether this gateway relays the CONNECTs that are not special (to the lab: it is hermetic): such a gateway declares ``tcp_exit`` as its exit
#: (``declare_exit``). A subclass that refuses everything but loopback (``tests/_doh_servers.DohGateway``) sets False: it cannot carry the
#: question of the exit anywhere, and the question is left to what answers it.
forwards_for_real = True
#: The name of the folder of the record of what this gateway refused under ``$RUNNER_TEMP/invpw-evidence/`` (a subclass may name its own).
evidence_name = "socks5-gateway"
def __init__(self, *, udp: str, tcp_exit: str, udp_exit: str,
user: Optional[str] = None, password: Optional[str] = None,
@@ -269,6 +419,9 @@ class Gateway:
self.associates = 0
#: When the gateway started: the origin of the times below.
self.t0 = time.monotonic()
#: What refuses (and records, and writes under ``$RUNNER_TEMP/invpw-evidence/<evidence_name>/`` when the gateway is closed) every destination that is
#: not the lab's, CONNECT or datagram: ``guard.records``, ``guard.refused()``.
self.guard = LabGuard(self.evidence_name, self.t0)
#: The same instant on the wall clock (seconds since the epoch), to compare with what a page reads from Date.now().
self.wall0 = time.time()
#: Every TCP connection the gateway accepted (a SOCKS handshake starts with one), as seconds from t0.
@@ -280,6 +433,8 @@ class Gateway:
#: Every datagram the relay carried out, as (host as sent, port, index in ``associations`` of the association it came
#: on, seconds from t0): which association carried a datagram, not only when it left.
self.datagram_via: List[Tuple[str, int, int, float]] = []
#: The association of the datagram that ``_route`` is routing, for the thread that routes it (``_route`` is called by the thread of the association).
self._dgram = threading.local()
#: Every datagram the relay carried out, as (host, port, payload).
self.datagrams: List[Tuple[str, int, bytes]] = []
#: The local port of the socket each granted association sends from: what a server behind the gateway sees as the port
@@ -287,8 +442,8 @@ class Gateway:
self.exit_ports: List[int] = []
#: A datagram the relay could not send (a socket that raised): said here and in the report of a test, never mute.
self.send_errors: List[str] = []
#: The hosts the relay forwards a datagram to (the fake STUN server aside); None: any host. A test that sends from an
#: address of this host keeps its lab closed: the browser's own background QUIC does not leave the machine.
#: The hosts the relay forwards a datagram to (the fake STUN server aside), among the lab's; None: any host of the lab. It only narrows: a host
#: that is not the lab's is never forwarded (``guard``).
self.forward_only_to: Optional[Set[str]] = None
self._listener = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self._listener.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
@@ -330,6 +485,11 @@ class Gateway:
except OSError:
pass
self.stun.close()
self.guard.write_evidence(self._evidence())
def _evidence(self) -> dict:
"""What a subclass adds to the record of the refusals written at the close (a dict of JSON values)."""
return {}
def __enter__(self) -> "Gateway":
return self
@@ -399,7 +559,10 @@ class Gateway:
@staticmethod
def _read_address(c: socket.socket) -> Tuple[str, int]:
"""The destination of a request, as received (the NAME for address type 3); its address type is left in :data:`_REQUEST` ``.atyp`` of the
thread that read it. A static method, as on main: a test that wraps it calls ``type(gateway)._read_address(c)``."""
atyp = _recv_exact(c, 1)[0]
_REQUEST.atyp = atyp
if atyp == 1:
host = socket.inet_ntoa(_recv_exact(c, 4))
elif atyp == 3:
@@ -442,6 +605,12 @@ class Gateway:
"""Where a CONNECT that is not a special one really goes. A subclass maps a name to a local server."""
return host, port
def _admits(self, host: str, port: int, atyp: int, protocol: str, target: Optional[Tuple[str, int]] = None) -> bool:
"""Whether the gateway carries a CONNECT (``protocol`` ``"tcp"``) or a datagram (``"udp"``) to ``host``:``port`` (as received; ``atyp`` is its SOCKS5
address type), or to ``target`` (host, port) when it is mapped elsewhere: only the lab's, and the rest is refused and recorded (``guard``). A subclass may narrow
it (never widen it: call this one first)."""
return self.guard.admits(host, port, atyp, protocol, target)
def _open_upstream(self, target: Tuple[str, int]) -> socket.socket:
"""The TCP connection of a CONNECT: from ``exit_host`` when ``tcp_from_exit``, else from wherever the system chooses."""
if not self.tcp_from_exit:
@@ -478,8 +647,12 @@ class Gateway:
if self.forwards_for_real and asks_the_world(self.server, host, port):
self._send(c, self._reply(2)) # not allowed: the exit of this gateway is declared, it is not asked of the internet
return
target = self._target(host, port)
if not self._admits(host, port, getattr(_REQUEST, "atyp", 3), "tcp", target):
self._send(c, self._reply(2)) # not allowed: the gateway carries nothing outside the lab
return
try:
up = self._open_upstream(self._target(host, port))
up = self._open_upstream(target)
except OSError:
self._send(c, self._reply(5))
return
@@ -536,13 +709,15 @@ class Gateway:
``target`` is the real address the datagram is sent to from the exit socket (``out_port`` is that socket's port);
``reported_as`` is the address the client is told the reply came from (None: the real source). A subclass may also
answer by itself with ``answer(host, port, data)``. By default the fake STUN server, by name or by number, is
mapped and everything else is forwarded for real."""
mapped and everything else is forwarded when it is the lab's (``_admits``); a datagram to any other destination is dropped and recorded."""
if (host, dport) in ((STUN_NAME, STUN_PORT), (STUN_NUMBER, STUN_PORT), (MEASURE_NUMBER, STUN_PORT)):
if not self.stun_answers:
return None
# A real server answers from the address it was asked at; the fake STUN server is mapped, so its reply is
# reported as from the asked address (only when that was a literal: a name has no address to report).
return self.stun.address, ((host, dport) if atyp == 1 else None)
if not self._admits(host, dport, atyp, "udp"):
return None # not the lab's: dropped, and recorded
if self.forward_only_to is not None and host not in self.forward_only_to:
return None
return (host, dport), None
@@ -607,6 +782,7 @@ class Gateway:
self.datagrams.append((host, dport, payload))
self.datagram_log.append((host, dport, atyp, time.monotonic() - self.t0))
self.datagram_via.append((host, dport, index, time.monotonic() - self.t0))
self._dgram.index = index
routed = self._route(host, dport, atyp, payload, out_port, answer)
if routed is None:
continue
@@ -685,12 +861,15 @@ def silent_udp(*, exit_ip: str = EXIT, user: Optional[str] = None, password: Opt
# A tiny TCP-only SOCKS5 server for the e2e tests (the fixture `socks5_tcp_only` of conftest.py makes one).
# ----------------------------------------------------------------------------------------------------------------
class Socks5TcpOnly:
"""Minimal SOCKS5: no-auth, CONNECT (TCP) relayed, UDP ASSOCIATE refused.
"""Minimal SOCKS5: no-auth, CONNECT (TCP) relayed to the lab, UDP ASSOCIATE refused.
Reproduces a residential TCP-only proxy: pages load over TCP, but WebRTC's
UDP path is dead - which (for a no-camera page in default_address_only mode)
is exactly what made the default-route probe fail and ICE return zero
candidates before Fix C.
Hermetic like :class:`Gateway`: a CONNECT to a destination that is not the lab's (:func:`is_lab_destination`) is refused with reply 2 and
recorded in :attr:`guard` (written under ``$RUNNER_TEMP/invpw-evidence/socks5-tcp-only/`` when the server is closed).
"""
def __init__(self, exit_ip: Optional[str] = None):
@@ -699,10 +878,12 @@ class Socks5TcpOnly:
self._srv.bind(("127.0.0.1", 0))
self._srv.listen(16)
self.port = self._srv.getsockname()[1]
#: It relays a CONNECT for real, so it declares its exit (what a launch behind it is told: the lab's, unless a test gives another).
#: It relays a CONNECT (to the lab), so it declares its exit (what a launch behind it is told: the lab's, unless a test gives another).
self.exit_ip = exit_ip or _lab_exit()
declare_exit(self.server, self.exit_ip)
self.udp_associate_attempts = 0
#: What refuses (and records) every CONNECT that is not the lab's.
self.guard = LabGuard("socks5-tcp-only")
self._stop = False
self._t = threading.Thread(target=self._serve, daemon=True)
self._t.start()
@@ -762,6 +943,10 @@ class Socks5TcpOnly:
conn.sendall(b"\x05\x02\x00\x01\x00\x00\x00\x00\x00\x00") # not allowed: the exit is declared, not asked of the internet
conn.close()
return
if not self.guard.admits(addr, port, atyp, "tcp"):
conn.sendall(b"\x05\x02\x00\x01\x00\x00\x00\x00\x00\x00") # not allowed: nothing outside the lab is carried
conn.close()
return
try:
upstream = socket.create_connection((addr, port), timeout=30)
except OSError:
@@ -801,3 +986,4 @@ class Socks5TcpOnly:
self._srv.close()
except Exception:
pass
self.guard.write_evidence()
+111
View File
@@ -0,0 +1,111 @@
"""The stack watchdog of the e2e tests: a Python thread that writes the stack of every thread of the process, holding the GIL.
``tests/conftest.py`` arms it for each e2e test and cancels it in the teardown. Once the threshold of a test is passed, and then every period until the
test ends, it appends one dump to the file it was given: ``Timeout (h:mm:ss)!`` (the time since the arming) and then, for every thread, ``Thread 0x... (most
recent call first):`` and its frames as `` File "...", line N in name``. Two identical dumps mean a stuck test, two different ones a slow test.
Why a Python thread and not ``faulthandler.dump_traceback_later``: that watchdog is a C thread, and it copies the frames of every thread WITHOUT the GIL
(``_Py_DumpTracebackThreads``, which CPython documents as "for debug purpose only ... after a segmentation fault, at fatal error") while the other threads
keep running and keep changing their frames. On Windows two full dumps of a pytest worker show it dead inside ``dump_frame`` of ``faulthandler_thread``,
reading a frame another thread was freeing. This thread takes ``sys._current_frames()`` with the GIL held, so a frame it reads cannot change under it.
One thread per process, started by the first ``arm`` and reused by every later test. It writes nothing to stdout or stderr. After ``cancel`` returns, nothing
more is written for that test: the dump is written under the lock that ``cancel`` takes.
Known limit: a thread that holds the GIL and never releases it (a C call that does not let go) keeps this thread from running, so it cannot write. That case
is pytest's ``faulthandler.enable()``, which writes only when the process dies. The 420 s limit of the run (``--timeout-method thread``) still names the test.
"""
from __future__ import annotations
import sys
import threading
import time
def _clock(seconds: float) -> str:
whole = int(seconds)
return "%d:%02d:%02d" % (whole // 3600, whole % 3600 // 60, whole % 60)
class StackWatchdog:
def __init__(self) -> None:
self._cond = threading.Condition()
self._thread: threading.Thread | None = None
self._armed = False
self._file = None
self._started = 0.0
self._period = 0.0
self._due = 0.0
@property
def thread(self) -> threading.Thread | None:
"""The one thread of the process (None until the first ``arm``)."""
return self._thread
def arm(self, nodeid: str, threshold_s: float, period_s: float | None = None, file=None) -> None:
"""From ``threshold_s`` seconds on, and then every ``period_s`` (the threshold by default), write the stacks of all threads to ``file`` until ``cancel``."""
period = threshold_s if period_s is None else period_s
with self._cond:
self._file = file
self._started = time.monotonic()
self._period = max(period, 0.0005)
self._due = self._started + threshold_s
self._armed = True
try:
file.write("\n--- %s ---\n" % nodeid)
file.flush()
except Exception:
pass
if self._thread is None or not self._thread.is_alive():
self._thread = threading.Thread(target=self._run, name="invpw-stack-watchdog", daemon=True)
self._thread.start()
self._cond.notify_all()
def cancel(self) -> None:
"""Nothing more is written for the armed test once this returns: a dump in progress finishes first, because it is written under the same lock."""
with self._cond:
self._armed = False
self._file = None
self._cond.notify_all()
def _run(self) -> None:
with self._cond:
while True:
if not self._armed:
self._cond.wait()
continue
left = self._due - time.monotonic()
if left > 0:
# Waiting lets go of the lock, so that a cancel or a new arm is never kept out by a watchdog with a short period.
self._cond.wait(left)
continue
self._write_one_dump()
self._due = time.monotonic() + self._period
def _write_one_dump(self) -> None:
mine = threading.get_ident()
names = {t.ident: t.name for t in threading.enumerate()}
out = ["Timeout (%s)!\n" % _clock(time.monotonic() - self._started)]
for ident, frame in sys._current_frames().items():
if ident == mine:
continue
name = names.get(ident)
out.append("\nThread 0x%016x%s (most recent call first):\n" % (ident, " [%s]" % name if name else ""))
while frame is not None:
out.append(' File "%s", line %d in %s\n' % (frame.f_code.co_filename, frame.f_lineno, frame.f_code.co_name))
frame = frame.f_back
try:
self._file.write("".join(out))
self._file.flush()
except Exception:
# A watchdog that fails the suite over its OWN problem is worse than the defect it is watching for.
pass
_the_watchdog = StackWatchdog()
arm = _the_watchdog.arm
cancel = _the_watchdog.cancel
def the_thread() -> threading.Thread | None:
return _the_watchdog.thread
+261
View File
@@ -0,0 +1,261 @@
"""What the stock twins share: the same steps on Playwright's own Firefox and on our engine, one browser at a time, and a record of each.
A twin test measures a relation (the dropdown of a select against its element, the drop of a real drag, what an observer reads of a scrolled frame) and its
verdict is "the same as stock Firefox with stock Playwright", never a number of ours: an expected value comes from a capture of retail or from stock in the same job.
HOW STOCK RUNS. The mechanism is the one of the fake web (``scripts/run_fakeweb.py``, ``tests/fakeweb/profile_p2.py::run_on_stock``): the stock Playwright client
(``playwright.sync_api``, imported by name: the fork's guard forbids a static import), ``p.firefox.launch()``, which starts Playwright's own Firefox build that
``python -m playwright install firefox`` put on the runner. That is a row with ``"stock_firefox": true`` of ``ci/required-suites.json``, whose leg the gate gives the
archives, checked against ``ci/py-lock/playwright-browsers.json``. Stock goes FIRST and is closed before ours starts (ci-release-18: one browser at a time). The stock
part runs in a thread of its own (a sync client keeps its loop marked as running in its thread, and ours is a sync client too).
THE SAME WINDOW. Stock is launched HEADED (``headless=False``: a real window, on a display of its own that ``OwnDisplay`` makes the way the wrapper makes ours: ``invisible_core.make_virtual_display()``, an Xvfb of 1920x1080x24 on Linux; on Windows the desktop of the job, a stock client cannot be put on another desktop), as ours is (``launch_case``: the wrapper gives the engine a display of its own, so its windows are real ones; Firefox's ``-headless`` mode is on neither, because popups, drag and drop and window geometry behave differently in it), with the display scale of the case as ``layout.css.devPixelsPerPx`` (the pref ours is launched with for the same case: the scale
is then the one of the page AND of the browser chrome) and a context viewport of the inner size retail reads at that case (``RETAIL_CASES``: the maximized window's
``innerWidth`` x ``innerHeight``). Ours is the maximized window of the same case (``_window_origin.launch_case``).
THE RECORD. Each twin saves, for each browser, what it measured with the scales that could make the two differ: ``scales.page`` (``window.devicePixelRatio`` of the page, its
inner size, ``screen.width/height``: the DECLARED ones of ours) and ``scales.chrome`` read from chrome scope through Marionette (``devicePixelRatio`` of the browser window,
the inner and outer size of the window, and the REAL scale of the screen: ``nsIScreen.contentsScaleFactor`` and ``defaultCSSScaleFactor``, ``windowUtils.displayDPI``). The failure message
prints both records whole. A stock browser that cannot be driven (no Marionette, no dropdown, no drag) is a BROKEN CONTROL: red, and the message says it is no finding about ours.
"""
from __future__ import annotations
import fnmatch
import importlib
import json
import os
import re
import sys
from typing import Any, Callable, Dict, List, Mapping, Optional, Tuple
from invisible_core import make_virtual_display
from _popup_geometry import in_a_thread_of_its_own
from _window_origin import launch_case, scale_pref
from test_the_maximized_window_frames_and_popups_read_retail_e2e import CASES as RETAIL_CASES
MARIONETTE_ARGS = ["-marionette", "-remote-allow-system-access"]
SCALES_JS = """
const win = Services.wm.getMostRecentWindow("navigator:browser");
const screen = Cc["@mozilla.org/gfx/screenmanager;1"].getService(Ci.nsIScreenManager).primaryScreen;
return JSON.stringify({
chrome_devicePixelRatio: win.devicePixelRatio,
chrome_inner: [win.innerWidth, win.innerHeight],
chrome_outer: [win.outerWidth, win.outerHeight],
real_screen_contentsScaleFactor: screen.contentsScaleFactor,
real_screen_defaultCSSScaleFactor: screen.defaultCSSScaleFactor,
real_displayDPI: win.windowUtils.displayDPI,
});
"""
PAGE_SCALES = """() => ({devicePixelRatio: window.devicePixelRatio, inner: [innerWidth, innerHeight], screen: [screen.width, screen.height]})"""
def on_linux() -> bool:
return sys.platform.startswith("linux")
class OwnDisplay:
"""The display a browser that is not ours is launched on: the wrapper's own mechanism (``make_virtual_display``, what ``InvisiblePlaywright`` starts for ours), never the job's.
On Linux a fresh Xvfb (the core's: 1920x1080x24, access control on, its cookie in ``XAUTHORITY``), one per launch, started before the browser and stopped after it; the browser's environment
gets ``DISPLAY`` and ``XAUTHORITY`` from it and loses the Wayland variables, so a job that runs pytest without ``xvfb-run`` (the rows of the stock twins) still has a screen. On Windows there is
nothing to make: a stock client cannot spawn its browser on another desktop, so it is on the one of the job, and ``environ`` is the environment as it is."""
def __init__(self) -> None:
self._display: Any = None
def __enter__(self) -> "OwnDisplay":
if on_linux():
display = make_virtual_display()
display.start()
self._display = display
return self
def __exit__(self, *exc: Any) -> None:
display, self._display = self._display, None
if display is not None:
display.stop()
def environ(self, base: Optional[Mapping[str, str]] = None) -> Dict[str, str]:
"""``base`` (the process's environment by default) as the browser is launched with it: what the display names set, what it names ``None`` removed."""
env = dict(os.environ if base is None else base)
for name, value in (self._display.launch_env() if self._display is not None else {}).items():
if value is None:
env.pop(name, None)
else:
env[name] = value
return env
class BrokenControl(AssertionError):
"""Stock Firefox could not be driven through the steps: not a finding about ours."""
class Chrome:
"""Chrome scope of the browser below this process, through Marionette (the route of ``test_software_compositing_is_declared_e2e.py``).
``page`` is the page the browser of this launch already opened, and it is required on purpose: ``WebDriver:NewSession`` waits for the end of the browser's start-up, which only a window
ends, and the wrapper launches with ``-silent`` (no window at start-up). A session asked before the first page never gets its answer (the socket times out after 300 s). With the page
as an argument the wrong order cannot be written."""
def __init__(self, page) -> None:
if page is None:
raise TypeError("Chrome needs the page this launch opened first: Marionette's NewSession is answered only once a window exists")
import webfont_probe
self._page = page
self._m = webfont_probe._Marionette(webfont_probe.marionette_active_port())
self._m.call("WebDriver:NewSession", {"capabilities": {"alwaysMatch": {}}})
self._m.call("Marionette:SetContext", {"value": "chrome"})
def script(self, script: str, args: Tuple[Any, ...] = ()) -> Dict[str, Any]:
return json.loads(self._m.call("WebDriver:ExecuteScript", {"script": script, "args": list(args)})["value"])
def scales(self) -> Dict[str, Any]:
"""The record of the scales: the page's (declared) and the chrome's, with the real ones of the screen."""
out = {"page": self._page.evaluate(PAGE_SCALES)}
out.update(self.script(SCALES_JS))
return out
def close(self) -> None:
self._m.close()
def stock_client():
"""The stock Playwright client, imported by name."""
try:
return importlib.import_module("playwright.sync_api").sync_playwright
except ImportError as exc: # a broken environment, not a reason to skip: a skipped gate checks nothing
raise BrokenControl("the stock Playwright client is missing (%s): install the wrapper with its dev extra" % exc) from exc
def viewport(case: str) -> Dict[str, int]:
"""The inner size retail reads for the maximized window of ``case``, CSS pixels."""
maximized = RETAIL_CASES[case]["maximized"]
return {"width": int(maximized["iw"]), "height": int(maximized["ih"])}
def stock_user_prefs(case: str) -> Dict[str, Any]:
"""The user prefs stock Playwright's Firefox is launched with for ``case``: the display scale as the STRING ours is launched with (``scale_pref``), and a free Marionette port.
A number would be set with ``setIntPref`` by the Juggler of Playwright's build, and ``layout.css.devPixelsPerPx`` is a string pref: ``Browser.enable`` fails and no case launches."""
return {"layout.css.devPixelsPerPx": scale_pref(case), "marionette.port": 0}
def _on_stock(case: str, measure: Callable[[Any, Chrome], Dict[str, Any]]) -> Dict[str, Any]:
def run() -> Dict[str, Any]:
sync_playwright = stock_client()
with sync_playwright() as p, OwnDisplay() as display:
browser = p.firefox.launch(headless=False, args=MARIONETTE_ARGS, env=display.environ(),
firefox_user_prefs=stock_user_prefs(case))
chrome = None
try:
page = browser.new_context(viewport=viewport(case)).new_page()
chrome = Chrome(page)
return measure(page, chrome)
finally:
if chrome is not None:
chrome.close()
browser.close()
try:
return in_a_thread_of_its_own(run)
except BrokenControl:
raise
except Exception as exc:
raise BrokenControl("BROKEN CONTROL, no finding about ours: stock Firefox (Playwright's own build) could not be driven through the steps of %s: %s: %s"
% (case, type(exc).__name__, exc)) from exc
def _on_ours(case: str, firefox_binary: str, measure: Callable[[Any, Chrome], Dict[str, Any]]) -> Dict[str, Any]:
with launch_case(firefox_binary, case, extra_args=MARIONETTE_ARGS, extra_prefs={"marionette.port": 0}) as browser:
page = browser.new_page() # first: the window the session below waits for
chrome = Chrome(page)
try:
return measure(page, chrome)
finally:
chrome.close()
def run_twin(case: str, firefox_binary: str, measure: Callable[[Any, Chrome], Dict[str, Any]]) -> Tuple[Dict[str, Any], Dict[str, Any]]:
"""(stock's record, ours): the same ``measure(page, chrome)`` on Playwright's own Firefox first and on our engine second. Needs MOZ_REMOTE_ALLOW_SYSTEM_ACCESS=1."""
stock = _on_stock(case, measure)
ours = _on_ours(case, firefox_binary, measure)
return stock, ours
def both(case: str, stock: Dict[str, Any], ours: Dict[str, Any], reference: str = "stock") -> str:
"""The two records whole, for the message of a red twin (``reference`` names the first: stock, or retail)."""
return "\n case %s\n %s: %s\n ours: %s" % (case, reference, json.dumps(stock, sort_keys=True), json.dumps(ours, sort_keys=True))
def differences(stock: Any, ours: Any, tolerances: Dict[str, float] = None, path: str = "") -> List[str]:
"""Every place where the two records differ, as ``path: stock X, ours Y``. A number differs by more than the tolerance of its key (the last name of its path; 0 when none);
everything else must be equal."""
tolerances = tolerances or {}
out: List[str] = []
if isinstance(stock, dict) and isinstance(ours, dict):
for key in sorted(set(stock) | set(ours)):
if key not in stock or key not in ours:
out.append("%s.%s: only %s has it" % (path, key, "stock" if key in stock else "ours"))
else:
out += differences(stock[key], ours[key], tolerances, "%s.%s" % (path, key))
elif isinstance(stock, list) and isinstance(ours, list) and len(stock) == len(ours):
for i, (a, b) in enumerate(zip(stock, ours)):
out += differences(a, b, tolerances, "%s[%d]" % (path, i))
elif isinstance(stock, (int, float)) and isinstance(ours, (int, float)) and not isinstance(stock, bool) and not isinstance(ours, bool):
tolerance = tolerances.get(path.rsplit(".", 1)[-1].split("[", 1)[0], 0.0)
if abs(stock - ours) > tolerance:
out.append("%s: stock %r, ours %r (tolerance %r)" % (path, stock, ours, tolerance))
elif stock != ours:
out.append("%s: stock %r, ours %r" % (path, stock, ours))
return out
#: The two reasons a field of a stock twin's record can be left out of the comparison with stock (the retail capture of the case decides it instead).
IN_PROCESS_FRAME = "in-process frame in stock"
SYNTHETIC_DRAG = "synthetic drag in stock"
REASONS = {
IN_PROCESS_FRAME: "stock Playwright's Firefox sets fission.webContentIsolationStrategy=0, so its cross-site frame shares the top's process and ours is in another process: a field that depends on "
"the frame being in another process is not what stock reads",
SYNTHETIC_DRAG: "stock's drag is Juggler's synthetic one: no OLE drag loop, so no timer-driven drag event and no buttons held, and nothing a real drag has beyond the events themselves",
}
def canonical(path: str, root: str) -> str:
"""``path`` of a difference less its root, with every list index as ``[]``: ``drag drop.top.once[3].buttons`` is ``top.once[].buttons`` for the root ``drag drop``."""
rest = path[len(root):].lstrip(".") if path.startswith(root) else path
return re.sub(r"\[\d+\]", "[]", rest)
def leaf_paths(node: Any, prefix: str = "") -> List[str]:
"""The canonical path of every leaf of a record (what a declared field has to name to exist in it)."""
if isinstance(node, dict):
return [p for k, v in node.items() for p in leaf_paths(v, "%s.%s" % (prefix, k) if prefix else str(k))] or [prefix]
if isinstance(node, list):
return [p for v in node for p in leaf_paths(v, prefix + "[]")] or [prefix + "[]"]
return [prefix]
def stale_entries(declared: Mapping[str, str], *records: Any) -> List[str]:
"""The declared fields (a pattern of canonical paths, ``*`` for any run of characters) that name nothing in any of ``records``, and the reasons that are not one of ``REASONS``."""
paths = [p for record in records for p in leaf_paths(record)]
out = ["%s names no field of the record" % field for field in declared if not any(fnmatch.fnmatchcase(p, field) for p in paths)]
return out + ["%s has the reason %r, which is not one of %s" % (field, why, sorted(REASONS)) for field, why in declared.items() if why not in REASONS]
def split_differences(stock: Any, ours: Any, declared: Mapping[str, str], tolerances: Dict[str, float] = None, path: str = "") -> Tuple[List[str], List[str]]:
"""``(red, recorded)``: the differences of ``differences`` split by the declared list of the twin. A difference at a declared field is recorded (with its reason, for the report) and does not
decide the verdict; every other one is red. ``declared`` maps a pattern of canonical paths (``canonical``) to one of ``REASONS``."""
red: List[str] = []
recorded: List[str] = []
for difference in differences(stock, ours, tolerances, path):
where = canonical(difference.split(": ", 1)[0], path)
why = next((reason for field, reason in declared.items() if fnmatch.fnmatchcase(where, field)), None)
if why is None:
red.append(difference)
else:
recorded.append("%s [recorded, not compared: %s]" % (difference, why))
return red, recorded
+23 -6
View File
@@ -17,14 +17,22 @@ import pytest
_SYSCALLS = ("execve,clone,clone3,fork,vfork,open,openat,stat,lstat,"
"newfstatat,statx,access,faccessat,faccessat2,readlink")
#: The network calls, traced only when a caller asks (``network=True``: scripts/ci_ab_host.py, NET_CALLS): the font tests do not.
_NET_SYSCALLS = "socket,connect,bind,sendto,sendmsg,sendmmsg"
#: The signals a trace with ``exit_status`` records (``-e signal=``): the ones that end a process or are sent to end it, with the sender (``si_pid``) and the faulting address
#: (``si_addr``). The lines they make (``1234 --- SIGSEGV {si_signo=SIGSEGV, ...} ---``) are evidence of a crash and never data of the comparison (scripts/ci_ab_host.py drops
#: them when it reads the log). strace stops the tracee at every signal whether it prints it or not, so printing changes nothing the browser does.
RECORDED_SIGNALS = "SIGSEGV,SIGBUS,SIGABRT,SIGILL,SIGFPE,SIGSYS,SIGTRAP,SIGTERM,SIGINT,SIGQUIT,SIGHUP"
def _strace_options() -> str:
def _strace_options(fd_paths: bool = False, exit_status: bool = False) -> str:
"""strace's own flags: quiet, follow forks, and die with the traced process
when this build knows --kill-on-exit."""
when this build knows --kill-on-exit; ``fd_paths`` adds ``-y``, which prints the path of every file descriptor
(``3</usr/share/fonts>``), so that a path relative to a directory descriptor is known; ``exit_status`` keeps the lines that say how each process ended
(``+++ exited with 0 +++``, ``+++ killed by SIGKILL +++``: ``-q`` and not ``-qq``) and records the fatal signals (``RECORDED_SIGNALS``)."""
help_text = subprocess.run([shutil.which("strace"), "-h"], capture_output=True,
text=True).stdout
return "-f -qq -s 4096" + (" --kill-on-exit" if "--kill-on-exit" in help_text else "")
return (("-f -q -e signal=%s -s 4096" % RECORDED_SIGNALS) if exit_status else "-f -qq -s 4096") + (" -y" if fd_paths else "") + (" --kill-on-exit" if "--kill-on-exit" in help_text else "")
def _require_strace_can_trace(tmp: Path) -> None:
@@ -38,7 +46,8 @@ def _require_strace_can_trace(tmp: Path) -> None:
def _stand_in(binary: str, tree: Path, log: Path, pidfile: Path, syscalls: str = _SYSCALLS,
timestamps: bool = False) -> str:
timestamps: bool = False, fd_paths: bool = False, network: bool = False, exit_status: bool = False,
cores: bool = False) -> str:
"""A copy of the engine's directory made of links, whose executable runs
the real one under strace, in the engine's place.
@@ -53,18 +62,26 @@ def _stand_in(binary: str, tree: Path, log: Path, pidfile: Path, syscalls: str =
``syscalls`` is what strace traces; ``timestamps`` adds ``-ttt`` (the epoch
seconds after each pid), which ``_LINE`` does not read: a caller that asks
for them strips them first (``test_the_parent_reads_the_bundle_from_fontconfig_s_cache_linux_e2e``)."""
for them strips them first (``test_the_parent_reads_the_bundle_from_fontconfig_s_cache_linux_e2e``);
``fd_paths`` adds ``-y`` (scripts/ci_ab_host.py reads the paths the tree touched, and knows a socket by its inode);
``network`` adds the network calls to ``syscalls`` (scripts/ci_ab_host.py reads the netlink sockets and the public destinations);
``cores`` lets the tree dump core (``ulimit -c unlimited``) and changes nothing else: the working directory stays the launcher's, so the paths the trace reads
are the same, and where the kernel writes the core is the job's ``kernel.core_pattern`` (scripts/ci_ab_host.py)."""
if network:
syscalls = syscalls + "," + _NET_SYSCALLS
real = Path(os.path.realpath(binary))
tree.mkdir()
for entry in real.parent.iterdir():
if entry.name != real.name:
(tree / entry.name).symlink_to(entry)
script = tree / real.name
cores_script = "ulimit -c unlimited\n" if cores else ""
script.write_text(
"#!/bin/sh\n"
"echo $$ > %s\n"
"%s"
'exec %s %s -o %s -e trace=%s %s "$@"\n'
% (pidfile, shutil.which("strace"), _strace_options() + (" -ttt" if timestamps else ""), log, syscalls, real))
% (pidfile, cores_script, shutil.which("strace"), _strace_options(fd_paths, exit_status) + (" -ttt" if timestamps else ""), log, syscalls, real))
script.chmod(script.stat().st_mode | stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH)
return str(script)
+70 -6
View File
@@ -93,6 +93,15 @@ def _attrs(data: bytes) -> Dict[int, bytes]:
return out
def is_deallocation(data: bytes) -> bool:
"""Whether a datagram is a TURN deallocation, by what it means (RFC 5766 section 7.1): a STUN Refresh (0x0004) whose LIFETIME (0x000D) is 0. A Refresh with a lifetime above 0, with
none, or any other message type, is not one. The one reading of it: the TURN server of the lab and the gateway of the lab both use it."""
if len(data) < 20 or struct.unpack("!I", data[4:8])[0] != MAGIC or struct.unpack("!H", data[:2])[0] != 0x0004:
return False
lifetime = _attrs(data).get(0x000D)
return lifetime is not None and len(lifetime) == 4 and struct.unpack("!I", lifetime)[0] == 0
def _attr(t: int, v: bytes) -> bytes:
return struct.pack("!HH", t, len(v)) + v + b"\x00" * (-len(v) % 4)
@@ -111,11 +120,39 @@ def _message(mtype: int, tid: bytes, attrs: bytes, key: Optional[bytes] = None)
return head + attrs + _attr(0x0008, mac)
def long_term_key(user: str) -> bytes:
"""The long-term credential key of RFC 5389 section 15.4: md5(username:realm:password)."""
return hashlib.md5(("%s:%s:%s" % (user, REALM, PASSWORD)).encode(), usedforsecurity=False).digest()
def integrity_valid(data: bytes, user: str) -> bool:
"""Whether the MESSAGE-INTEGRITY of a request is the HMAC-SHA1 under the long-term key of ``user`` (RFC 5389 section 15.4): over the message up to the
attribute, with the length field of the header set as if the message ended with that attribute (24 bytes more than what came before it). A request
with no MESSAGE-INTEGRITY, or a truncated one, is not valid."""
i = 20
while i + 4 <= len(data):
t, n = struct.unpack("!HH", data[i:i + 4])
if t == 0x0008:
if n != 20 or i + 24 > len(data):
return False
head = data[:2] + struct.pack("!H", i + 24 - 20) + data[4:20]
return hmac.compare_digest(hmac.new(long_term_key(user), head + data[20:i], hashlib.sha1).digest(), data[i + 4:i + 24])
i += 4 + ((n + 3) & ~3)
return False
class TurnServer:
"""UDP TURN server on 127.0.0.1. ``seen`` is every datagram as (source ip, source port, STUN type), in order;
``requests`` the same datagrams as (monotonic time, transaction id, STUN type, carries credentials): a retransmission has the
transaction id of the request it repeats, so the TRANSACTIONS of a road are the distinct ids (:meth:`transactions`);
``allocations`` the successful Allocates as (source ip, source port, username, time)."""
``allocations`` the successful Allocates as (source ip, source port, username, time); ``deallocations`` the requests that END an allocation as (source ip, source
port, transaction id, time, index in ``allocations`` of the allocation they end, or None when that source has none): a deallocation is recognised by what it means, a
Refresh (0x0004) whose LIFETIME (0x000D) is 0 (RFC 5766 section 7.1), not by its type: a Refresh with a lifetime above 0 keeps the allocation and is not one. The server
answers it as it answers any Refresh; a retransmission is another datagram of the same transaction (:meth:`deallocation_transactions`).
A request that carries USERNAME is checked: its MESSAGE-INTEGRITY must be the HMAC under the long-term key of that user (``PASSWORD``).
A missing or wrong one is answered 401 with the realm and the nonce, makes no allocation, and is written in ``refused`` as
(source ip, source port, username, transaction id, time): a client with the wrong password never gets a relay here, as on a real server."""
def __init__(self) -> None:
self.sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
@@ -124,6 +161,8 @@ class TurnServer:
self.seen: List[Tuple[str, int, int]] = []
self.allocations: List[Tuple[str, int, str, float]] = []
self.requests: List[Tuple[float, bytes, int, bool]] = []
self.deallocations: List[Tuple[str, int, bytes, float, Optional[int]]] = []
self.refused: List[Tuple[str, int, str, bytes, float]] = []
self._closed = False
threading.Thread(target=self._serve, daemon=True).start()
@@ -135,6 +174,17 @@ class TurnServer:
first.setdefault(request[1], request)
return sorted(first.values(), key=lambda r: r[0])
def deallocation_transactions(self) -> List[Tuple[str, int, bytes, float, Optional[int]]]:
"""The first datagram of each deallocation transaction, in order: a retransmission of it is not another deallocation."""
first: Dict[bytes, Tuple[str, int, bytes, float, Optional[int]]] = {}
for record in list(self.deallocations):
first.setdefault(record[2], record)
return sorted(first.values(), key=lambda r: r[3])
def deallocation_tids(self) -> set:
"""The transaction ids (bytes) of every deallocation received: what ties its datagrams on the wire to the server's record of it."""
return {record[2] for record in list(self.deallocations)}
def close(self) -> None:
self._closed = True
self.sock.close()
@@ -148,26 +198,40 @@ class TurnServer:
if len(data) < 20 or struct.unpack("!I", data[4:8])[0] != MAGIC:
continue
mtype, tid = struct.unpack("!H", data[:2])[0], data[8:20]
self.seen.append((src[0], src[1], mtype))
attrs = _attrs(data)
if is_deallocation(data): # recorded BEFORE the request: whoever reads `requests` already knows which of them it ended
held = [i for i, a in enumerate(self.allocations) if a[:2] == (src[0], src[1])]
self.deallocations.append((src[0], src[1], tid, time.monotonic(), held[-1] if held else None))
self.seen.append((src[0], src[1], mtype))
self.requests.append((time.monotonic(), tid, mtype, 0x0008 in attrs and 0x0006 in attrs))
user_raw = attrs.get(0x0006)
if mtype in (0x0003, 0x0004, 0x0008, 0x0009) and user_raw is not None:
user = user_raw.decode(errors="replace")
if not integrity_valid(data, user): # the wrong password, or no MESSAGE-INTEGRITY: 401, no allocation
self.refused.append((src[0], src[1], user, tid, time.monotonic()))
self.sock.sendto(_message(mtype | 0x0110, tid, self._unauthorized()), src)
continue
if mtype == 0x0003: # Allocate
if 0x0008 not in attrs or 0x0006 not in attrs: # no credentials: 401 with a realm and a nonce
err = _attr(0x0009, b"\x00\x00\x04\x01Unauthorized") + _attr(0x0014, REALM.encode()) + _attr(0x0015, NONCE.encode())
self.sock.sendto(_message(0x0113, tid, err), src)
self.sock.sendto(_message(0x0113, tid, self._unauthorized()), src)
continue
user = attrs[0x0006].decode(errors="replace")
key = hashlib.md5(("%s:%s:%s" % (user, REALM, PASSWORD)).encode(), usedforsecurity=False).digest()
key = long_term_key(user)
body = (_attr(0x0016, _xor_addr(*RELAYED)) + _attr(0x0020, _xor_addr(src[0], src[1])) +
_attr(0x000D, struct.pack("!I", 600)))
self.allocations.append((src[0], src[1], user, time.monotonic()))
self.sock.sendto(_message(0x0103, tid, body, key), src)
elif mtype in (0x0004, 0x0008, 0x0009): # Refresh, CreatePermission, ChannelBind
user = attrs.get(0x0006, b"").decode(errors="replace")
key = hashlib.md5(("%s:%s:%s" % (user, REALM, PASSWORD)).encode(), usedforsecurity=False).digest()
key = long_term_key(user)
body = _attr(0x000D, struct.pack("!I", 600)) if mtype == 0x0004 else b""
self.sock.sendto(_message(mtype | 0x0100, tid, body, key), src)
@staticmethod
def _unauthorized() -> bytes:
"""The attributes of a 401: ERROR-CODE, the realm and the nonce of the long-term credential."""
return _attr(0x0009, b"\x00\x00\x04\x01Unauthorized") + _attr(0x0014, REALM.encode()) + _attr(0x0015, NONCE.encode())
# ── the gateway ────────────────────────────────────────────────────────────────
+45 -20
View File
@@ -12,12 +12,7 @@ Nothing here opens a browser; the unit test ``test_the_udp_line_helpers.py`` hol
from __future__ import annotations
import ipaddress
from typing import Any, Callable, Dict, List, Optional, Sequence
#: How much slower than the first visit a later visit may load, in milliseconds, on the roads where UDP does not work. A
#: retail Firefox on a network that drops UDP loads the later visits as fast as the first (15 of 15 sessions, h2/h2/h2): an h3
#: attempt that waits for a timeout before it falls back to h2 would be seconds.
LOAD_MARGIN_MS = 1500
from typing import Any, Callable, Dict, List, Optional, Sequence, Tuple
#: The visits of one page in one context, by kind of road. With NO proxy and the native DNS the retail is measured in loopback
#: and is exact: h2, h3, h3 over three visits. BEHIND A PROXY the names are resolved by DoH, the browser learns the Alt-Svc
@@ -162,7 +157,7 @@ def expected_protocols(road: str) -> str:
return ("h2 on the first visit, then h3 from a later visit on and h3 on every one after it, within %d visits "
"(retail with DoH and UDP free: h2/h2/h3 in 9 of 15, h2/h2/h2 in 4, h2/h3/h3 in 2, and h3 first in 3 of 15 in the "
"third run when the DNS answer carries the HTTPS record; this fixture has none: h2 first)" % visits)
return "h2 on every one of %d visits, as fast as the first (retail with UDP dropped: h2/h2/h2 in 15 of 15)" % visits
return "h2 on every one of %d visits, with no attempt at h3 (retail with UDP dropped: h2/h2/h2 in 15 of 15)" % visits
def no_https_record(host: str, doh: Any = None) -> List[str]:
@@ -185,27 +180,62 @@ def no_https_record(host: str, doh: Any = None) -> List[str]:
return problems
def judge_visits(road: str, protocols: Sequence[str], walls_ms: Sequence[float]) -> List[str]:
def relay_activity(gateway: Any) -> Tuple[int, int]:
"""What a SOCKS5 gateway of the tests has been asked for so far, as ``(UDP ASSOCIATE requests, datagrams its relay carried)``: the
requests answered or refused, the datagrams of every association. Taken twice (before the first visit, which is after the core's own
measurement of the gateway, and after the last), the difference is what the ENGINE asked of the relay while it visited the page."""
return int(gateway.associates), len(gateway.datagrams)
def h3_attempts(server: Any, gateway: Any = None, before: Optional[Tuple[int, int]] = None) -> List[str]:
"""What the test server (and, behind a SOCKS5 gateway, the gateway) says about a TRY at HTTP/3, as sentences; an empty list when nothing tried.
Behind a SOCKS5 gateway that is not coherent the engine does not carry UDP (nsSOCKSUDPIOLayer.cpp, ``StealthPutSocksUdpLayer``: the socket of an
HTTP/3 connection gets a layer that is ``Blocked``, no association is asked for): an engine that tried would ask the gateway for a UDP
ASSOCIATE (a refused one is a request too) or send a datagram to its relay, whether or not the datagram goes on to the server.
``gateway`` and ``before`` (:func:`relay_activity` taken before the first visit) add those two to the answer.
A retail Firefox on a network that drops UDP (and behind an HTTP proxy, which has no UDP at all) never tries HTTP/3: it reads h2 and
nothing is sent to the h3 port the Alt-Svc announces. An engine that TRIES sends its QUIC Initial there first, and then waits for
an answer that does not come before it falls back to h2: the wait is the tell, and the datagram is the attempt. The attempt is
read where it is born, as a datagram that reached the UDP port of ``server`` (``H3Server.udp_datagrams``, every datagram, with
or without a handshake), never as a duration: how long a fallback takes is the speed of the machine, whether it was tried is the engine."""
problems: List[str] = []
seen = list(getattr(server, "udp_datagrams", ()))
if seen:
problems.append("%d UDP datagrams reached the h3 port %s of the server, from %s: the engine tried HTTP/3 (and, where nothing answers, "
"waits for a timeout before the fallback to h2)" % (len(seen), getattr(server, "port", "?"), sorted(set(seen))))
if gateway is not None:
if before is None:
raise ValueError("a gateway is judged against what it had been asked before the first visit (relay_activity)")
associates, datagrams = (now - was for now, was in zip(relay_activity(gateway), before))
if associates:
problems.append("the engine asked the gateway for %d UDP ASSOCIATE while it visited the page: it tried to carry UDP (HTTP/3) "
"through a gateway that was not measured coherent" % associates)
if datagrams:
problems.append("%d datagrams went into the relay of the gateway while the page was visited: the engine tried HTTP/3 "
"through a gateway that was not measured coherent" % datagrams)
return problems
def judge_visits(road: str, protocols: Sequence[str]) -> List[str]:
"""What is wrong with the visits of one page on ``road``, as sentences; an empty list when nothing is.
``protocols`` is the ``nextHopProtocol`` of each visit and ``walls_ms`` the time ``page.goto`` took to the load event;
both have :func:`visits_for` entries. The rules, from the retail:
``protocols`` is the ``nextHopProtocol`` of each visit, :func:`visits_for` entries. No duration is judged: that an h3 attempt
waited for a timeout is read as the attempt itself (:func:`h3_attempts`). The rules, from the retail:
* ``direct``: exactly h2, h3, h3.
* ``socks5_coherent``: the first visit is h2 (the fixture is reached by an address: no HTTPS record exists, so nothing
tells the browser about h3 before the first connection; the retail itself reads h3 first when the DNS answer carries
the record, so this is a rule of the fixture, checked with :func:`no_https_record`); every later visit is h2 or h3, but once one is h3 all the following are (h3 never goes back to h2); and at
least one visit is h3 (it is NOT required at the second: h2/h2/h3 is the commonest retail sequence).
* the roads where UDP is dropped: h2 on every visit, and no visit loads more than :data:`LOAD_MARGIN_MS` slower than the
first (a fallback that waits for a timeout is a tell)."""
* the roads where UDP is dropped: h2 on every visit (and no attempt at h3: :func:`h3_attempts`, read by the test)."""
problems: List[str] = []
protocols, walls_ms = list(protocols), list(walls_ms)
protocols = list(protocols)
visits = visits_for(road)
said = "a retail Firefox reads %s on this road" % expected_protocols(road)
if len(protocols) != visits:
problems.append("%d protocols for %d visits: %s" % (len(protocols), visits, protocols))
if len(walls_ms) != visits:
problems.append("%d load times for %d visits: %s" % (len(walls_ms), visits, walls_ms))
if protocols and protocols[0] == "h3":
problems.append("visit 1 read h3: in this fixture nothing had told the browser yet that the server speaks h3 (no "
"name, no HTTPS record): something told it, or the fixture changed")
@@ -221,9 +251,4 @@ def judge_visits(road: str, protocols: Sequence[str], walls_ms: Sequence[float])
problems.append("the protocols of the %d visits are %s, %s" % (visits, protocols, said))
elif protocols != ["h2"] * visits:
problems.append("the protocols of the %d visits are %s, %s" % (visits, protocols, said))
if len(walls_ms) == visits and road in _H2_ROADS:
for number in range(2, visits + 1):
if walls_ms[number - 1] > walls_ms[0] + LOAD_MARGIN_MS:
problems.append("visit %d loaded in %d ms against %d ms for visit 1 (more than %d ms slower): an h3 attempt "
"that waited for a timeout before the fallback" % (number, walls_ms[number - 1], walls_ms[0], LOAD_MARGIN_MS))
return problems
+23
View File
@@ -0,0 +1,23 @@
"""Where the e2e stack watchdog (``tests/_stack_watchdog.py``, armed by ``tests/conftest.py``) writes its stacks."""
from __future__ import annotations
import os
from typing import Mapping
#: The folder under ``$RUNNER_TEMP`` that every e2e job uploads whatever the result ("Keep what the tests saved", ``invpw-evidence-*``).
EVIDENCE_FOLDER = "invpw-evidence"
LOG_NAME = "e2e-watchdog.log"
def default_log_path(environ: Mapping[str, str], tempdir: str) -> str:
"""The file the stacks go to.
``INVPW_TEST_WATCHDOG_FILE`` when it is set (the workflows of the wrapper name their own file). On a runner (``RUNNER_TEMP`` set) the evidence folder, which the gate uploads with
the result of the leg, so that the stack of a hung test is in the artifact of the run that hung. Elsewhere ``invpw-e2e-watchdog.log`` in the temporary folder."""
named = environ.get("INVPW_TEST_WATCHDOG_FILE")
if named:
return named
runner = environ.get("RUNNER_TEMP")
if runner:
return os.path.join(runner, EVIDENCE_FOLDER, "watchdog", LOG_NAME)
return os.path.join(tempdir, "invpw-e2e-watchdog.log")
+27
View File
@@ -0,0 +1,27 @@
"""What a test that cannot get a WebGL context writes down, so that the red says why (a pure helper, no browser).
A page asks for a context and gets ``null``: the page learns nothing more unless it listens for ``webglcontextcreationerror`` on the canvas
before it asks (``statusMessage``). The probe of the test returns an object with ``unavailable: true`` and what it heard instead of ``null``;
``split_probe`` turns that into the old ``None`` (so that the assertion stays as it was) and the record of the attempt, and ``unavailable_message``
is the sentence of the assertion with both attempts appended.
"""
from __future__ import annotations
from typing import Any, Optional, Tuple
#: The pause, in milliseconds, between the first attempt and the second one (a diagnostic: the verdict is the first attempt's).
SECOND_ATTEMPT_AFTER_MS = 2000
UNAVAILABLE = "webgl is unavailable: a WebGL canvas cannot be read"
def split_probe(result: Any) -> Tuple[Optional[Any], Optional[dict]]:
"""``(got, first)``: ``got`` is what the test reads (``None`` when there was no context, exactly as the old probe returned), ``first`` the
record of the failed attempt (``None`` when a context was made)."""
if isinstance(result, dict) and result.get("unavailable") is True:
return None, result
return result, None
def unavailable_message(first: Optional[dict], second: Any) -> str:
"""The message of the assertion: the old sentence, then what the first attempt and the second one (2 s later) reported."""
return "%s | first: %r; second after 2 s: %r" % (UNAVAILABLE, first, second)
+56
View File
@@ -0,0 +1,56 @@
"""Every pytest process of a Windows job that keeps WER dumps lets Windows Error Reporting see its crash: the bit SEM_NOGPFAULTERRORBOX of its error mode is cleared.
A process whose error mode carries SEM_NOGPFAULTERRORBOX (0x0002) never invokes Windows Error Reporting when it dies from an unhandled exception, so the
LocalDumps key of python.exe that e2e.yml sets (a full dump into ``$RUNNER_TEMP/invpw-evidence/dumps/python``) is never read: the pytest controllers of the
runner are born with 0x0003 (SEM_FAILCRITICALERRORS | SEM_NOGPFAULTERRORBOX), and every child inherits the mode of its parent, so every xdist worker is born
with it too and a worker that crashes leaves no dump.
https://learn.microsoft.com/windows/win32/api/errhandlingapi/nf-errhandlingapi-seterrormode
``clear_for_wer_dumps()``: tests/conftest.py calls it in ``pytest_configure``, which the controller and every xdist worker run. It acts only when ALL of this
holds, so nothing changes on a developer's machine, on Linux, or in a job that did not set LocalDumps:
* the system is Windows;
* ``$INVPW_WER_DUMPS`` (the one variable the "Windows Error Reporting keeps a full dump..." step of each Windows job of e2e.yml exports to ``$GITHUB_ENV``) names an
existing folder: the folder the dumps go to.
It clears bit 0x0002 and keeps every other bit of the mode, and appends one line to ``error-mode.log`` in the parent of that folder (``invpw-evidence/dumps``, inside the evidence the job
uploads): ``pid <n> error mode born 0x<hex>, now 0x<hex>``, so the evidence shows the bit was cleared in every process. It writes nothing to stdout or stderr, and it
never raises: a failure is a line of that log, not a failed test.
"""
from __future__ import annotations
import os
import sys
from pathlib import Path
#: The variable the Windows jobs export: the folder LocalDumps of python.exe writes to.
ENV_VAR = "INVPW_WER_DUMPS"
LOG_NAME = "error-mode.log"
#: SEM_NOGPFAULTERRORBOX: the process is not reported to Windows Error Reporting.
SEM_NOGPFAULTERRORBOX = 0x0002
def clear_for_wer_dumps(environ=None) -> None:
environ = os.environ if environ is None else environ
if sys.platform != "win32":
return
folder = environ.get(ENV_VAR)
if not folder or not os.path.isdir(folder):
return
log = Path(folder).resolve().parent / LOG_NAME
try:
import ctypes
kernel32 = ctypes.WinDLL("kernel32")
kernel32.GetErrorMode.restype = ctypes.c_uint
kernel32.SetErrorMode.argtypes = [ctypes.c_uint]
kernel32.SetErrorMode.restype = ctypes.c_uint
born = kernel32.GetErrorMode()
kernel32.SetErrorMode(born & ~SEM_NOGPFAULTERRORBOX)
line = "pid %d error mode born 0x%04x, now 0x%04x\n" % (os.getpid(), born, kernel32.GetErrorMode())
except Exception as exc: # best effort: the evidence says what went wrong, the test run goes on
line = "pid %d error mode not cleared: %s: %s\n" % (os.getpid(), type(exc).__name__, exc)
try:
with open(log, "a", encoding="utf-8") as handle:
handle.write(line)
except OSError:
pass
+78
View File
@@ -0,0 +1,78 @@
"""What the window-origin e2e files share: the four display cases, a browser pinned to one of them, and waits on a reading of a page.
The four cases are the ones of the window tests against retail (``test_the_maximized_window_frames_and_popups_read_retail_e2e.py``): scale 1.0, 1.25 and 1.5
on a 1920x1080 panel (device pixels) and 2.0 on a 1600x1200 one. The engine declares the window, so the page reads the same on Linux and on Windows.
Waits are CONDITIONS with a deadline (``_waits``), never a pause; ``observe`` is the one bounded look at a value that must NOT change, and it says so.
"""
from __future__ import annotations
import time
from typing import Any, Callable, Dict, List, Tuple
from _waits import wait_until
#: The deadline of a wait for something that must happen, in seconds.
DEADLINE_S = 30
#: Floats of a page (``mozInnerScreenY`` 72.667 is 72.6666...).
FLOAT = 0.001
#: case id -> (display scale, panel in device pixels).
CASES: Dict[str, Tuple[float, Tuple[int, int]]] = {
"1920x1080-dpr1.0": (1.0, (1920, 1080)),
"1920x1080-dpr1.25": (1.25, (1920, 1080)),
"1920x1080-dpr1.5": (1.5, (1920, 1080)),
"1600x1200-dpr2.0": (2.0, (1600, 1200)),
}
def scale_pref(case: str) -> str:
"""``layout.css.devPixelsPerPx`` of a case, as the core declares it for ours (``str(profile.screen.dpr)``: "1.0", "1.25", "1.5", "2.0").
The pref is a STRING pref of Firefox. A client that sends a number (stock Playwright puts a number through ``Browser.enable`` as ``setIntPref``) makes the browser refuse
the launch with NS_ERROR_UNEXPECTED, so every browser that is not ours gets the scale in this form, from here."""
return str(CASES[case][0])
def launch_case(firefox_binary: str, case: str, **extra: Any):
"""The product on one case: seed 42, the panel and the scale pinned, headless, no humanizing. ``extra`` is for the keywords a test needs on top
(``extra_args``, ``extra_prefs``)."""
from invisible_playwright import InvisiblePlaywright
dpr, panel = CASES[case]
pin = {"screen.width": panel[0], "screen.height": panel[1], "screen.dpr": dpr}
return InvisiblePlaywright(seed=42, pin=pin, binary_path=firefox_binary, headless=True, humanize=False, **extra)
def settled(page, read: Callable[[], Any], seconds: float = DEADLINE_S) -> Any:
"""``read()`` once two looks in a row, 100 ms apart, give the same value (or the last one at the deadline: a window that never settles is red where
the caller's assertion names what was read)."""
seen: Dict[str, Any] = {"now": None, "before": None}
def look() -> bool:
seen["before"], seen["now"] = seen["now"], read()
return seen["now"] == seen["before"]
wait_until(look, seconds, lambda: page.wait_for_timeout(100))
return seen["now"]
def wait_for(page, condition: Callable[[], Any], seconds: float = DEADLINE_S) -> bool:
"""Until ``condition()`` is true, reading the client's events between two looks; False at the deadline."""
return wait_until(condition, seconds, lambda: page.wait_for_timeout(100))
def observe(page, read: Callable[[], Any], seconds: float) -> List[Any]:
"""The distinct values ``read()`` gives over ``seconds``, in the order they were seen (the first look is always taken).
The ONE bounded look of these files: for a value that must stay as it is (a window after ``resizeBy(0, 0)``, a frame that must not have loaded yet).
A change that comes later than ``seconds`` is not seen; a change inside it always is, so the check can be late to catch a bug and never red for nothing."""
values: List[Any] = []
end = time.monotonic() + seconds
while True:
value = read()
if not values or values[-1] != value:
values.append(value)
if time.monotonic() >= end:
return values
page.wait_for_timeout(100)
+99
View File
@@ -0,0 +1,99 @@
"""What the window e2e tests share: a headed session of the product, and a wait on a condition of a page.
The sessions are HEADED on purpose. ``headless=True`` gives every session a display of its own (a fresh Xvfb on Linux, a fresh Win32 desktop on
Windows), so two of them never see each other; the focus and occlusion tests need two windows on ONE display, which is what two headed sessions of the
same run have (the Linux e2e runs under ``xvfb-run``). Both sessions use the same seed, so both windows are the same declared window and the second one
covers the first completely.
The first session is the one of the test's own thread; the second one lives in a thread of its own (``in_a_thread_of_its_own``, the pattern of
``test_popups_reach_the_client_e2e.py``): an open sync client keeps its asyncio loop marked as running in the thread that started it, and a second sync client
refuses to start there ("It looks like you are using Playwright Sync API inside the asyncio loop"). A sync client's objects belong to the thread that made
them, so everything the test does with the second session is handed to that thread (``run``).
"""
from __future__ import annotations
import contextlib
import queue
import threading
from typing import Any, Callable, Dict, Iterator, Optional
from _waits import Watch, watch
#: The seed only has to give two sessions the same window.
SEED = 21
#: The deadline of a wait for something that must happen, in seconds.
DEADLINE_S = 30
def launch(firefox_binary: str, *, extra_prefs: Optional[Dict[str, Any]] = None, pin: Optional[Dict[str, Any]] = None, headless: bool = False):
"""A session of the product (RFP off, the engine declared as the core launches it); ``extra_prefs`` and ``pin`` only where a test needs them."""
from invisible_playwright import InvisiblePlaywright
return InvisiblePlaywright(seed=SEED, binary_path=firefox_binary, headless=headless, locale="en-US", timezone="America/New_York",
extra_prefs=extra_prefs, pin=pin)
def wait_for_condition(page, sample: Callable[[], Any], done: Callable[[Any], Any], what: str, seconds: float = DEADLINE_S) -> Watch:
"""Until ``done(sample())``, reading the page between two looks. Red after ``seconds`` with what was seen on the way."""
result = watch(sample, done, seconds, lambda: page.wait_for_timeout(100))
assert result.ok, "%s; seen: %s" % (what, result.render())
return result
class SecondSession:
"""A session that lives in a thread of its own: ``run(fn)`` calls ``fn(session)`` in that thread and gives back its result or raises its error."""
def __init__(self) -> None:
self._jobs: "queue.Queue[Optional[tuple]]" = queue.Queue()
def run(self, fn: Callable[[Any], Any]) -> Any:
box: Dict[str, Any] = {}
done = threading.Event()
self._jobs.put((fn, box, done))
assert done.wait(300), "the second session did not answer within 300 s"
if "error" in box:
raise box["error"]
return box.get("value")
@contextlib.contextmanager
def in_a_thread_of_its_own(firefox_binary: str, *, extra_prefs: Optional[Dict[str, Any]] = None) -> Iterator[SecondSession]:
"""A second headed session on the same display, started and closed in a thread with no asyncio loop; the test keeps the first one in its own thread."""
handle = SecondSession()
up = threading.Event()
failure: Dict[str, BaseException] = {}
def serve() -> None:
try:
with launch(firefox_binary, extra_prefs=extra_prefs) as session:
up.set()
while True:
job = handle._jobs.get()
if job is None:
return
fn, box, done = job
try:
box["value"] = fn(session)
except BaseException as exc: # handed back to the test's thread by ``run``
box["error"] = exc
finally:
done.set()
except BaseException as exc: # the launch or the close of the session
failure["error"] = exc
finally:
up.set()
worker = threading.Thread(target=serve, name="second-session", daemon=True)
worker.start()
assert up.wait(300), "the second session did not start within 300 s"
if "error" in failure:
raise failure["error"]
try:
yield handle
finally:
handle._jobs.put(None)
worker.join(120)
assert not worker.is_alive(), "the second session did not close within 120 s"
if "error" in failure:
raise failure["error"]
+850
View File
@@ -0,0 +1,850 @@
"""What a client puts on the wire, read by a server of the lab: the TLS ClientHello, the HTTP/2 frames, the HTTP/1.1 request heads in wire order, and
what an HTTP/3 client says (QUIC transport parameters, the SETTINGS frame, the header order). No browser in here: every parser takes bytes, and the
unit tests (``test_wire_capture.py``, ``test_wire_capture_quic.py``) feed them a client of Python's ``ssl``, the ``h2`` library and ``aioquic``.
The use: the network A/B oracle (``scripts/ci_ab_network.py``) runs the same journey with two engines and compares what these servers saw, leaf by leaf.
* :func:`parse_client_hello` reads the record of a ClientHello with the standard library only: record and handshake version, the cipher suites in order,
the compression methods, the extensions in the order they were sent, and what is inside each of the known ones (supported_groups, signature_algorithms,
ALPN, key_share GROUPS, psk_key_exchange_modes, supported_versions, record_size_limit, ec_point_formats, ...). A GREASE value is written ``"GREASE"``.
What is random or secret per connection is NOT kept: the random, the session id, the bytes of a key share, the PSK identities and their ages, the
ECH config id, the encapsulated key. Only their lengths stay (a length is the shape of the hello, not a value of it).
* :func:`peek_client_hello` reads that record off a socket with ``MSG_PEEK`` until the whole record is buffered, so the same socket can then be handed to
``ssl`` as if nothing had been read (:func:`accept_with_hello`).
* :class:`FrameTap` reads the HTTP/2 frames of a connection from the raw bytes (``hyperframe``, which ``h2`` is made of): SETTINGS ids and values in order,
the WINDOW_UPDATEs, PRIORITY and PRIORITY_UPDATE, the priority fields of a HEADERS. :class:`H2Connection` is the server side (``h2``): it answers the
requests and writes down, per request, the pseudo-header order and every header name and value in the order they arrived.
* :class:`Http1Parser` keeps the request line and the header lines as they were written (the case, the order, the empty values); :func:`serve_http1` is
the server side, and the parser alone is what a tee in front of another server uses.
* :class:`WireServer` is one address and one port: TCP with TLS (HTTP/2 or HTTP/1.1 by the ALPN it offers) and, when asked, QUIC (HTTP/3 with
``aioquic``) on the same number, each connection written down.
Nothing here waits on a clock: a peek that is short of bytes is a poll with a deadline (a safety net, not a verdict), and every other wait is a blocking read.
"""
from __future__ import annotations
import socket
import socketserver
import ssl
import struct
import sys
import tempfile
import threading
import time
from pathlib import Path
from typing import Any, Callable, Dict, List, Optional, Tuple
#: The longest ClientHello record a peek waits for. A hello with a post-quantum key share and an ECH payload is about 2 KB; 16 KB is the limit of a record.
MAX_HELLO_RECORD = 16384 + 5
#: The deadline of a peek, in seconds. A safety net: a client that sent half a hello and stopped, not a measure of anything.
PEEK_DEADLINE_S = 30.0
GREASE = "GREASE"
EXTENSION_NAMES = {
0: "server_name", 1: "max_fragment_length", 5: "status_request", 10: "supported_groups", 11: "ec_point_formats", 13: "signature_algorithms",
14: "use_srtp", 15: "heartbeat", 16: "alpn", 18: "signed_certificate_timestamp", 21: "padding", 22: "encrypt_then_mac", 23: "extended_master_secret",
27: "compress_certificate", 28: "record_size_limit", 34: "delegated_credentials", 35: "session_ticket", 41: "pre_shared_key", 42: "early_data",
43: "supported_versions", 44: "cookie", 45: "psk_key_exchange_modes", 49: "post_handshake_auth", 50: "signature_algorithms_cert", 51: "key_share",
17513: "application_settings", 17613: "application_settings_new", 65037: "encrypted_client_hello", 65281: "renegotiation_info",
}
#: The QUIC transport parameters by id (RFC 9000 18.2 and the extensions seen in browsers).
QUIC_PARAMETER_NAMES = {
0x00: "original_destination_connection_id", 0x01: "max_idle_timeout", 0x02: "stateless_reset_token", 0x03: "max_udp_payload_size",
0x04: "initial_max_data", 0x05: "initial_max_stream_data_bidi_local", 0x06: "initial_max_stream_data_bidi_remote",
0x07: "initial_max_stream_data_uni", 0x08: "initial_max_streams_bidi", 0x09: "initial_max_streams_uni", 0x0A: "ack_delay_exponent",
0x0B: "max_ack_delay", 0x0C: "disable_active_migration", 0x0D: "preferred_address", 0x0E: "active_connection_id_limit",
0x0F: "initial_source_connection_id", 0x10: "retry_source_connection_id", 0x11: "version_information", 0x20: "max_datagram_frame_size",
0x2AB2: "grease_quic_bit", 0x2AB1: "reset_stream_at", 0x3127: "initial_rtt", 0x1057: "google_connection_options", 0x4752: "google_version",
}
#: The parameters whose value is an identifier or a secret of the connection: only its length is kept.
QUIC_OPAQUE = {0x00, 0x02, 0x0D, 0x0F, 0x10}
H2_FRAME_TYPES = {0: "DATA", 1: "HEADERS", 2: "PRIORITY", 3: "RST_STREAM", 4: "SETTINGS", 5: "PUSH_PROMISE", 6: "PING", 7: "GOAWAY",
8: "WINDOW_UPDATE", 9: "CONTINUATION", 0x10: "PRIORITY_UPDATE"}
H2_PREFACE = b"PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n"
class NotAClientHello(ValueError):
"""The bytes are not one TLS record that holds a ClientHello."""
def is_grease(value: int) -> bool:
"""A GREASE value of RFC 8701: both bytes are the same and end in 0xa (0x0a0a, 0x1a1a ... 0xfafa)."""
return (value & 0x0F0F) == 0x0A0A and (value >> 8) == (value & 0xFF)
def _hex(value: int) -> str:
return GREASE if is_grease(value) else "0x%04x" % value
def _grease_quic(identifier: int) -> bool:
"""A reserved QUIC transport parameter id (31 * N + 27)."""
return identifier >= 27 and (identifier - 27) % 31 == 0
class _Reader:
"""A cursor over bytes that refuses to read past the end."""
def __init__(self, data: bytes) -> None:
self.data = data
self.at = 0
def left(self) -> int:
return len(self.data) - self.at
def take(self, n: int) -> bytes:
if n < 0 or self.at + n > len(self.data):
raise NotAClientHello("a field of %d bytes runs past the end (%d left)" % (n, self.left()))
out = self.data[self.at:self.at + n]
self.at += n
return out
def u8(self) -> int:
return self.take(1)[0]
def u16(self) -> int:
return struct.unpack("!H", self.take(2))[0]
def u24(self) -> int:
return int.from_bytes(self.take(3), "big")
def u32(self) -> int:
return struct.unpack("!I", self.take(4))[0]
def vec8(self) -> bytes:
return self.take(self.u8())
def vec16(self) -> bytes:
return self.take(self.u16())
def _u16_list(data: bytes) -> List[str]:
reader = _Reader(data)
out = []
while reader.left() >= 2:
out.append(_hex(reader.u16()))
return out
def _parse_extension(ext_type: int, data: bytes) -> Any:
"""What is inside one extension, without anything random: a value, a list, or a dict."""
reader = _Reader(data)
if ext_type == 0: # server_name
names = []
inner = _Reader(reader.vec16())
while inner.left():
kind = inner.u8()
names.append(inner.vec16().decode("ascii", "replace") if kind == 0 else "type%d" % kind)
return names[0] if len(names) == 1 else names
if ext_type == 5: # status_request
kind = reader.u8()
return {"type": kind, "responder_ids_length": len(reader.vec16()), "extensions_length": len(reader.vec16())}
if ext_type == 10: # supported_groups
return _u16_list(reader.vec16())
if ext_type == 11: # ec_point_formats
return list(reader.vec8())
if ext_type in (13, 34, 50): # signature_algorithms, delegated_credentials, signature_algorithms_cert
return _u16_list(reader.vec16())
if ext_type == 16: # alpn
inner = _Reader(reader.vec16())
out = []
while inner.left():
out.append(inner.vec8().decode("ascii", "replace"))
return out
if ext_type == 21: # padding
return {"length": len(data)}
if ext_type == 27: # compress_certificate
return _u16_list(reader.vec8())
if ext_type == 28: # record_size_limit
return reader.u16()
if ext_type == 35: # session_ticket
return {"length": len(data)}
if ext_type == 41: # pre_shared_key: how many, never what
identities = _Reader(reader.vec16())
count = 0
while identities.left():
identities.vec16()
identities.u32()
count += 1
binders = _Reader(reader.vec16())
lengths = []
while binders.left():
lengths.append(len(binders.vec8()))
return {"identities": count, "binder_lengths": lengths}
if ext_type == 42: # early_data
return True
if ext_type == 43: # supported_versions
return _u16_list(reader.vec8())
if ext_type == 45: # psk_key_exchange_modes
return list(reader.vec8())
if ext_type == 51: # key_share: the groups and the length of each key, never the key
shares = _Reader(reader.vec16())
out = []
while shares.left():
group = shares.u16()
out.append({"group": _hex(group), "key_length": len(shares.vec16())})
return out
if ext_type in (17513, 17613): # application_settings
inner = _Reader(reader.vec16())
out = []
while inner.left():
out.append(inner.vec8().decode("ascii", "replace"))
return out
if ext_type == 65037: # encrypted_client_hello: the suite and the lengths, never the config or the key
kind = reader.u8()
if kind != 0:
return {"type": kind, "length": len(data)}
kdf, aead = reader.u16(), reader.u16()
reader.u8()
return {"type": 0, "kdf": kdf, "aead": aead, "enc_length": len(reader.vec16()), "payload_length": len(reader.vec16())}
if ext_type == 65281: # renegotiation_info
return {"length": len(reader.vec8())}
return {"length": len(data)}
def parse_client_hello(record: bytes) -> Dict[str, Any]:
"""The ClientHello in ``record`` (a whole TLS record, header included), as the dict described at the top of this file. Raises NotAClientHello."""
try:
reader = _Reader(record)
content_type, record_version, length = reader.u8(), reader.u16(), reader.u16()
if content_type != 22:
raise NotAClientHello("the record is of type %d, not a handshake" % content_type)
if length > reader.left():
raise NotAClientHello("the record says %d bytes and %d came" % (length, reader.left()))
body = _Reader(reader.take(length))
if body.u8() != 1:
raise NotAClientHello("the handshake message is not a ClientHello")
hello = _Reader(body.take(body.u24()))
handshake_version = hello.u16()
hello.take(32) # the random: dropped
session_id = hello.vec8() # the session id: only its length
suites_raw = hello.vec16()
suites = [_hex(struct.unpack("!H", suites_raw[i:i + 2])[0]) for i in range(0, len(suites_raw) - 1, 2)]
compression = list(hello.vec8())
out: Dict[str, Any] = {
"record_version": "0x%04x" % record_version, "record_length": length, "handshake_version": "0x%04x" % handshake_version,
"session_id_length": len(session_id), "cipher_suites": suites, "compression_methods": compression,
}
order: List[str] = []
data: Dict[str, Any] = {}
lengths: Dict[str, int] = {}
grease = 0
extensions = _Reader(hello.vec16()) if hello.left() else _Reader(b"")
while extensions.left():
ext_type, ext_data = extensions.u16(), extensions.vec16()
if is_grease(ext_type):
order.append(GREASE)
grease += 1
continue
name = EXTENSION_NAMES.get(ext_type, "ext_%d" % ext_type)
order.append(name)
lengths[name] = len(ext_data)
try:
data[name] = _parse_extension(ext_type, ext_data)
except NotAClientHello:
data[name] = {"unparsed_length": len(ext_data)}
out["extension_order"] = order
out["extensions"] = data
out["extension_lengths"] = lengths
out["grease_extensions"] = grease
return out
except struct.error as exc:
raise NotAClientHello("a field is cut short: %s" % exc) from None
# ---------------------------------------------------------------------------------------------------------------- peeking at the socket
def _peek(sock: socket.socket, n: int, deadline_s: float) -> bytes:
"""Exactly ``n`` bytes from the front of the stream, left in it. Blocks until they are there (``MSG_WAITALL`` where the system takes it with
``MSG_PEEK``; elsewhere a poll with a deadline: a peek that is short of bytes returns at once, and the only way to wait is to look again)."""
flags = socket.MSG_PEEK | (0 if sys.platform == "win32" else getattr(socket, "MSG_WAITALL", 0))
end = time.monotonic() + deadline_s
sock.settimeout(deadline_s)
while True:
data = sock.recv(n, flags)
if len(data) >= n:
return data
if not data:
raise ConnectionError("the peer closed the connection before the ClientHello was complete")
if time.monotonic() >= end:
raise TimeoutError("the ClientHello did not arrive in %.0f s (%d of %d bytes)" % (deadline_s, len(data), n))
time.sleep(0.002)
def peek_client_hello(sock: socket.socket, deadline_s: float = PEEK_DEADLINE_S) -> bytes:
"""The record of the ClientHello at the front of the stream of ``sock``, with every byte of it still in the socket's buffer."""
head = _peek(sock, 5, deadline_s)
if head[0] != 22:
raise NotAClientHello("the first byte of the connection is %d, not a TLS handshake record" % head[0])
total = 5 + struct.unpack("!H", head[3:5])[0]
if total > MAX_HELLO_RECORD:
raise NotAClientHello("a record of %d bytes" % total)
return _peek(sock, total, deadline_s)[:total]
def accept_with_hello(conn: socket.socket, context: ssl.SSLContext, deadline_s: float = PEEK_DEADLINE_S) -> Tuple[Dict[str, Any], ssl.SSLSocket]:
"""Peek the ClientHello of ``conn``, parse it, then hand the same socket to ``ssl``: ``(hello, tls socket)``. The handshake sees every byte."""
hello = parse_client_hello(peek_client_hello(conn, deadline_s))
conn.settimeout(deadline_s)
return hello, context.wrap_socket(conn, server_side=True)
# ---------------------------------------------------------------------------------------------------------------------------------- HTTP/1.1
class Http1Parser:
"""The requests of one HTTP/1.1 connection, read from the bytes in the order they come. ``feed`` returns the requests that are complete (head and body).
A request is ``{"request_line": "GET /x HTTP/1.1", "method", "target", "version", "headers": [[name, value], ...], "body_length": n}``: the names with
the case they were sent with, in the order they were sent, an empty value kept. The body is skipped (``Content-Length`` and ``chunked``) and never kept."""
def __init__(self) -> None:
self._buf = bytearray()
self._pending: Optional[Dict[str, Any]] = None
self._body_left = 0
self._chunked = False
def feed(self, data: bytes) -> List[Dict[str, Any]]:
self._buf += data
done: List[Dict[str, Any]] = []
while True:
if self._pending is None:
end = self._buf.find(b"\r\n\r\n")
if end < 0:
return done
head = bytes(self._buf[:end]).decode("latin-1")
del self._buf[:end + 4]
lines = head.split("\r\n")
parts = lines[0].split(" ")
headers = []
for line in lines[1:]:
name, _sep, value = line.partition(":")
headers.append([name, value.strip(" \t")])
self._pending = {"request_line": lines[0], "method": parts[0], "target": parts[1] if len(parts) > 1 else "",
"version": parts[2] if len(parts) > 2 else "", "headers": headers, "body_length": 0}
lowered = {n.lower(): v for n, v in headers}
self._chunked = "chunked" in lowered.get("transfer-encoding", "").lower()
try:
self._body_left = int(lowered.get("content-length", "0") or 0)
except ValueError:
self._body_left = 0
if self._chunked:
if not self._skip_chunks():
return done
else:
take = min(self._body_left, len(self._buf))
del self._buf[:take]
self._body_left -= take
self._pending["body_length"] += take
if self._body_left:
return done
done.append(self._pending)
self._pending, self._chunked = None, False
def _skip_chunks(self) -> bool:
"""Consume chunks while they are whole; True when the terminating chunk and its trailer have been read."""
while True:
line_end = self._buf.find(b"\r\n")
if line_end < 0:
return False
try:
size = int(bytes(self._buf[:line_end]).split(b";")[0], 16)
except ValueError:
size = 0
if size == 0:
if self._buf.find(b"\r\n\r\n", line_end - 1) < 0 and not self._buf.startswith(b"0\r\n\r\n"):
return False
end = self._buf.find(b"\r\n\r\n")
del self._buf[:end + 4 if end >= 0 else len(self._buf)]
return True
if len(self._buf) < line_end + 2 + size + 2:
return False
self._pending["body_length"] += size
del self._buf[:line_end + 2 + size + 2]
def serve_http1(sock: Any, responder: Callable[[Dict[str, Any]], Tuple[int, List[Tuple[str, str]], bytes]],
on_request: Callable[[Dict[str, Any]], None], alt_svc: Optional[str] = None, close_after_response: bool = False,
on_answered: Optional[Callable[[Dict[str, Any]], None]] = None) -> None:
"""Serve the requests of a connection (a TLS socket, or a plain one) until the peer closes: each request is handed to ``on_request`` and answered by
``responder(request) -> (status, headers, body)``. With ``close_after_response`` the answer says ``Connection: close`` and the connection ends after it: the client
needs a new connection for its next request, and by then it has read the session ticket the server sent with the first answer. ``on_answered(request)`` is called once the
whole answer (head and body) has been handed to the socket, in the same thread and before the next request is read: the moment a client can have all of it."""
parser = Http1Parser()
while True:
data = sock.recv(65536)
if not data:
return
for request in parser.feed(data):
on_request(request)
status, headers, body = responder(dict(request, scheme="https", protocol="http/1.1"))
if alt_svc:
headers = list(headers) + [("alt-svc", alt_svc)]
lines = ["HTTP/1.1 %d %s" % (status, "OK" if status == 200 else "Status")]
lines += ["%s: %s" % (n, v) for n, v in headers if n.lower() not in ("content-length", "connection")]
lines.append("Content-Length: %d" % len(body))
if close_after_response:
lines.append("Connection: close")
sock.sendall(("\r\n".join(lines) + "\r\n\r\n").encode("latin-1") + body)
if on_answered is not None:
on_answered(request)
if close_after_response:
return
# ---------------------------------------------------------------------------------------------------------------------------------- HTTP/2
class FrameTap:
"""The HTTP/2 frames of one direction of a connection, parsed from the raw bytes as they come (the client's preface first)."""
def __init__(self) -> None:
self._buf = bytearray()
self._preface = False
self.frames: List[Dict[str, Any]] = []
def feed(self, data: bytes) -> List[Dict[str, Any]]:
from hyperframe.frame import Frame
self._buf += data
if not self._preface:
if len(self._buf) < len(H2_PREFACE):
return []
if bytes(self._buf[:len(H2_PREFACE)]) != H2_PREFACE:
raise ValueError("the connection does not start with the HTTP/2 preface")
del self._buf[:len(H2_PREFACE)]
self._preface = True
new = []
while len(self._buf) >= 9:
frame, length = Frame.parse_frame_header(memoryview(bytes(self._buf[:9])))
if len(self._buf) < 9 + length:
break
frame.parse_body(memoryview(bytes(self._buf[9:9 + length])))
del self._buf[:9 + length]
record = _frame_record(frame)
self.frames.append(record)
new.append(record)
return new
def _priority_fields(frame: Any) -> Dict[str, Any]:
return {"depends_on": frame.depends_on, "weight": frame.stream_weight + 1 if frame.stream_weight is not None else None,
"exclusive": bool(frame.exclusive)}
def _frame_record(frame: Any) -> Dict[str, Any]:
kind = type(frame).__name__
record: Dict[str, Any] = {"stream": frame.stream_id, "flags": sorted(frame.flags)}
if kind == "SettingsFrame":
record.update(type="SETTINGS", settings=[[int(k), v] for k, v in frame.settings.items()])
elif kind == "WindowUpdateFrame":
record.update(type="WINDOW_UPDATE", increment=frame.window_increment)
elif kind == "PriorityFrame":
record.update(type="PRIORITY", **_priority_fields(frame))
elif kind in ("HeadersFrame", "PushPromiseFrame", "ContinuationFrame"):
record["type"] = {"HeadersFrame": "HEADERS", "PushPromiseFrame": "PUSH_PROMISE", "ContinuationFrame": "CONTINUATION"}[kind]
if kind == "HeadersFrame" and "PRIORITY" in frame.flags:
record["priority"] = _priority_fields(frame)
elif kind == "DataFrame":
record.update(type="DATA", length=len(frame.data))
elif kind == "ExtensionFrame":
number = int(frame.type)
record["type"] = H2_FRAME_TYPES.get(number, "TYPE_%d" % number)
body = bytes(frame.body)
if number == 0x10 and len(body) >= 4: # PRIORITY_UPDATE (RFC 9218): the element and the priority field
record.update(element=struct.unpack("!I", body[:4])[0] & 0x7FFFFFFF, field=body[4:].decode("ascii", "replace"))
else:
record["length"] = len(body)
else:
record["type"] = {"PingFrame": "PING", "GoAwayFrame": "GOAWAY", "RstStreamFrame": "RST_STREAM"}.get(kind, kind)
return record
def summarize_frames(frames: List[Dict[str, Any]]) -> Dict[str, Any]:
"""What of a connection's frames is the shape of the CLIENT, not of the traffic: the first SETTINGS in order, the WINDOW_UPDATEs and the types of the
frames before the first request, every PRIORITY and PRIORITY_UPDATE, the priority fields of the HEADERS. What follows the first request (DATA, PING,
later window updates) depends on how much was sent and is only counted."""
first_headers = next((i for i, f in enumerate(frames) if f["type"] == "HEADERS"), len(frames))
before = frames[:first_headers]
settings = next((f["settings"] for f in frames if f["type"] == "SETTINGS" and "ACK" not in f["flags"]), None)
return {
"settings": settings,
"settings_ack_sent_by_client": any(f["type"] == "SETTINGS" and "ACK" in f["flags"] for f in frames),
"frame_types_before_the_first_request": [f["type"] for f in before],
"window_updates_before_the_first_request": [{"stream": f["stream"], "increment": f["increment"]} for f in before if f["type"] == "WINDOW_UPDATE"],
"priority": [{"stream": f["stream"], **{k: f[k] for k in ("depends_on", "weight", "exclusive")}} for f in frames if f["type"] == "PRIORITY"],
"priority_update": [{"stream": f["stream"], "element": f["element"], "field": f["field"]} for f in frames if f["type"] == "PRIORITY_UPDATE"],
"headers_priority": [dict(f["priority"], stream=f["stream"]) for f in frames if f["type"] == "HEADERS" and "priority" in f],
"frames_after_the_first_request": len(frames) - first_headers,
}
class H2Connection:
"""The server side of one HTTP/2 connection, with a tap on the frames. ``serve(sock)`` blocks until the peer closes. Each request is recorded as
``{"stream", "pseudo_order": [":method", ...], "header_names": [...], "headers": [[name, value], ...], "end_stream"}`` and answered by ``responder``."""
def __init__(self, responder: Callable[[Dict[str, Any]], Tuple[int, List[Tuple[str, str]], bytes]], alt_svc: Optional[str] = None,
clock: Callable[[], float] = time.monotonic) -> None:
import h2.config
import h2.connection
config = h2.config.H2Configuration(client_side=False, header_encoding=None, validate_inbound_headers=False, normalize_inbound_headers=False,
validate_outbound_headers=False, normalize_outbound_headers=False)
self.conn = h2.connection.H2Connection(config=config)
self.responder = responder
self.alt_svc = alt_svc
self.tap = FrameTap()
self.requests: List[Dict[str, Any]] = []
self._bodies: Dict[int, int] = {}
#: ``clock()`` is stamped on a request as ``written_t`` once its whole answer (headers, body, end of stream) has been written to the socket; the answers waiting for that are here.
self._clock = clock
self._unwritten: List[Dict[str, Any]] = []
def summary(self) -> Dict[str, Any]:
return dict(summarize_frames(self.tap.frames), requests=list(self.requests))
def serve(self, sock: Any) -> None:
import h2.events
import h2.exceptions
self.conn.initiate_connection()
sock.sendall(self.conn.data_to_send())
while True:
data = sock.recv(65536)
if not data:
return
try:
self.tap.feed(data)
events = self.conn.receive_data(data)
except (h2.exceptions.ProtocolError, ValueError):
out = self.conn.data_to_send()
if out:
sock.sendall(out)
return
for event in events:
if isinstance(event, h2.events.RequestReceived):
self._request(event)
if event.stream_ended is not None:
self._answer(event.stream_id)
elif isinstance(event, h2.events.DataReceived):
self._bodies[event.stream_id] = self._bodies.get(event.stream_id, 0) + len(event.data)
self.conn.acknowledge_received_data(event.flow_controlled_length, event.stream_id)
elif isinstance(event, h2.events.StreamEnded):
self._answer(event.stream_id)
elif isinstance(event, h2.events.ConnectionTerminated):
return
out = self.conn.data_to_send()
if out:
sock.sendall(out)
for request in self._unwritten:
request["written_t"] = round(self._clock(), 3)
self._unwritten.clear()
def _request(self, event: Any) -> None:
headers = [[_text(n), _text(v)] for n, v in event.headers]
self.requests.append({"stream": event.stream_id, "pseudo_order": [n for n, _v in headers if n.startswith(":")],
"header_names": [n for n, _v in headers if not n.startswith(":")], "headers": headers,
"end_stream": event.stream_ended is not None})
def _answer(self, stream_id: int) -> None:
request = next((r for r in self.requests if r["stream"] == stream_id and not r.get("answered")), None)
if request is None:
return
request["answered"] = True
self._unwritten.append(request)
fields = {n: v for n, v in request["headers"]}
status, headers, body = self.responder({"method": fields.get(":method", ""), "target": fields.get(":path", ""), "headers": request["headers"],
"scheme": "https", "protocol": "h2", "body_length": self._bodies.get(stream_id, 0)})
extra = [("alt-svc", self.alt_svc)] if self.alt_svc else []
out = [(":status", str(status))] + [(n.lower(), v) for n, v in list(headers) + extra if n.lower() != "content-length"]
out.append(("content-length", str(len(body))))
self.conn.send_headers(stream_id, out)
self.conn.send_data(stream_id, body, end_stream=True)
def _text(value: Any) -> str:
return value.decode("latin-1") if isinstance(value, (bytes, bytearray)) else str(value)
# ---------------------------------------------------------------------------------------------------------------------------------- QUIC / HTTP/3
def read_varint(data: bytes, at: int) -> Tuple[int, int]:
"""A QUIC variable-length integer at ``data[at:]``: ``(value, the index after it)``."""
first = data[at]
size = 1 << (first >> 6)
if at + size > len(data):
raise ValueError("a variable-length integer is cut short")
return int.from_bytes(bytes([first & 0x3F]) + data[at + 1:at + size], "big"), at + size
def parse_quic_transport_parameters(raw: bytes) -> List[Dict[str, Any]]:
"""The transport parameters a QUIC client sent, in the order it sent them. A reserved id (31 * N + 27) is ``"GREASE"`` and loses its value; an
identifier or a secret (connection ids, the reset token, the preferred address) keeps only its length; any other integer parameter its value."""
out: List[Dict[str, Any]] = []
at = 0
while at < len(raw):
identifier, at = read_varint(raw, at)
length, at = read_varint(raw, at)
value = raw[at:at + length]
if len(value) < length:
raise ValueError("a transport parameter is cut short")
at += length
if _grease_quic(identifier):
out.append({"id": GREASE, "length": length})
continue
entry: Dict[str, Any] = {"id": identifier, "name": QUIC_PARAMETER_NAMES.get(identifier, "param_%d" % identifier), "length": length}
if identifier not in QUIC_OPAQUE and 0 < length <= 8 and identifier not in (0x11,):
try:
entry["value"], end = read_varint(value, 0)
if end != length:
del entry["value"]
except ValueError:
pass
out.append(entry)
return out
H3_SETTING_NAMES = {0x01: "QPACK_MAX_TABLE_CAPACITY", 0x06: "MAX_FIELD_SECTION_SIZE", 0x07: "QPACK_BLOCKED_STREAMS", 0x08: "ENABLE_CONNECT_PROTOCOL",
0x33: "H3_DATAGRAM", 0x276: "H3_DATAGRAM_DRAFT04", 0x2B603742: "ENABLE_WEBTRANSPORT"}
def h3_settings(settings: Optional[Dict[int, int]]) -> Optional[List[List[Any]]]:
"""The SETTINGS frame of an HTTP/3 client as ``[[name, value], ...]``; a reserved identifier (0x1f * N + 0x21) is ``"GREASE"``."""
if settings is None:
return None
return [["GREASE" if (k >= 0x21 and (k - 0x21) % 0x1F == 0) else H3_SETTING_NAMES.get(int(k), "0x%x" % int(k)), v] for k, v in settings.items()]
# --------------------------------------------------------------------------------------------------------------------------- the lab server
PAGE = (b"<!doctype html><meta charset=utf-8><title>wire</title><link rel=stylesheet href=/wire.css><script src=/wire.js></script>"
b"<p>wire</p><img src=/wire.svg alt=''>")
def default_responder(request: Dict[str, Any]) -> Tuple[int, List[Tuple[str, str]], bytes]:
"""A small site: a page that loads a style, a script and an image, sets a cookie, and answers a POST."""
target = request["target"].split("?")[0]
if target == "/":
return 200, [("content-type", "text/html; charset=utf-8"), ("set-cookie", "wire=1; Path=/; SameSite=Lax"), ("cache-control", "no-store")], PAGE
if target == "/wire.css":
return 200, [("content-type", "text/css"), ("cache-control", "no-store")], b"p{color:#333}"
if target == "/wire.js":
return 200, [("content-type", "text/javascript"), ("cache-control", "no-store")], b"window.__wire = 1;"
if target == "/wire.svg":
return 200, [("content-type", "image/svg+xml"), ("cache-control", "no-store")], b"<svg xmlns='http://www.w3.org/2000/svg' width='1' height='1'/>"
return 200, [("content-type", "text/plain"), ("access-control-allow-origin", "*"), ("cache-control", "no-store")], b"ok"
class _Handler(socketserver.BaseRequestHandler):
def handle(self) -> None:
self.server.owner._connection(self.request) # type: ignore[attr-defined]
class _Server(socketserver.ThreadingTCPServer):
allow_reuse_address = sys.platform != "win32"
daemon_threads = True
class WireServer:
"""One TLS server (TCP) and, with ``h3=True``, a QUIC server on the same port number, each connection written down.
``alpn`` is what the server OFFERS (``["h2", "http/1.1"]``, or ``["http/1.1"]`` for a server that only speaks HTTP/1.1): the client's offer is the same
either way, and what it reads is the answer. ``phase()`` names the stage of the run a connection or a request belongs to, at the time it arrives.
``connections`` is the list of the TLS connections, each ``{"id", "phase", "tls": <ClientHello>, "alpn": <selected>, "http1": [requests]}`` or
``{..., "h2": <H2Connection>}``; ``quic`` the QUIC connections ``{"phase", "transport_parameters", "h3_settings", "requests"}``. :meth:`snapshot` is the
JSON of all of it."""
def __init__(self, address: str = "127.0.0.1", *, alpn: Tuple[str, ...] = ("h2", "http/1.1"), h3: bool = False,
responder: Callable[[Dict[str, Any]], Tuple[int, List[Tuple[str, str]], bytes]] = default_responder,
phase: Callable[[], str] = lambda: "-", dns_names: Tuple[str, ...] = ("wire.test",), close_after_response: bool = False) -> None:
from _doh_servers import make_certificate
from _ports import bind_tcp_and_hold_udp
self.address, self.alpn, self.responder, self.phase = address, tuple(alpn), responder, phase
#: HTTP/1.1 only: every answer says ``Connection: close`` and ends its connection (see :func:`serve_http1`).
self.close_after_response = close_after_response
self._t0 = time.monotonic()
self.connections: List[Dict[str, Any]] = []
self.quic: List[Dict[str, Any]] = []
self.refused: List[str] = []
self._lock = threading.Lock()
self._dir = tempfile.TemporaryDirectory()
certificate, key = make_certificate(Path(self._dir.name), dns_names=dns_names, ip_addresses=(address,))
self._tls = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER)
self._tls.load_cert_chain(str(certificate), str(key))
self._tls.set_alpn_protocols(list(self.alpn))
self._udp: Optional[socket.socket] = None
if h3:
self._tcp, self.port, self._udp = bind_tcp_and_hold_udp(address, lambda host, number: _Server((host, number), _Handler), socket_module=socket)
else:
self._tcp = _Server((address, 0), _Handler)
self.port = self._tcp.server_address[1]
self.alt_svc = 'h3=":%d"; ma=3600' % self.port if h3 else None
self._tcp.owner = self # type: ignore[attr-defined]
threading.Thread(target=self._tcp.serve_forever, daemon=True).start()
self._loop = None
if h3:
self._start_quic(certificate, key)
@property
def url(self) -> str:
return "https://%s:%d/" % (self.address, self.port)
# --- TCP ------------------------------------------------------------------------------------------------------------------------------
def _connection(self, sock: socket.socket) -> None:
record: Dict[str, Any] = {"phase": self.phase(), "tls": None, "alpn": None, "t": self._now()}
with self._lock:
record["id"] = len(self.connections)
self.connections.append(record)
tls = None
try:
hello, tls = accept_with_hello(sock, self._tls)
record["tls"] = hello
record["alpn"] = tls.selected_alpn_protocol() or "http/1.1"
tls.settimeout(60)
if record["alpn"] == "h2":
record["h2"] = connection = H2Connection(self.responder, self.alt_svc, clock=self._now)
connection.serve(tls)
else:
record["http1"] = []
arrived: List[Dict[str, Any]] = [] # the request being answered: a connection serves one at a time, and the mark goes on the record kept for it
def on_request(r: Dict[str, Any]) -> None:
arrived[:] = [dict(r, phase=self.phase(), t=self._now())]
record["http1"].append(arrived[0])
def on_answered(_request: Dict[str, Any]) -> None:
arrived[0]["written_t"] = self._now()
serve_http1(tls, self.responder, on_request, self.alt_svc, self.close_after_response, on_answered)
except (ssl.SSLError, OSError, ConnectionError, NotAClientHello, TimeoutError) as exc:
record["error"] = "%s: %s" % (type(exc).__name__, exc)
finally:
for s in (tls, sock):
try:
if s is not None:
s.close()
except OSError:
pass
def _now(self) -> float:
"""Seconds since the server started: when a connection or a request arrived (evidence for a run that differs from itself; never compared)."""
return round(time.monotonic() - self._t0, 3)
# --- QUIC -----------------------------------------------------------------------------------------------------------------------------
def _start_quic(self, certificate: Path, key: Path) -> None:
import asyncio
from aioquic.asyncio.protocol import QuicConnectionProtocol
from aioquic.asyncio.server import QuicServer
from aioquic.h3.connection import H3_ALPN, H3Connection
from aioquic.h3.events import HeadersReceived
from aioquic.quic.configuration import QuicConfiguration
from aioquic.quic.events import ProtocolNegotiated
server = self
class Protocol(QuicConnectionProtocol):
def __init__(self, *args: Any, **kwargs: Any) -> None:
super().__init__(*args, **kwargs)
self._http: Optional[Any] = None
self._record: Dict[str, Any] = {}
def quic_event_received(self, event: Any) -> None:
if isinstance(event, ProtocolNegotiated):
self._http = H3Connection(self._quic)
raw = next((data for kind, data in (self._quic.tls.received_extensions or []) if kind in (0x39, 0xFFA5)), b"")
peer = self._quic._network_paths[0].addr
self._record = {"phase": server.phase(), "alpn": event.alpn_protocol, "peer": [peer[0], peer[1]],
"transport_parameters": parse_quic_transport_parameters(raw), "h3_settings": None, "requests": []}
with server._lock:
server.quic.append(self._record)
if self._http is None:
return
for http_event in self._http.handle_event(event):
if isinstance(http_event, HeadersReceived):
headers = [[_text(n), _text(v)] for n, v in http_event.headers]
self._record["h3_settings"] = h3_settings(self._http.received_settings)
request = {
"stream": http_event.stream_id, "pseudo_order": [n for n, _v in headers if n.startswith(":")],
"header_names": [n for n, _v in headers if not n.startswith(":")], "headers": headers,
"phase": server.phase(), "t": server._now()}
self._record["requests"].append(request)
fields = dict(headers)
status, out, body = server.responder({"method": fields.get(":method", ""), "target": fields.get(":path", ""), "headers": headers,
"scheme": "https", "protocol": "h3", "body_length": 0})
self._http.send_headers(http_event.stream_id, [(b":status", str(status).encode())] +
[(n.lower().encode(), v.encode()) for n, v in out if n.lower() != "content-length"] +
[(b"content-length", str(len(body)).encode())])
self._http.send_data(http_event.stream_id, body, end_stream=True)
self.transmit()
request["written_t"] = server._now() # the datagrams that carry the whole answer have left the socket
configuration = QuicConfiguration(is_client=False, alpn_protocols=H3_ALPN)
configuration.load_cert_chain(str(certificate), str(key))
self._loop = asyncio.new_event_loop()
started = threading.Event()
def run() -> None:
asyncio.set_event_loop(self._loop)
_transport, self._quic = self._loop.run_until_complete(self._loop.create_datagram_endpoint(
lambda: QuicServer(configuration=configuration, create_protocol=Protocol), sock=self._udp))
started.set()
try:
self._loop.run_forever()
finally:
# The loop is closed HERE, on its own thread, after the QUIC server (as tests/_h3_server.py does): a loop that is only stopped is closed
# later by the garbage collector on whatever thread it runs in, and on Windows the proactor's close then waits for ever.
self._quic.close()
for _ in range(3): # a few turns of the loop let the closing transport flush
self._loop.run_until_complete(asyncio.sleep(0))
self._loop.close()
self._thread = threading.Thread(target=run, daemon=True)
self._thread.start()
if not started.wait(30):
raise RuntimeError("the QUIC server did not start")
# --- what a test or the oracle reads --------------------------------------------------------------------------------------------------
def answered_at(self, path: str) -> Optional[float]:
"""When the server finished WRITING the answer to a request for ``path`` (the query is not part of it), whatever the transport it rode: seconds since the server started
(the scale of ``t``), or None while no such request has been answered in full. A request that has arrived but whose answer is not all written is not answered: the mark is
stamped after the last byte (HTTP/1.1, HTTP/2) or the last datagram (HTTP/3) is handed to the socket, in the one place that writes it."""
with self._lock:
connections = list(self.connections)
quic = list(self.quic)
marks: List[float] = []
for c in connections:
requests = [(r["target"], r) for r in list(c.get("http1") or [])]
if "h2" in c:
requests += [(dict(r["headers"]).get(":path", ""), r) for r in list(c["h2"].requests)]
marks += [r["written_t"] for target, r in requests if target.split("?")[0] == path and "written_t" in r]
for q in quic:
marks += [r["written_t"] for r in list(q["requests"]) if dict(r["headers"]).get(":path", "").split("?")[0] == path and "written_t" in r]
return min(marks) if marks else None
def snapshot(self) -> Dict[str, Any]:
with self._lock:
connections = list(self.connections)
quic = list(self.quic)
out: List[Dict[str, Any]] = []
for c in connections:
item = {"id": c["id"], "phase": c["phase"], "tls": c["tls"], "alpn": c["alpn"], "t": c.get("t")}
if "h2" in c:
item["h2"] = c["h2"].summary()
if "http1" in c:
item["http1"] = list(c["http1"])
if "error" in c:
item["error"] = c["error"]
out.append(item)
return {"connections": out, "quic": quic}
def close(self) -> None:
self._tcp.shutdown()
self._tcp.server_close()
if self._loop is not None and not self._loop.is_closed():
self._loop.call_soon_threadsafe(self._loop.stop)
self._thread.join(30)
self._dir.cleanup()
def __enter__(self) -> "WireServer":
return self
def __exit__(self, *exc: Any) -> None:
self.close()
+68 -13
View File
@@ -40,17 +40,59 @@ def _normal(ip: str) -> str:
return (mapped or parsed).compressed
def host_addresses() -> Set[str]:
"""Every IPv4 and IPv6 address assigned to an interface of this machine (loopback and link-local included), normalised.
``psutil`` is a dependency of the package and answers the same on Linux and on Windows."""
import psutil
class HostInterfacesUnreadable(RuntimeError):
"""The interfaces of this host could not be listed. Whatever decides by them (is a source the browser's? is a destination the lab's?) must fail
with this, never decide on an empty list in its place."""
found: Set[str] = set()
for addresses in psutil.net_if_addrs().values():
for entry in addresses:
if entry.family in _IP_FAMILIES:
found.add(_normal(entry.address))
return found
def how_host_interfaces_are_read() -> str:
"""How :func:`read_host_interfaces` lists the interfaces, said in the record of a reader (the version of ``psutil`` included)."""
try:
import psutil
version = psutil.__version__
except Exception as exc: # the reading itself raises it, with its cause: here it is only said
version = "not importable: %s: %s" % (type(exc).__name__, exc)
return "psutil.net_if_addrs() (psutil %s): the AF_INET and AF_INET6 entries of every interface, normalised (zone id dropped, " \
"IPv4-mapped read as IPv4, lower case)" % version
def read_host_interfaces() -> Dict[str, List[str]]:
"""Every IPv4 and IPv6 address assigned to an interface of this machine (loopback and link-local included), normalised, by interface name.
``psutil`` is a dependency of the package and answers the same on Linux and on Windows.
Raises :class:`HostInterfacesUnreadable` when the list cannot be read: ``psutil`` does not import, ``net_if_addrs()`` raises, an entry of an IP
family is not an address, or no interface has any IP address at all (every host has loopback: an empty list is a failed reading)."""
try:
import psutil
table = psutil.net_if_addrs()
except Exception as exc:
raise HostInterfacesUnreadable("the interfaces of this host could not be read (%s): %s: %s"
% (how_host_interfaces_are_read(), type(exc).__name__, exc)) from exc
interfaces: Dict[str, List[str]] = {}
for name, entries in table.items():
for entry in entries:
if entry.family not in _IP_FAMILIES:
continue
normal = _normal(entry.address)
try:
ipaddress.ip_address(normal)
except ValueError:
raise HostInterfacesUnreadable("interface %r lists %r as an address of family %s, and it is not one"
% (name, entry.address, entry.family)) from None
listed = interfaces.setdefault(name, [])
if normal not in listed:
listed.append(normal)
if not interfaces:
raise HostInterfacesUnreadable("psutil.net_if_addrs() listed no IPv4 or IPv6 address on any interface (not even loopback): %r"
% sorted(table))
return interfaces
def host_addresses() -> Set[str]:
"""Every address of :func:`read_host_interfaces`, of every interface (raises :class:`HostInterfacesUnreadable` as it does)."""
return {address for addresses in read_host_interfaces().values() for address in addresses}
def is_host_source(ip: str, known: Set[str]) -> bool:
@@ -71,6 +113,8 @@ class Witness:
self.tcp: List[Tuple[str, int]] = []
self.foreign_udp: List[Tuple[str, int, int]] = []
self.foreign_tcp: List[Tuple[str, int]] = []
#: Every failed reading of the interfaces after the start (the first one raises here): :meth:`heard` raises while any is listed.
self.read_errors: List[str] = []
self._host: Set[str] = host_addresses() | {_normal(address)}
self._lock = threading.Lock()
self._closed = False
@@ -113,24 +157,35 @@ class Witness:
# --- what a test reads ------------------------------------------------------------------------------------------
def heard(self) -> Dict[str, list]:
self._raise_if_unread()
with self._lock:
return {"udp": list(self.udp), "tcp": list(self.tcp)}
def heard_foreign(self) -> Dict[str, list]:
"""What reached the witness from a source that is NOT an address of this host: not the browser, noise from the network."""
self._raise_if_unread()
with self._lock:
return {"udp": list(self.foreign_udp), "tcp": list(self.foreign_tcp)}
def _is_host(self, ip: str) -> bool:
"""Whether ``ip`` is an address of this host; a miss looks at the interfaces again (an address added since) before it is foreign."""
"""Whether ``ip`` is an address of this host; a miss looks at the interfaces again (an address added since) before it is foreign. A reading
that fails is never a silent "foreign": the arrival is kept as the host's (a direct send is not hidden) and every reader of the witness raises."""
if is_host_source(ip, self._host):
return True
try:
self._host |= host_addresses()
except Exception:
return False
except HostInterfacesUnreadable as exc:
with self._lock:
self.read_errors.append(str(exc))
return True
return is_host_source(ip, self._host)
def _raise_if_unread(self) -> None:
with self._lock:
errors = list(self.read_errors)
if errors:
raise HostInterfacesUnreadable("the witness could not read the interfaces of this host again: %s" % "; ".join(errors))
def heard_from_other_than(self, allowed: Iterable[str]) -> Dict[str, list]:
"""What the witness heard from a source that is not one of ``allowed`` (the exit of the proxy): a direct send."""
ok = set(allowed)
Loaded 100 of 344 files, more files were not shown because too many files have changed in this diff. Show more