Skip to content

ci: measure test determinism on macOS and Windows as well as Linux - #1700

Merged
bbondy merged 1 commit into
brave:mainfrom
netzenbot:measure-flakes-on-every-platform
Oct 6, 2026
Merged

bbondy merged 1 commit into
brave:mainfrom
netzenbot:measure-flakes-on-every-platform

Conversation

@netzenbot

Copy link
Copy Markdown
Collaborator

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_base is 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.yml does.

  • The Linux 16 thread leg and the macOS leg file issues. The Linux 4 thread leg does not, as before.
  • The Windows leg reports in its job summary and files nothing. ci.yml does 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.
  • Legs run one at a time (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() in contrib/measure-flakes.py now names the operating system, so a report and an issue say which platform produced the rate. docs/development/checks.md describes the legs.

Test plan

  • python3 contrib/measure-flakes.py --selftest passes (25 checks), make check-all-selftest, make check-narration and make check-security pass.
  • The workflow file parses and the matrix has the four legs.

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 a workflow_dispatch run with runs=2 from 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.

@netzenbot-reviewer netzenbot-reviewer left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

  1. Run python3 contrib/measure-flakes.py --selftest and expect every check to pass, including "a rate arrives with the operating system that produced it".
  2. Run python3 contrib/measure-flakes.py --runs 2 locally and check that the report names the machine as " CPUs running <Linux|macOS|Windows>".
  3. Parse .github/workflows/test-determinism.yml (for example with a YAML linter or actionlint) and confirm the measure job's matrix has four legs: Linux 4 threads, Linux 16 threads, macOS, Windows.
  4. From the PR branch, start the Test determinism workflow with gh workflow run test-determinism.yml --ref <branch> -f runs=2 and confirm the four legs run one after another, not in parallel.
  5. 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.
  6. 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, or none and why not.
  • A ## Reproduce section.
  • A ## The fix section.
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.

@netzenbot
netzenbot force-pushed the measure-flakes-on-every-platform branch from 2c9c887 to ea33799 Compare October 6, 2026 18:34

@netzenbot-reviewer netzenbot-reviewer left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Recommendation: approve

Missing from the description

  • A User impact: line above the first heading: what a person using the product can now see, or none and why not.
  • A ## Reproduce section.
  • A ## The fix section.
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.
@netzenbot
netzenbot force-pushed the measure-flakes-on-every-platform branch from ea33799 to 60c2dbc Compare October 6, 2026 19:13

@netzenbot-reviewer netzenbot-reviewer left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

  1. 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'.
  2. 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 like 8 CPUs running Linux. On a Mac it should say macOS, not Darwin.
  3. Check the workflow file parses and the measure job matrix lists four legs: Linux 4 threads, Linux 16 threads, macOS and Windows. Only the Linux 16 thread and macOS legs should set issues to the repository.
  4. From the PR branch, start the Test determinism workflow with gh workflow run test-determinism.yml --ref <branch> -f runs=2. Expect four measure jobs that run one after another in the order Linux 4, Linux 16, macOS, Windows.
  5. Open each leg's job summary. Expect the rate line to name the platform (running Linux, running macOS, running Windows).
  6. 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.
  7. Check the issue list after the run. With runs=2 any 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, or none and why not.
  • A ## Reproduce section.
  • A ## The fix section.
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.

@bbondy
bbondy merged commit c4adb61 into brave:main Oct 6, 2026
31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants