mirror of
https://github.com/flutter/flutter.git
synced 2025-06-03 00:51:18 +00:00
Kill compiler process when test does not exit cleanly (#34616)
This commit is contained in:
parent
cc541e6724
commit
8be46a0c4a
@ -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 {
|
|||||||
|
|
||||||
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() {
|
|||||||
|
|
||||||
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);
|
||||||
}));
|
}));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user