Skip to content

Commit f38f9b8

Browse files
committed
Wait for any remaining output in e2e_test.dart
This is intended to fix the flakes appearing on the windows bot. I suspect the test runner is marking it as failing when output comes through on the stream after the test has exited.
1 parent 4fc5d8c commit f38f9b8

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

webdev/test/e2e_test.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
@Timeout(Duration(minutes: 5))
66
library;
77

8+
import 'dart:async';
89
import 'dart:io';
910

1011
import 'package:io/io.dart';
@@ -210,8 +211,12 @@ void main() {
210211
args.add('--release');
211212
}
212213

214+
final stdoutDone = Completer<void>();
215+
final stderrDone = Completer<void>();
213216
final process = await testRunner.runWebDev(args,
214217
workingDirectory: soundExampleDirectory);
218+
process.stdoutStream().listen((_) => {}, onDone: stdoutDone.complete);
219+
process.stderrStream().listen((_) => {}, onDone: stderrDone.complete);
215220

216221
final hostUrl = 'http://localhost:$openPort';
217222

@@ -239,6 +244,7 @@ void main() {
239244

240245
await process.kill();
241246
await process.shouldExit();
247+
await Future.wait([stdoutDone.future, stderrDone.future]);
242248
});
243249
}
244250
});

0 commit comments

Comments
 (0)