Skip to content

Commit d687c52

Browse files
committed
Add some delays
Resolves some tests which were sensitive to particular async event counts in ways that should not impact the production code. Only a microtask is required, so these could be `await null`. Use `pumpEventQueue()` anyway so the intent is clear.
1 parent 742a99e commit d687c52

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

build_runner/test/server/serve_handler_test.dart

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,7 @@ void main() {
327327
await createMockConnection(serverChannel1, 'web');
328328
await createMockConnection(serverChannel2, 'web');
329329
await handler.emitUpdateMessage(BuildResult(BuildStatus.success, []));
330+
await pumpEventQueue();
330331
await clientChannel1.sink.close();
331332
await clientChannel2.sink.close();
332333
});
@@ -337,8 +338,10 @@ void main() {
337338
await createMockConnection(serverChannel1, 'web');
338339
await createMockConnection(serverChannel2, 'web');
339340
await handler.emitUpdateMessage(BuildResult(BuildStatus.success, []));
341+
await pumpEventQueue();
340342
await clientChannel2.sink.close();
341343
await handler.emitUpdateMessage(BuildResult(BuildStatus.success, []));
344+
await pumpEventQueue();
342345
await clientChannel1.sink.close();
343346
});
344347

@@ -382,6 +385,7 @@ void main() {
382385
AssetId('a', 'web/index.html'),
383386
AssetId('a', 'lib/some.dart.js'),
384387
]));
388+
await pumpEventQueue();
385389
await clientChannel1.sink.close();
386390
});
387391

@@ -421,6 +425,7 @@ void main() {
421425
AssetId('a', 'web2/index.html'),
422426
AssetId('a', 'lib/some.dart.js'),
423427
]));
428+
await pumpEventQueue();
424429
await clientChannel1.sink.close();
425430
await clientChannel2.sink.close();
426431
});

0 commit comments

Comments
 (0)