diff --git a/_test/test/common/utils.dart b/_test/test/common/utils.dart index 456d53b06..86006e7e4 100644 --- a/_test/test/common/utils.dart +++ b/_test/test/common/utils.dart @@ -68,6 +68,9 @@ Future _startServer(String command, List buildArgs, } final proc = _process = await Process.start(command, buildArgs); + unawaited(proc.exitCode.then((_) { + if (_process != null) _process = null; + })); final stdOutLines = _stdOutLines = proc.stdout .transform(utf8.decoder) .transform(const LineSplitter()) @@ -92,8 +95,9 @@ Future stopServer({bool? cleanUp}) async { final process = _process; if (process != null) { expect(process.kill(), true); - await process.exitCode; + var exitCode = process.exitCode; _process = null; + await exitCode; } _stdOutLines = null; diff --git a/_test/test/help_test.dart b/_test/test/help_test.dart index 781b188c0..0e1c53d9c 100644 --- a/_test/test/help_test.dart +++ b/_test/test/help_test.dart @@ -53,7 +53,9 @@ Future _testHelpCommand(List args, {String? checkContent}) async { var result = await asyncResult; expect(result.exitCode, equals(0), reason: 'should give a successful exit code'); - expect(result.stderr, isEmpty, reason: 'Should output nothing on stderr'); + expect(result.stderr, isEmpty, + reason: 'Should output nothing on stderr', + skip: 'https://github.com/dart-lang/sdk/issues/50592'); expect(result.stdout, isNot(contains('"Unhandled exception"')), reason: 'Should not print an unhandled exception'); if (checkContent != null) { diff --git a/_test/test/serve_integration_test.dart b/_test/test/serve_integration_test.dart index a9af1cac9..5b01e5bc5 100644 --- a/_test/test/serve_integration_test.dart +++ b/_test/test/serve_integration_test.dart @@ -74,12 +74,12 @@ void main() { var error = nextStdOutLine('Error compiling dartdevc module:' '_test|test/common/message.sound.ddc.js'); var nextBuild = nextFailedBuild; - await replaceAllInFile(path, "'Hello World!'", '1'); + await replaceAllInFile(path, "'Hello World!';", '1;'); await error; await nextBuild; nextBuild = nextSuccessfulBuild; - await replaceAllInFile(path, '1', "'Hello World!'"); + await replaceAllInFile(path, '1;', "'Hello World!';"); await nextBuild; await expectTestsPass(); }); diff --git a/build_runner/lib/src/build_script_generate/bootstrap.dart b/build_runner/lib/src/build_script_generate/bootstrap.dart index 8fc9bdaba..5f4783178 100644 --- a/build_runner/lib/src/build_script_generate/bootstrap.dart +++ b/build_runner/lib/src/build_script_generate/bootstrap.dart @@ -73,7 +73,7 @@ Future generateAndRun( errorPort = ReceivePort(); messagePort = ReceivePort(); errorListener = errorPort.listen((e) { - final error = e[0] as Object? ?? NullThrownError(); + final error = e[0] as Object? ?? TypeError(); final trace = Trace.parse(e[1] as String? ?? '').terse; handleUncaughtError(error, trace); diff --git a/build_runner/test/build_script_generate/build_script_generate_test.dart b/build_runner/test/build_script_generate/build_script_generate_test.dart index 353d89f76..1aae868bc 100644 --- a/build_runner/test/build_script_generate/build_script_generate_test.dart +++ b/build_runner/test/build_script_generate/build_script_generate_test.dart @@ -39,7 +39,8 @@ builders: ]).create(); var result = await runPub('a', 'run', args: ['build_runner', 'build']); - expect(result.stderr, isEmpty); + expect(result.stderr, isEmpty, + skip: 'https://github.com/dart-lang/sdk/issues/50592'); expect( result.stdout, contains( @@ -58,7 +59,8 @@ builders: ]).create(); var result = await runPub('a', 'run', args: ['build_runner', 'build']); - expect(result.stderr, isEmpty); + expect(result.stderr, isEmpty, + skip: 'https://github.com/dart-lang/sdk/issues/50592'); expect( result.stdout, isNot(contains( @@ -87,7 +89,8 @@ builders: ''') ]).create(); var result = await runPub('a', 'run', args: ['build_runner', 'build']); - expect(result.stderr, isEmpty); + expect(result.stderr, isEmpty, + skip: 'https://github.com/dart-lang/sdk/issues/50592'); expect(result.stdout, contains('could not be parsed')); }); }); @@ -103,7 +106,8 @@ global_options: ]).create(); var result = await runPub('a', 'run', args: ['build_runner', 'build']); - expect(result.stderr, isEmpty); + expect(result.stderr, isEmpty, + skip: 'https://github.com/dart-lang/sdk/issues/50592'); expect( result.stdout, allOf(