Revert "fix: shut down workers before reporter.onEnd (#30329)" (#30551)

This reverts commit 3cea17abb6.

Reference https://github.com/microsoft/playwright/issues/30550

The test is preserved but marked as fixme.
This commit is contained in:
Yury Semikhatsky 2024-04-25 14:21:54 -07:00 committed by GitHub
parent 086ea79c25
commit 9a1b34a4b0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 9 additions and 12 deletions

View file

@ -148,7 +148,7 @@ export default defineConfig({
* since: v1.10 * since: v1.10
- type: ?<[int]> - type: ?<[int]>
Maximum time in milliseconds the whole test suite can run. Zero timeout (default) disables this behavior. Useful on CI to prevent broken setup from running too long and wasting resources. Note that even if global timeout is reached, Playwright will still allow up to 30 extra seconds for teardown hooks to finish. Learn more about [various timeouts](../test-timeouts.md). Maximum time in milliseconds the whole test suite can run. Zero timeout (default) disables this behavior. Useful on CI to prevent broken setup from running too long and wasting resources. Learn more about [various timeouts](../test-timeouts.md).
**Usage** **Usage**

View file

@ -105,14 +105,9 @@ export class TaskRunner<Context> {
status = 'failed'; status = 'failed';
} }
cancelPromise?.resolve(); cancelPromise?.resolve();
const cleanup = async () => { // Note that upon hitting deadline, we "run cleanup", but it exits immediately
// Upon hitting deadline we add extra 30s to actually perform cleanup, otherwise // because of the same deadline. Essentially, we're not performing any cleanup.
// the task exits immediately because of the same deadline and we may continue const cleanup = () => teardownRunner.runDeferCleanup(context, deadline).then(r => r.status);
// while the test workers are still running.
const extraTime = timeoutWatcher.timedOut() ? 30_000 : 0;
const { status } = await teardownRunner.runDeferCleanup(context, deadline + extraTime);
return status;
};
return { status, cleanup }; return { status, cleanup };
} }
} }

View file

@ -1101,8 +1101,7 @@ interface TestConfig<TestArgs = {}, WorkerArgs = {}> {
/** /**
* Maximum time in milliseconds the whole test suite can run. Zero timeout (default) disables this behavior. Useful on * Maximum time in milliseconds the whole test suite can run. Zero timeout (default) disables this behavior. Useful on
* CI to prevent broken setup from running too long and wasting resources. Note that even if global timeout is * CI to prevent broken setup from running too long and wasting resources. Learn more about
* reached, Playwright will still allow up to 30 extra seconds for teardown hooks to finish. Learn more about
* [various timeouts](https://playwright.dev/docs/test-timeouts). * [various timeouts](https://playwright.dev/docs/test-timeouts).
* *
* **Usage** * **Usage**

View file

@ -230,7 +230,8 @@ for (const useIntermediateMergeReport of [false, true] as const) {
}); });
expect(result.exitCode).toBe(1); expect(result.exitCode).toBe(1);
expect(result.passed).toBe(1); expect(result.passed).toBe(1);
expect(result.interrupted).toBe(1); // TODO: uncomment once https://github.com/microsoft/playwright/issues/30550 is fixed.
// expect(result.interrupted).toBe(1);
expect(result.didNotRun).toBe(1); expect(result.didNotRun).toBe(1);
expect(result.output).toContain('Timed out waiting 3s for the test suite to run'); expect(result.output).toContain('Timed out waiting 3s for the test suite to run');
}); });

View file

@ -776,6 +776,8 @@ test('unhandled exception in test.fail should restart worker and continue', asyn
}); });
test('wait for workers to finish before reporter.onEnd', async ({ runInlineTest }) => { test('wait for workers to finish before reporter.onEnd', async ({ runInlineTest }) => {
test.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/30550' });
test.fixme();
const result = await runInlineTest({ const result = await runInlineTest({
'playwright.config.ts': ` 'playwright.config.ts': `
export default { export default {