Unverified Commit 8be46a0c authored by Jenn Magder's avatar Jenn Magder Committed by GitHub

Kill compiler process when test does not exit cleanly (#34616)

parent cc541e67
...@@ -738,6 +738,7 @@ class ResidentCompiler { ...@@ -738,6 +738,7 @@ class ResidentCompiler {
if (_server == null) { if (_server == null) {
return 0; return 0;
} }
printTrace('killing pid ${_server.pid}');
_server.kill(); _server.kill();
return _server.exitCode; return _server.exitCode;
} }
......
...@@ -85,6 +85,7 @@ class TestCompiler { ...@@ -85,6 +85,7 @@ class TestCompiler {
Future<void> dispose() async { Future<void> dispose() async {
await compilerController.close(); await compilerController.close();
await _shutdown();
} }
/// Create the resident compiler used to compile the test. /// Create the resident compiler used to compile the test.
......
...@@ -59,6 +59,15 @@ void main() { ...@@ -59,6 +59,15 @@ void main() {
expect(await testCompiler.compile('test/foo.dart'), null); expect(await testCompiler.compile('test/foo.dart'), null);
expect(fs.file('test/foo.dart.dill').existsSync(), false); expect(fs.file('test/foo.dart.dill').existsSync(), false);
verify(residentCompiler.shutdown()).called(1);
}));
test('Disposing test compiler shuts down backing compiler', () => testbed.run(() async {
testCompiler.compiler = residentCompiler;
expect(testCompiler.compilerController.isClosed, false);
await testCompiler.dispose();
expect(testCompiler.compilerController.isClosed, true);
verify(residentCompiler.shutdown()).called(1);
})); }));
}); });
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment