test: deflake the suite — pumpEventQueue instead of Future.delayed(Duration.zero)

~173 `await Future<void>.delayed(Duration.zero)` async-settle waits across 25
test files yield the microtask queue exactly once; when an event→handler chain
needs more than one hop they lose the race under CI's parallel load, so the
failing set varied run to run. Replace with `await pumpEventQueue()` (the
deterministic drain already used elsewhere in the suite); rewired the shared
settle()/tick() helpers in one shot. menu_bar's toggle-close test gets a bounded
extra pump. Verified green under CI=true.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-14 23:13:13 +02:00
co-authored by Claude Opus 4.8
parent 3dce5c614d
commit e55b4a9173
26 changed files with 175 additions and 174 deletions
+2 -2
View File
@@ -175,9 +175,9 @@ void main() {
final s2 = f.services.events.on<ExtensionDeactivated>().listen((e) => deactivated.add(e.id));
f.services.extensions.register(_Ext(id: 'e'));
await f.services.extensions.activateAll();
await Future<void>.delayed(Duration.zero);
await pumpEventQueue();
await f.services.extensions.deactivate('e');
await Future<void>.delayed(Duration.zero);
await pumpEventQueue();
expect(activated, ['e']);
expect(deactivated, ['e']);
await s1.cancel();