@wdio/local-runner 9.32.0-alpha.3 → 9.32.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/index.js +25 -3
- package/build/worker.d.ts +5 -0
- package/build/worker.d.ts.map +1 -1
- package/package.json +7 -7
package/build/index.js
CHANGED
|
@@ -6,6 +6,7 @@ import { XvfbManager } from "@wdio/xvfb";
|
|
|
6
6
|
// src/worker.ts
|
|
7
7
|
import url from "node:url";
|
|
8
8
|
import path from "node:path";
|
|
9
|
+
import { constants } from "node:os";
|
|
9
10
|
import { EventEmitter } from "node:events";
|
|
10
11
|
import { ProcessFactory } from "@wdio/xvfb";
|
|
11
12
|
import logger from "@wdio/logger";
|
|
@@ -186,6 +187,13 @@ var stdOutStream = new RunnerStream();
|
|
|
186
187
|
var stdErrStream = new RunnerStream();
|
|
187
188
|
stdOutStream.pipe(process.stdout);
|
|
188
189
|
stdErrStream.pipe(process.stderr);
|
|
190
|
+
var GRACEFUL_SHUTDOWN_SIGNALS = ["SIGTERM", "SIGINT"];
|
|
191
|
+
var SIGNAL_EXIT_CODE_OFFSET = 128;
|
|
192
|
+
var UNKNOWN_SIGNAL_EXIT_CODE = 1;
|
|
193
|
+
function getExitCodeForSignal(signal) {
|
|
194
|
+
const signalNumber = signal ? constants.signals[signal] : void 0;
|
|
195
|
+
return signalNumber ? SIGNAL_EXIT_CODE_OFFSET + signalNumber : UNKNOWN_SIGNAL_EXIT_CODE;
|
|
196
|
+
}
|
|
189
197
|
var WorkerInstance = class extends EventEmitter {
|
|
190
198
|
cid;
|
|
191
199
|
config;
|
|
@@ -336,13 +344,27 @@ var WorkerInstance = class extends EventEmitter {
|
|
|
336
344
|
const { cid } = this;
|
|
337
345
|
this.emit("error", Object.assign(payload, { cid }));
|
|
338
346
|
}
|
|
339
|
-
|
|
347
|
+
/**
|
|
348
|
+
* Node calls this with `(code, signal)` where `code` is `null` whenever the
|
|
349
|
+
* worker was terminated by a signal rather than exiting on its own, e.g. on
|
|
350
|
+
* a segmentation fault. Only the second argument identifies that case.
|
|
351
|
+
*/
|
|
352
|
+
_handleExit(exitCode, signal = null) {
|
|
340
353
|
const { cid, childProcess, specs, retries } = this;
|
|
354
|
+
const wasKilledIntentionally = this.isKilled;
|
|
341
355
|
delete this.childProcess;
|
|
342
356
|
this.isBusy = false;
|
|
343
357
|
this.isKilled = true;
|
|
344
|
-
|
|
345
|
-
|
|
358
|
+
const resolvedExitCode = exitCode ?? getExitCodeForSignal(signal);
|
|
359
|
+
const crashed = signal !== null && !wasKilledIntentionally && !GRACEFUL_SHUTDOWN_SIGNALS.includes(signal);
|
|
360
|
+
if (crashed) {
|
|
361
|
+
log.error(
|
|
362
|
+
`Runner ${cid} was terminated by ${signal} and did not report an exit code. The spec file(s) ${specs.join(", ")} are reported as failed with exit code ${resolvedExitCode}. This usually means the process ran out of memory or a native module crashed.`
|
|
363
|
+
);
|
|
364
|
+
} else {
|
|
365
|
+
log.debug(`Runner ${cid} finished with exit code ${resolvedExitCode}`);
|
|
366
|
+
}
|
|
367
|
+
this.emit("exit", { cid, exitCode: resolvedExitCode, specs, retries, signal });
|
|
346
368
|
if (childProcess) {
|
|
347
369
|
childProcess.kill("SIGTERM");
|
|
348
370
|
}
|
package/build/worker.d.ts
CHANGED
|
@@ -52,6 +52,11 @@ export default class WorkerInstance extends EventEmitter implements Workers.Work
|
|
|
52
52
|
startProcess(): Promise<ChildProcess>;
|
|
53
53
|
private _handleMessage;
|
|
54
54
|
private _handleError;
|
|
55
|
+
/**
|
|
56
|
+
* Node calls this with `(code, signal)` where `code` is `null` whenever the
|
|
57
|
+
* worker was terminated by a signal rather than exiting on its own, e.g. on
|
|
58
|
+
* a segmentation fault. Only the second argument identifies that case.
|
|
59
|
+
*/
|
|
55
60
|
private _handleExit;
|
|
56
61
|
/**
|
|
57
62
|
* Forcefully kill the worker process.
|
package/build/worker.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worker.d.ts","sourceRoot":"","sources":["../src/worker.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"worker.d.ts","sourceRoot":"","sources":["../src/worker.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC1C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACtD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gBAAgB,CAAA;AAC1D,OAAO,EAAkB,KAAK,WAAW,EAAE,MAAM,YAAY,CAAA;AAC7D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAA;AAuC1C;;;;GAIG;AACH,MAAM,CAAC,OAAO,OAAO,cAAe,SAAQ,YAAa,YAAW,OAAO,CAAC,MAAM;;IAC9E,GAAG,EAAE,MAAM,CAAA;IACX,MAAM,EAAE,WAAW,CAAC,MAAM,CAAA;IAC1B,UAAU,EAAE,MAAM,CAAA;IAElB,IAAI,EAAE,WAAW,CAAC,YAAY,CAAA;IAE9B,YAAY,EAAE,WAAW,CAAC,YAAY,CAAA;IACtC,KAAK,EAAE,MAAM,EAAE,CAAA;IACf,QAAQ,EAAE,MAAM,EAAE,CAAA;IAClB,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,oBAAoB,CAAA;IAC5B,MAAM,EAAE,oBAAoB,CAAA;IAC5B,YAAY,CAAC,EAAE,YAAY,CAAA;IAC3B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC/B,cAAc,EAAE,MAAM,EAAE,CAAK;IAG7B,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC,CAAA;IACjD,aAAa,CAAC,EAAE,OAAO,CAAA;IAEvB,MAAM,UAAQ;IACd,QAAQ,UAAQ;IAChB,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,CAAA;IACzB,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,CAAA;IACzB,eAAe,EAAE,CAAC,KAAK,EAAE,OAAO,GAAG,WAAW,CAAC,OAAO,CAAC,KAAK,IAAI,CAAW;IAC3E,eAAe,EAAE,CAAC,KAAK,EAAE,OAAO,GAAG,WAAW,CAAC,OAAO,CAAC,KAAK,IAAI,CAAW;IAE3E;;;;;;;;;;OAUG;gBAEC,MAAM,EAAE,WAAW,CAAC,MAAM,EAC1B,EAAE,GAAG,EAAE,UAAU,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,EAAE,OAAO,CAAC,gBAAgB,EAC7E,MAAM,EAAE,oBAAoB,EAC5B,MAAM,EAAE,oBAAoB,EAC5B,WAAW,EAAE,WAAW;IAmB5B;;OAEG;IACG,YAAY;IAgElB,OAAO,CAAC,cAAc;IAqEtB,OAAO,CAAC,YAAY;IAKpB;;;;OAIG;IACH,OAAO,CAAC,WAAW;IAmCnB;;;;;;OAMG;IACH,IAAI,CAAC,MAAM,GAAE,MAAM,CAAC,OAAmB,GAAG,IAAI;IAiB9C;;;;OAIG;IACG,WAAW,CAAE,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,CAAC,iBAAiB,EAAE,aAAa,UAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;CA4B7G"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wdio/local-runner",
|
|
3
|
-
"version": "9.32.0
|
|
3
|
+
"version": "9.32.0",
|
|
4
4
|
"description": "A WebdriverIO runner to run tests locally",
|
|
5
5
|
"author": "Christian Bromann <mail@bromann.dev>",
|
|
6
6
|
"homepage": "https://github.com/webdriverio/webdriverio/tree/main/packages/wdio-local-runner",
|
|
@@ -37,11 +37,11 @@
|
|
|
37
37
|
"typeScriptVersion": "3.8.3",
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"@types/node": "^20.1.0",
|
|
40
|
-
"@wdio/logger": "9.
|
|
41
|
-
"@wdio/repl": "9.
|
|
42
|
-
"@wdio/runner": "9.32.0
|
|
43
|
-
"@wdio/types": "9.32.0
|
|
44
|
-
"@wdio/xvfb": "9.32.0
|
|
40
|
+
"@wdio/logger": "9.29.1",
|
|
41
|
+
"@wdio/repl": "9.16.2",
|
|
42
|
+
"@wdio/runner": "9.32.0",
|
|
43
|
+
"@wdio/types": "9.32.0",
|
|
44
|
+
"@wdio/xvfb": "9.32.0",
|
|
45
45
|
"exit-hook": "^4.0.0",
|
|
46
46
|
"expect-webdriverio": "^6.0.9",
|
|
47
47
|
"split2": "^4.1.0",
|
|
@@ -53,5 +53,5 @@
|
|
|
53
53
|
"publishConfig": {
|
|
54
54
|
"access": "public"
|
|
55
55
|
},
|
|
56
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "5c2a318d9a5e8424a2f2de95df9374b89bda7936"
|
|
57
57
|
}
|