Repository navigation
ci: measure test determinism on macOS and Windows as well as Linux - #1700
Conversation
netzenbot-reviewer
left a comment
There was a problem hiding this comment.
Recommendation: approve
What this pull request does
The weekly Test determinism workflow now has four measure legs instead of two: Linux at 4 threads, Linux at 16 threads, macOS and Windows, with the macOS and Windows legs using cargo's default parallelism. The macOS and Linux 16-thread legs file Flaky test: issues. The Linux 4-thread and Windows legs file nothing, and Windows only reports in its job summary because the suite is not expected to pass there (#88). Legs run one at a time (max-parallel: 1) so a test that flakes on two platforms is filed once. In contrib/measure-flakes.py, machine() now appends the operating system (for example "4 CPUs running macOS"), so reports and issues say which platform produced a rate, and a selftest check covers this. docs/development/checks.md is updated to describe the legs. The workflow changes are not covered by any test in the tree, and the Windows leg has never run, so it may hang rather than fail (bounded by a 120 minute timeout).
Trying it by hand
The description does not say how to try this change. These steps would:
- Run
python3 contrib/measure-flakes.py --selftestand expect every check to pass, including "a rate arrives with the operating system that produced it". - Run
python3 contrib/measure-flakes.py --runs 2locally and check that the report names the machine as " CPUs running <Linux|macOS|Windows>". - Parse
.github/workflows/test-determinism.yml(for example with a YAML linter oractionlint) and confirm the measure job's matrix has four legs: Linux 4 threads, Linux 16 threads, macOS, Windows. - From the PR branch, start the Test determinism workflow with
gh workflow run test-determinism.yml --ref <branch> -f runs=2and confirm the four legs run one after another, not in parallel. - Check that the Windows leg completes or times out within 120 minutes, writes a job summary and opens no issue. Confirm that the macOS and Linux 16-thread legs would file issues only for a test that actually flakes.
- Open the job summary of each leg and confirm the reported machine line names the operating system of that leg.
Missing from the description
- A
User impact:line above the first heading: what a person using the product can now see, ornoneand why not. - A
## Reproducesection. - A
## The fixsection.
How this review reached its recommendation
The review read 3 changed files.
What it checked:
- Written best practices. The changes were compared with 11 rules from this project's best-practice documents (dependencies, shared-implementation, specs, tests, writing).
- Bugs. The changes were read for mistakes that would make the code misbehave or stop it building.
- This project's own criteria. The changes were checked against these questions:
- Whether the change agrees with the project's specs, and whether a change to behaviour a spec describes also updates that spec and its tests.
- Whether untrusted content (text from the web, files or tools) can influence a decision, or be given a better trust label than it came with, anywhere other than the places built for that.
- Whether the tests would fail if the behaviour broke, rather than covering only the allowed case or passing with the bug put back.
- Whether the change does what its title says and nothing more, with no unrelated refactor and no new dependency, permission or network destination the title does not explain.
None of these checks flagged anything, so there was nothing to double-check.
2c9c887 to
ea33799
Compare
netzenbot-reviewer
left a comment
There was a problem hiding this comment.
Recommendation: approve
Missing from the description
- A
User impact:line above the first heading: what a person using the product can now see, ornoneand why not. - A
## Reproducesection. - A
## The fixsection.
How this review reached its recommendation
The review read 0 of the 3 changed files: only those that changed since the bot last reviewed this pull request.
None of these checks flagged anything, so there was nothing to double-check.
The weekly sweep ran only on Linux, so a test that loses runs on macOS, such as the Seatbelt shim test, was never measured. The macOS leg files issues; the Windows leg reports only, since the suite is not expected to pass there (brave#88). Legs run one at a time so a test that flakes on two platforms is filed once, and each report names its operating system.
ea33799 to
60c2dbc
Compare
netzenbot-reviewer
left a comment
There was a problem hiding this comment.
Recommendation: approve
What this pull request does
The weekly Test determinism workflow now has four matrix legs instead of two Linux ones: Linux at 4 threads, Linux at 16 threads, macOS and Windows. The macOS and Windows legs use cargo's default parallelism. The Linux 16 thread leg and the macOS leg file Flaky test: issues. The Linux 4 thread leg and the Windows leg do not file, and the Windows leg only writes a job summary because the suite is not expected to pass there yet. Legs run one at a time (max-parallel: 1) so a test that flakes on two platforms is filed once, and the Windows leg uses python, a GNU toolchain and a 120 minute timeout. In contrib/measure-flakes.py, machine() now appends the operating system (for example 4 CPUs running macOS) so reports and issues say which platform produced the rate, with a new selftest check for it, and docs/development/checks.md describes the legs. The diff matches the description.
Trying it by hand
The description does not say how to try this change. These steps would:
- From the repo root run
python3 contrib/measure-flakes.py --selftest. Expect all 25 checks to pass, including 'a rate arrives with the operating system that produced it'. - Run
python3 -c "import importlib.machinery as m, importlib.util as u; l=m.SourceFileLoader('mf','contrib/measure-flakes.py'); s=u.spec_from_loader('mf',l); mod=u.module_from_spec(s); l.exec_module(mod); print(mod.machine())". Expect a string like8 CPUs running Linux. On a Mac it should saymacOS, notDarwin. - Check the workflow file parses and the
measurejob matrix lists four legs: Linux 4 threads, Linux 16 threads, macOS and Windows. Only the Linux 16 thread and macOS legs should setissuesto the repository. - From the PR branch, start the Test determinism workflow with
gh workflow run test-determinism.yml --ref <branch> -f runs=2. Expect fourmeasurejobs that run one after another in the order Linux 4, Linux 16, macOS, Windows. - Open each leg's job summary. Expect the rate line to name the platform (
running Linux,running macOS,running Windows). - Check the Windows leg: it should finish within its 120 minute timeout, show a summary, and create no
Flaky test:issue. Whether the suite hangs there instead of failing is unconfirmed, so watch for a timeout. - Check the issue list after the run. With
runs=2any issue filed by the Linux 16 thread or macOS leg should name the platform, and a second leg that sees the same flake should not open a duplicate.
Missing from the description
- A
User impact:line above the first heading: what a person using the product can now see, ornoneand why not. - A
## Reproducesection. - A
## The fixsection.
How this review reached its recommendation
The review read 0 of the 3 changed files: only those that changed since the bot last reviewed this pull request.
None of these checks flagged anything, so there was nothing to double-check.
Summary
The weekly Test determinism workflow ran only on Linux, so a test that loses runs on macOS was never measured.
macos::tests::a_developer_tool_the_platform_ships_as_a_shim_starts_under_the_baseis one: it exists only on macOS and fails on a share of runs (#1698).The measure job now has four legs: Linux at 4 threads, Linux at 16 threads, macOS and Windows. The macOS and Windows legs use cargo's default parallelism, as the macOS job in
ci.ymldoes.ci.ymldoes not run the suite on Windows (platforms: Windows binaries are published, but there is no confinement #88), so most of it fails every run. A test that fails every run is not named, but one that passes now and then would be filed as a flake.max-parallel: 1), so a test that flakes on two platforms is filed by the first leg and found as already filed by the next.machine()incontrib/measure-flakes.pynow names the operating system, so a report and an issue say which platform produced the rate.docs/development/checks.mddescribes the legs.Test plan
python3 contrib/measure-flakes.py --selftestpasses (25 checks),make check-all-selftest,make check-narrationandmake check-securitypass.Which plausible regression do the changed tests reject? The new selftest check, "a rate arrives with the operating system that produced it", fails when
machine()stops naming the operating system (observed by removing it: 1 of 25 checks failed). The workflow legs have no test in this tree. They are exercised by aworkflow_dispatchrun withruns=2from this branch, and by Monday's scheduled run. The Windows leg has not run before: the suite may hang there instead of failing, which its 120 minute timeout bounds.