Recreate worker (#4)
This commit is contained in:
parent
aa91317c96
commit
d9da8c2cc0
|
|
@ -506,7 +506,7 @@ export default defineConfig({
|
||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
## property: TestConfig.skipAfterAnyFailure?
|
## property: TestConfig.recreateWorkerAfterFailure?
|
||||||
* since: v1.51
|
* since: v1.51
|
||||||
- type: <[boolean]>
|
- type: <[boolean]>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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,
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
|
|
|
||||||
2
packages/playwright/types/test.d.ts
vendored
2
packages/playwright/types/test.d.ts
vendored
|
|
@ -1525,7 +1525,7 @@ interface TestConfig<TestArgs = {}, WorkerArgs = {}> {
|
||||||
total: number;
|
total: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
skipAfterAnyFailure?: boolean;
|
recreateWorkerAfterFailure?: boolean;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* **NOTE** Use
|
* **NOTE** Use
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue