[Bug] Tests wait on a fixed delay instead of the observable outcome #513
Labels
No labels
accepted
bug
declined
docs
duplicate
enhancement
good first issue
in-progress
needs-info
privacy
security
triage
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
LibreKAT/Ocideck#513
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Four tests were repaired in a single day with the same defect: they wait on real disk or isolate work using a fixed
Future.delayedinsiderunAsync, instead of waiting for the observable outcome.test/shell_export_actions_test.dart— twice. The wait ended when the file appeared, but the assertion was on the confirmation message, which is only built once the rest of the future completes.test/signature_draw_test.darttest/duplicate_cleanup_dialog_test.dart— fixed 50 ms and 100 ms sleepsThey all pass in isolation and fail under a loaded
make check. That is the worst failure mode: the test is re-run, passes, and everyone concludes it was a fluke. It costs an hour of looking for a bug that is not there, every busy day.Proposed guard. This pattern is greppable: a
Future.delayedwith a constant duration inside arunAsyncblock intest/. A check intool/that fails on it, with a baseline that can only shrink, would stop the habit spreading. The replacement is a bounded pump-until-condition helper with a time limit, so genuinely stuck I/O still fails the test instead of hanging the suite —settleAsyncinshell_export_actions_test.dartand_wachtTotinduplicate_cleanup_dialog_test.dartare two worked examples.Worth checking whether more instances exist before building the guard: the four above were found incidentally, not by searching.