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:
@@ -283,7 +283,7 @@ void main() {
|
||||
addTearDown(n.dispose);
|
||||
|
||||
n.warn('clide CLI not on PATH', title: 'dogfood');
|
||||
await Future<void>.delayed(Duration.zero);
|
||||
await pumpEventQueue();
|
||||
|
||||
expect(toasts.entries, hasLength(1));
|
||||
expect(toasts.entries.single.message, 'dogfood — clide CLI not on PATH');
|
||||
@@ -299,7 +299,7 @@ void main() {
|
||||
|
||||
n.error('boom');
|
||||
n.success('done');
|
||||
await Future<void>.delayed(Duration.zero);
|
||||
await pumpEventQueue();
|
||||
|
||||
expect(toasts.entries.map((e) => e.severity), [ToastSeverity.error, ToastSeverity.success]);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user