fix(runner): finish dispatching if remaining tests were skipped (#21238)

Fixes #21226
This commit is contained in:
Yury Semikhatsky 2023-02-27 17:20:30 -08:00 committed by GitHub
parent cabeb42c8c
commit cfdddcf9ba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 0 deletions

View File

@ -76,6 +76,9 @@ export class Dispatcher {
}
this._queue.shift();
}
// If all remaining tests were skipped, resolve finished state.
this._checkFinished();
}
private async _scheduleJob() {

View File

@ -96,3 +96,26 @@ test('should respect shard=1/2 in config', async ({ runInlineTest }) => {
expect(result.output).toContain('test2-done');
expect(result.output).toContain('test3-done');
});
test('should work with workers=1 and --fully-parallel', async ({ runInlineTest }) => {
test.info().annotations.push({ type: 'issue', description: 'https://github.com/microsoft/playwright/issues/21226' });
const tests = {
'a1.spec.ts': `
import { test } from '@playwright/test';
test('should pass', async ({ }) => {
});
test.skip('should skip', async ({ }) => {
});
`,
'a2.spec.ts': `
import { test } from '@playwright/test';
test('shoul pass', async ({ }) => {
});
`,
};
const result = await runInlineTest(tests, { shard: '1/2', ['fully-parallel']: true, workers: 1 });
expect(result.exitCode).toBe(0);
expect(result.passed).toBe(1);
expect(result.skipped).toBe(1);
});