зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1772329 - Force kill node process and subprocesses in xpcshell tests at the end of the test r=jmaher,necko-reviewers,kershaw
Differential Revision: https://phabricator.services.mozilla.com/D189212
This commit is contained in:
Родитель
85dbd41802
Коммит
10e8f63703
|
@ -85,3 +85,11 @@ add_task(async function test_execute() {
|
|||
)
|
||||
);
|
||||
});
|
||||
|
||||
add_task(async function killOnEnd() {
|
||||
let id = await NodeServer.fork();
|
||||
// Make the forked subprocess hang forever.
|
||||
NodeServer.execute(id, "while (true) {}").catch(e => {});
|
||||
await new Promise(resolve => do_timeout(10, resolve));
|
||||
// Should get killed at the end of the test by the harness.
|
||||
});
|
||||
|
|
|
@ -1434,6 +1434,9 @@ class XPCShellTests(object):
|
|||
self.log.info("Node %s server shutting down ..." % name)
|
||||
if proc.poll() is not None:
|
||||
self.log.info("Node server %s already dead %s" % (name, proc.poll()))
|
||||
elif sys.platform != "win32":
|
||||
# Kill process and all its spawned children.
|
||||
os.killpg(os.getpgid(proc.pid), signal.SIGTERM)
|
||||
else:
|
||||
proc.terminate()
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче