Skip to content

Commit 94c172c

Browse files
authored
Wait for any remaining output in e2e_test.dart (#2663)
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 7ff2d07 commit 94c172c

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';
@@ -209,8 +210,12 @@ void main() {
209210
args.add('--release');
210211
}
211212

213+
final stdoutDone = Completer<void>();
214+
final stderrDone = Completer<void>();
212215
final process = await testRunner.runWebDev(args,
213216
workingDirectory: exampleDirectory);
217+
process.stdoutStream().listen((_) => {}, onDone: stdoutDone.complete);
218+
process.stderrStream().listen((_) => {}, onDone: stderrDone.complete);
214219

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

@@ -238,6 +243,7 @@ void main() {
238243

239244
await process.kill();
240245
await process.shouldExit();
246+
await Future.wait([stdoutDone.future, stderrDone.future]);
241247
});
242248
}
243249
});

0 commit comments

Comments
 (0)