Skip to content

harden find-in-files no-op preview tests against slow runners - #18039

Merged
kevinushey merged 2 commits into
mainfrom
test/find-in-files-noop-preview-flake
Jun 22, 2026
Merged

kevinushey merged 2 commits into
mainfrom
test/find-in-files-noop-preview-flake

Conversation

@kevinushey

Copy link
Copy Markdown
Collaborator

The three Find in Files no-op replace-preview tests (regex replace preview omits..., literal replace preview omits..., regex replace preview retains a line mixing...) intermittently fail on loaded CI runners. The failures showed the all-no-op file still listed, or an <ins> count of 2 instead of 1.

Root cause

These tests asserted against Playwright's default 5s expect timeout (the suite sets no expect.timeout), while the rest of the file uses the 20s TIMEOUTS.fileOpen budget. After typing a replacement, the debounced preview re-runs the search server-side; on a saturated runner that roundtrip exceeds 5s, so the pre-preview listing was still in place when the assertion fired.

The intended "wait for the preview" gate was also ineffective: it waited on real_change.txt/mixed.txt, which were already listed by the pre-preview search, so it never actually blocked on the preview landing.

Change

  • Gate on the replacement marker (<ins>), which only appears once the debounced preview renders -- a real "preview settled" signal -- instead of a file that was already present.
  • Give the post-preview present/absent and ins-count assertions the longer TIMEOUTS.fileOpen budget so a slow server roundtrip (or a transient mid-render double-decorate) can settle.

No assertion is weakened; each test verifies the same end state. Verified locally: full find_in_files_replace.test.ts suite passes (8/8) in dev desktop mode.

Test-only change (e2e flake hardening); no NEWS entry.

@github-actions

github-actions Bot commented Jun 22, 2026 •

Copy link
Copy Markdown

🪟 Windows Desktop E2E · Server 2025 x64

✅ All tests passed!

████████████████████ 100% pass rate

✅ Passed ❌ Failed ⚠️ Skipped 🔁 Flaky
406 0 15 1
📥 Download Playwright report

⬇️ playwright-report.zip — extract and open index.html

Includes screenshots, traces, and step-by-step details for every test. Expires in 15 days.


2 shards · Windows Server 2025 x64 · commit 9165e605da5e15347b4736e2126db9c9c462029a · Run #141

@github-actions

Copy link
Copy Markdown

🍎 macOS Desktop E2E · ARM64

✅ All tests passed!

████████████████████ 100% pass rate

✅ Passed ❌ Failed ⚠️ Skipped 🔁 Flaky
402 0 18 0
📥 Download Playwright report

⬇️ playwright-report.zip — extract and open index.html

Includes screenshots, traces, and step-by-step details for every test. Expires in 15 days.


2 shards · macos-26 ARM64 · commit 9165e605da5e15347b4736e2126db9c9c462029a · Run #141

@kevinushey
kevinushey merged commit 34ee6ca into main Jun 22, 2026
15 checks passed
@kevinushey
kevinushey deleted the test/find-in-files-noop-preview-flake branch June 22, 2026 23:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant