[Feature]: Schedule projects by their own dependencies instead of global phases
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 15/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- node.js, typescript
- Lĩnh vực
- testing-qa, tooling
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
🚀 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.
- Ngôn ngữ chính
- TypeScript
- Star
- 100k
- Fork
- 6.9k
- Merge trung bình
- 16 giờ 8 phút
- Pull request đã merge (30 ngày)
- 281
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của microsoft/playwright
-
[MCP]: page snapshots in .playwright-mcp/ are not git-ignored (.playwright-cli/ is, since #42318)Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
microsoft/playwright#44289 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
agent-triage-done
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
microsoft/playwright#44264 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[BUG] WebKit keeps every removed iframe's JS heap alive (memory grows until the page crashes)Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 12/100
microsoft/playwright#44290 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Regression]: requestFullscreen() in a popup rejects with "not granted" in 1.65 (Chromium 159)Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 22/100
microsoft/playwright#44288 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug]: page.goto never returns for a load started as a newer service worker takes over (Chromium)Đang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 12/100
microsoft/playwright#44287 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của microsoft/playwright
Issue tương tự
-
clawsweeper:needs-maintainer-review clawsweeper:needs-product-decision clawsweeper:no-new-fix-pr clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster P3
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
openclaw/openclaw#203385 · 1 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
nwverse/persona#12800 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 80/100
Maintainer thường phản hồi trong vòng 1 ngày
-
good first issue
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 65/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
WISE-Community/WISE-Client#2404 ·
Maintainer thường phản hồi trong vòng 1 ngày