Skip to main content
Everything so far has been a command of your own. Most of what your team runs is not — it is aspect build and aspect test, which ship with the CLI. .aspect/config.axl applies to every task in the repository, including those. It is where you change how the built-ins behave.

Run it

That is the flaky test from the last section, run through the built-in aspect test — a command nobody here wrote. Run it a few times:
Two things changed about a command you did not write: Bazel retried the test, and something noticed.

How it works

Twenty-seven lines. Open .aspect/config.axl.
A Bazel flag, added to every invocation this repository makes. Without it there is no such thing as a flaky test here: Bazel runs the test once, it fails, and that is all anyone sees. The retry is what makes “flaky” a distinct outcome from “failed”.
The same test_summary events aspect observe read in the last section, and the same overall_status field. The difference is where they come from: observe asked for them because it started the build, and this hook receives them from a build it had nothing to do with.
post_task runs when the task ends, which is when there is something worth saying.

The order matters

The two halves are not independent. The flag is what makes flaky reachable; the hook is what reports it. Take the flag away and the hook is correct and silent — the status it watches for never occurs. Try it: change --flaky_test_attempts=3 to =1 in config.axl and run the test until it fails.
A plain failure, no FLAKE CAUGHT. Bazel ran the test once, so nothing was ever retried, so nothing was ever flaky.
Next: generate the targets nobody wants to hand-write.