[Bug]: CLI numeric options are not validated: `--timeout 30s` runs with a 30ms timeout, `--timeout abc` / `--retries abc` silently disable timeouts and retries
Maintainer thường phản hồi trong vòng 1 ngày
@CloneOfAlex đang làm issue này rồi.
Từ ngày 19/10/2026.
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 78/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- node.js, playwright, typescript
Hướng nghiên cứu
Bắt đầu tại packages/playwright/src/cli/testActions.ts, ở overridesFromOptions(), và kiểm tra cách phân tích năm tùy chọn CLI dạng số; so sánh với phần xác thực trong configLoader.ts. Thêm các bài kiểm thử tập trung cho giá trị sai định dạng và hợp lệ, rồi chạy các bài kiểm thử đó. Công việc hoàn tất khi giá trị không hợp lệ tạo ra lỗi hướng dẫn sử dụng rõ ràng và các số nguyên không âm hợp lệ vẫn hoạt động.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Version
1.64.1 (also reproduces on main at cdcef0b)
Steps to reproduce
No browser needed. Fresh project with npm i -D @playwright/[email protected] and two files:
// tests/a.spec.ts
import { test } from '@playwright/test';
test('waits 200ms', async () => { await new Promise(f => setTimeout(f, 200)); });
// tests/d.spec.ts
import { test } from '@playwright/test';
test('reports config', async ({}, testInfo) => {
console.log('timeout=' + testInfo.timeout + ' retries=' + testInfo.project.retries);
});
npx playwright test tests/a.spec.ts --timeout 30snpx playwright test tests/d.spec.ts --timeout abc --retries abc
Expected behavior
Both commands fail fast with a usage error, the same way invalid config-file values are rejected (config.timeout must be a non-negative number). For example: --timeout "30s" must be a non-negative integer.
Actual behavior
- The test fails with
Test timeout of 30ms exceeded.because"30s"is read as 30 ms.--timeout 1mlikewise becomes a 1 ms timeout. - The run prints
timeout=null retries=nulland passes with exit code 0. The run has no test timeout and no retries, with no warning.
The same applies to --global-timeout, --repeat-each and --max-failures.
Additional context
Root cause: overridesFromOptions() in packages/playwright/src/cli/testActions.ts uses parseInt(value, 10) for --timeout, --global-timeout, --retries, --repeat-each and --max-failures. parseInt('30s') is 30, and parseInt('abc') is NaN. NaN is serialized as null over IPC, and !slot.timeout then means "no timeout". Values from the config file are validated in configLoader.ts, but CLI overrides are not.
I have a fix with tests ready: a strict non-negative-integer check that throws a clear usage error. Happy to open a PR if that approach works for you.
Environment
System:
OS: Linux 6.18 Ubuntu 24.04.5 LTS (Noble Numbat)
CPU: (2) x64 Intel(R) Xeon(R) Processor @ 2.10GHz
Memory: 7.84 GB
Container: Yes
Binaries:
Node: 22.22.0
npm: 10.9.4
npmPackages:
@playwright/test: 1.64.1
- Ngôn ngữ chính
- TypeScript
- Star
- 98.5k
- Fork
- 6.7k
- Merge trung bình
- 15 giờ 58 phút
- Pull request đã merge (30 ngày)
- 302
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
-
needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
microsoft/playwright#43741 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 8/100
microsoft/playwright#43834 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Feature]: `Update snapshot` sticky header in UI Mode Attachments panelCó thể đã có người làm @microsoft-playwright-automation đã nhận hôm nay. Đang mởneeds-triage
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 32/100
microsoft/playwright#43833 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Bug]: --only-changed misses a test file when two ESM test files share an importCó thể đã có người làm @cpeaustriajc đã nhận 1 ngày trước. Đang mởneeds-triage
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 15/100
microsoft/playwright#43824 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Feature]: Let an MCP client label its own extension tab groupCó thể đã có người làm @microsoft-playwright-automation đã nhận 1 ngày trước. Đang mởneeds-triage
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 15/100
microsoft/playwright#43823 · 2 bình luận ·
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ự
-
[Bug]: Managed Tailscale Serve recovery misses "must be root" denial and skips sudo fallbackĐang mởclawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:other issue-rating: 🦞 diamond lobster maturity:stable no-stale P1
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
openclaw/openclaw#190772 · 1 bình luận · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
2026-11 good first issue gsoc-2027 project: virtual tests
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 82/100
alphaonelabs/website#1150 · 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 70/100
flisk-sh/run-my-agents#61 ·
-
Độ khó 2/5 3-5 ngày Mức phù hợp với người mới 62/100
career-ops-hq/career-ops#6399 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
agents ai-agents area: cli claude-code difficulty: easy dx enhancement examples good first issue growth hacktoberfest help wanted island: Agent Isle island: Recipe Archipelago rank: 7 kyu tech: typescript
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
tdk-landscape/tdk-cli-core#3126 ·