Recreate worker (#4)

This commit is contained in:
Alex Schwartz 2025-02-22 08:24:59 -05:00 committed by GitHub
parent aa91317c96
commit d9da8c2cc0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 5 additions and 5 deletions

View file

@ -506,7 +506,7 @@ export default defineConfig({
}); });
``` ```
## property: TestConfig.skipAfterAnyFailure? ## property: TestConfig.recreateWorkerAfterFailure?
* since: v1.51 * since: v1.51
- type: <[boolean]> - type: <[boolean]>

View file

@ -49,7 +49,7 @@ export class FullConfigInternal {
readonly projects: FullProjectInternal[] = []; readonly projects: FullProjectInternal[] = [];
readonly singleTSConfigPath?: string; readonly singleTSConfigPath?: string;
readonly populateGitInfo: boolean; readonly populateGitInfo: boolean;
readonly skipAfterAnyFailure: boolean; readonly recreateWorkerAfterFailure: boolean;
cliArgs: string[] = []; cliArgs: string[] = [];
cliGrep: string | undefined; cliGrep: string | undefined;
cliGrepInvert: string | undefined; cliGrepInvert: string | undefined;
@ -88,7 +88,7 @@ export class FullConfigInternal {
// so that plugins such as gitCommitInfoPlugin can populate metadata once. // so that plugins such as gitCommitInfoPlugin can populate metadata once.
userConfig.metadata = userConfig.metadata || {}; userConfig.metadata = userConfig.metadata || {};
this.skipAfterAnyFailure = userConfig.skipAfterAnyFailure ?? true; this.recreateWorkerAfterFailure = userConfig.recreateWorkerAfterFailure ?? true;
this.config = { this.config = {
configFile: resolvedConfigFile, configFile: resolvedConfigFile,

View file

@ -394,7 +394,7 @@ export class WorkerMain extends ProcessRunner {
const afterHooksTimeout = calculateMaxTimeout(this._project.project.timeout, testInfo.timeout); const afterHooksTimeout = calculateMaxTimeout(this._project.project.timeout, testInfo.timeout);
const afterHooksSlot = { timeout: afterHooksTimeout, elapsed: 0 }; const afterHooksSlot = { timeout: afterHooksTimeout, elapsed: 0 };
const FAILURE_AND_SkIP_NOW = testInfo._isFailure() && this._config.skipAfterAnyFailure; const FAILURE_AND_SkIP_NOW = testInfo._isFailure() && this._config.recreateWorkerAfterFailure;
await testInfo._runAsStage({ title: 'After Hooks', stepInfo: { category: 'hook' } }, async () => { await testInfo._runAsStage({ title: 'After Hooks', stepInfo: { category: 'hook' } }, async () => {
let firstAfterHooksError: Error | undefined; let firstAfterHooksError: Error | undefined;

View file

@ -1525,7 +1525,7 @@ interface TestConfig<TestArgs = {}, WorkerArgs = {}> {
total: number; total: number;
}; };
skipAfterAnyFailure?: boolean; recreateWorkerAfterFailure?: boolean;
/** /**
* **NOTE** Use * **NOTE** Use