[Feature]: Schedule projects by their own dependencies instead of global phases
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 15/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- node.js, typescript
- Domain
- testing-qa, tooling
Research direction
Start by reading createPhasesTask and createRunTestsTask in lib/runner/index.js, focusing on the phase loop for (const { dispatcher, projects } of testRun.phases). Map how dependencies, workers, fullyParallel, teardown and maxFailures flow into that loop, and confirm where metadata.actualWorkers is computed. This is a scheduling redesign that needs maintainer agreement on default versus opt-in before any patch; a first step is a written design plus a failing scenario like the example config.
Written by the indexing model from the issue text.
Description
🚀 Feature Request
When a config uses project dependencies, the runner groups projects into phases and runs them strictly one after another. A project only starts after every project in the previous phase has finished, including projects it doesn't depend on.
So a project whose own dependencies finished long ago can sit waiting for slow, unrelated projects, with most workers idle.
The cause is in createPhasesTask (lib/runner/index.js, 1.64.0). It builds phases from a topological sort, and createRunTestsTask runs them in order (for (const { dispatcher, projects } of testRun.phases)).
Proposal: schedule projects from the dependency graph instead of from phases.
- A project's test groups become eligible as soon as all of its own
dependencieshave finished successfully, or are skipped as they are today when a dependency fails. - Eligible test groups from all ready projects share the global worker pool. Project-level
workerslimits andfullyParallelbehave as they do now. teardownkeeps its current meaning: a teardown project runs after its setup and everything that depends on that setup.maxFailures/ignoreMaxFailureskeep their current behaviour for setup and teardown projects.
If changing the default is too risky, an opt-in setting would also work:
export default defineConfig({
projectScheduling: 'graph', // default: 'phases' (current behaviour)
});
Note: metadata.actualWorkers is currently the largest number of concurrent test groups in any single phase. With graph scheduling, it would need to be computed over the whole run.
Example
Minimal repro:
// playwright.config.ts
export default defineConfig({
workers: 4,
projects: [
{ name: 'setup-fast', testMatch: /fast\.setup\.ts/ }, // ~5s
{ name: 'independent', testMatch: /independent\.spec\.ts/ }, // ~5 min, no dependencies
{ name: 'dependent', dependencies: ['setup-fast'],
testMatch: /dependent\.spec\.ts/ }, // ~5 min
],
});
npx playwright test --project=independent --project=dependent
- Expected:
dependentstarts about 5 seconds in, whensetup-fastfinishes. Both projects run in parallel, so the whole run takes about 5 minutes. - Actual:
dependentwaits forindependentto finish. The run takes about 10 minutes, and workers sit idle for the first half.
With graph scheduling, the config stays exactly the same; only the start times change.
Motivation
Project dependencies are the recommended replacement for globalSetup, and the usual pattern is one setup project per isolated data set, feeding parallel test projects. Phase-based scheduling undercuts that parallelism.
Our real case: 8 test batches, each with workers: 1 (they share seeded data), and workers: 8 overall. Six batches each depend on their own setup project; two have no dependencies. Phase 1 holds the six setups plus the two independent batches. Once the setups finish (2 to 4 minutes), phase 1 is down to two running workers, while six batches stay blocked even though their setups passed. Six of the eight workers are idle for most of the run.
The only workaround is to give every project an artificial no-op dependency so they all fall into the same phase. That's a hack that delays the projects that had no dependencies and makes the config harder to follow.
Scheduling by the dependency graph would make the configured worker count a real number, cut wall-clock time for suites that use setup projects, and make project dependencies behave the way most users already assume they do.
- Dominant language
- TypeScript
- Stars
- 100k
- Forks
- 6.9k
- Avg merge
- 16h 8m
- Merged PRs (30d)
- 281
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/playwright
-
[MCP]: page snapshots in .playwright-mcp/ are not git-ignored (.playwright-cli/ is, since #42318)Open
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
microsoft/playwright#44289 ·
Maintainers usually reply within 1 day
-
agent-triage-done
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
microsoft/playwright#44264 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 12/100
microsoft/playwright#44290 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 22/100
microsoft/playwright#44288 ·
Maintainers usually reply within 1 day
-
[Bug]: page.goto never returns for a load started as a newer service worker takes over (Chromium)Open
Difficulty 5/5 Over a week Newbie friendliness 12/100
microsoft/playwright#44287 ·
Maintainers usually reply within 1 day
All issues in microsoft/playwright
Similar issues
-
clawsweeper:needs-maintainer-review clawsweeper:needs-product-decision clawsweeper:no-new-fix-pr clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster P3
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
openclaw/openclaw#203385 · 1 comment · 1 reaction ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
nwverse/persona#12800 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
Maintainers usually reply within 1 day
-
good first issue
Difficulty 2/5 Half a day Newbie friendliness 65/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
WISE-Community/WISE-Client#2404 ·
Maintainers usually reply within 1 day