feat: bewaak dat een test op het resultaat wacht en niet op de klok #530

Merged
brenno merged 1 commit from feat/vaste-vertragingen-poort into main 2026-07-22 10:44:03 +00:00
Owner

Summary

Adds the gate the issue asked for. Note what it does not do, because the situation had moved on since the issue was written.

Closes #513

The instances are already gone

The issue names four repaired tests and asks whether more exist. A sweep of test/ finds zero remaining Future.delayed in executable code — the only two occurrences are inside comments, and test/support/pump_until.dart now exists and is used by six test files.

So the code half is done. What was missing is the half that matters for tomorrow: nothing stopped the habit coming back. That is the same shape as #150#506, and it is exactly why this issue was accepted as the carrier of the guard rather than of a fix.

The rule

A Future.delayed( inside a runAsync( window in test/ fails make check-conventions. Baseline zero, no exceptions list — there is nothing to baseline.

Line comments are stripped before matching. Without that the gate trips over its own counter-example: pump_until.dart spells the anti-pattern out in full to explain why it is wrong. A gate that forbids its own documentation gets switched off, and deservedly.

Verification, both directions

  • fires on a planted runAsync(() => Future.delayed(const Duration(milliseconds: 80)));
  • stays silent on pump_until.dart, whose doc comment contains that exact text.

Gates

make check green. make check-secrets / make sast still red for the pre-existing reasons in #522 and #521.

Principles

No format, storage, dependency or outgoing traffic. Adds a constraint on us, not on the user's files.

## Summary Adds the gate the issue asked for. Note what it does **not** do, because the situation had moved on since the issue was written. Closes #513 ## The instances are already gone The issue names four repaired tests and asks whether more exist. A sweep of `test/` finds **zero** remaining `Future.delayed` in executable code — the only two occurrences are inside comments, and `test/support/pump_until.dart` now exists and is used by six test files. So the code half is done. What was missing is the half that matters for tomorrow: nothing stopped the habit coming back. That is the same shape as #150 → #506, and it is exactly why this issue was accepted as the carrier of the guard rather than of a fix. ## The rule A `Future.delayed(` inside a `runAsync(` window in `test/` fails `make check-conventions`. Baseline zero, no exceptions list — there is nothing to baseline. **Line comments are stripped before matching.** Without that the gate trips over its own counter-example: `pump_until.dart` spells the anti-pattern out in full to explain why it is wrong. A gate that forbids its own documentation gets switched off, and deservedly. ## Verification, both directions - fires on a planted `runAsync(() => Future.delayed(const Duration(milliseconds: 80)))`; - stays silent on `pump_until.dart`, whose doc comment contains that exact text. ## Gates `make check` green. `make check-secrets` / `make sast` still red for the pre-existing reasons in #522 and #521. ## Principles No format, storage, dependency or outgoing traffic. Adds a constraint on us, not on the user's files.
feat(poort): geen vaste vertraging binnen runAsync in tests
Some checks failed
CI / Gate (Linux) · Format · Analyze · Coverage (push) Has been cancelled
CI / Test (macos-latest) (push) Has been cancelled
CI / Test (windows-latest) (push) Has been cancelled
CI / Web hardening (push) Has been cancelled
CI / Docs links (push) Has been cancelled
CI / Supply-chain (Trivy · advisory) (push) Has been cancelled
CI / Gate (Linux) · Format · Analyze · Coverage (pull_request) Has been cancelled
CI / Test (macos-latest) (pull_request) Has been cancelled
CI / Test (windows-latest) (pull_request) Has been cancelled
CI / Web hardening (pull_request) Has been cancelled
CI / Docs links (pull_request) Has been cancelled
CI / Supply-chain (Trivy · advisory) (pull_request) Has been cancelled
0fdd11e736
Vier tests werden op één dag om dezelfde reden gerepareerd: ze wachtten
binnen runAsync op een vaste klok in plaats van op het resultaat. Die
slagen los en falen onder een volle make check — de duurste faalvorm die
er is, want de test wordt opnieuw gedraaid, slaagt, en dan heet het
toeval.

De vier gevallen zijn intussen weg en test/support/pump_until.dart staat
er. Wat ontbrak is de poort: niets hield de gewoonte tegen.

Regelcommentaar wordt eerst weggehaald. Zonder dat valt de poort over
zijn eigen tegenvoorbeeld — pump_until.dart schrijft het antipatroon
voluit op om uit te leggen waarom het fout is, en een poort die zijn eigen
uitleg verbiedt wordt terecht weggezet.

Getoetst in twee richtingen: alarm op een geplante Future.delayed binnen
runAsync, en stilte over het doc-commentaar dat hem noemt.

Closes #513

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
brenno merged commit a1217db387 into main 2026-07-22 10:44:03 +00:00
brenno deleted branch feat/vaste-vertragingen-poort 2026-07-22 10:44:04 +00:00
Sign in to join this conversation.
No description provided.