Skip to content

Fix flaky Windows test: ProjectService sub-project re-search test's fixed sleeps - #2364

Open
louis-johnston-db wants to merge 1 commit into
release/3.xfrom
fix/windows-flake-projectservice-859d3f
Open

louis-johnston-db wants to merge 1 commit into
release/3.xfrom
fix/windows-flake-projectservice-859d3f

Conversation

@louis-johnston-db

Copy link
Copy Markdown
Contributor

Changes

  • src/kernel/project/ProjectService.test.ts, "keeps the sub-projects it found while it searches the same folder again": the file event reaches a detection pass only after two debounce timers (BundleFiles' and the service's), which Windows can wake late. The test slept 20 ms and then called service.settled(), which returns at once when no pass has started yet, so it could read search.held() before the new search began. It now reports the event and uses vi.waitFor until the new search is held.
  • After releasing the search, it waited a fixed 20 ms for the glob and path lookups to finish. It now uses vi.waitFor until the sub-projects are ["nested", "other"]. The status stays "done" during a re-search of the same folder, so there is no status to wait on.
  • The assertions are unchanged, and no production code changed.

Tests

  • yarn vitest run src/kernel/project/ProjectService.test.ts in packages/databricks-vscode.
  • The same test under a repro that delays the service's debounce and the file search to mimic Windows timing: it failed at the search.held() assertion before the fix and passes with it. The repro is not part of this change.
  • yarn oxfmt and yarn oxlint --deny-warnings on the changed file.

Evidence:

  • Windows CI, last 14 days: failed in 1 of 116 test-windows runs on release/3.x and its pull requests, with Linux test passing in the same runs; last seen 2026-11-22. Runs: 45052414464.
  • Linux repro (not part of this change; src/kernel/project/ProjectService.repro.test.ts): failed 30 of 30 runs without the fix, 0 of 30 with it.
  • The touched test files under CPU load: 20 of 20 runs passed.
  • yarn workspace databricks test: 3117 passed, 0 failed. yarn check: passed.

This pull request and its description were written by Isaac.

…ixed sleeps

The test now waits for what it checks instead of sleeping 20 ms twice. After the file event it waits until the second sub-project search is held, which only happens once the detection pass behind BundleFiles' and the service's debounce timers has run, so a late Windows timer can no longer make settled() return before the pass. After release it waits until the sub-projects list both folders, since the search status stays "done" during a re-search and there is nothing else to wait on.

Co-authored-by: Isaac <no-reply@databricks.com>

This branch was previously deployed

1 inactive deployment
test-trigger-is — 6647ac69 Deployed Nov 30, 2026 by louis-johnston-db via Trigger Tests #2636
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant