mirror of
https://github.com/gristlabs/grist-core.git
synced 2024-10-27 20:44:07 +00:00
(core) freshen tests for python3
Summary: Recent python3 changes perturbed timing again, and a few more tests started failing. Contains an unrelated correction for gvisor running under docker (a useful configuration on macs for debugging gvisor problems, but not supported by throttling code). Test Plan: updated tests Reviewers: dsagal, alexmojaki Reviewed By: dsagal, alexmojaki Differential Revision: https://phab.getgrist.com/D3129
This commit is contained in:
parent
08b1286f4f
commit
302202b4fb
@ -104,6 +104,7 @@ export class SubprocessControl implements ISandboxControl {
|
||||
private _throttle?: Throttle;
|
||||
private _monitoredProcess: Promise<ProcessInfo|null>;
|
||||
private _active: boolean;
|
||||
private _foundDocker: boolean = false;
|
||||
|
||||
constructor(private _options: {
|
||||
pid: number, // pid of process opened by Grist
|
||||
@ -134,6 +135,10 @@ export class SubprocessControl implements ISandboxControl {
|
||||
}
|
||||
|
||||
public async kill() {
|
||||
if (this._foundDocker) {
|
||||
process.kill(this._options.pid, 'SIGKILL');
|
||||
return;
|
||||
}
|
||||
for (const proc of await this._getAllProcesses()) {
|
||||
try {
|
||||
process.kill(proc.pid, 'SIGKILL');
|
||||
@ -179,7 +184,10 @@ export class SubprocessControl implements ISandboxControl {
|
||||
const recognizer = this._options.recognizers[key];
|
||||
if (!recognizer) { continue; }
|
||||
for (const proc of processes) {
|
||||
if (proc.label.includes('docker')) { throw new Error('docker barrier found'); }
|
||||
if (proc.label.includes('docker')) {
|
||||
this._foundDocker = true;
|
||||
throw new Error('docker barrier found');
|
||||
}
|
||||
if (recognizer(proc)) {
|
||||
recognizedProcesses[key] = proc;
|
||||
continue;
|
||||
|
Loading…
Reference in New Issue
Block a user