Skip to content

test(lsp-core): synchronize unscoped applyEdit response - #8955

Closed
code-yeongyu wants to merge 1 commit into
devfrom
fix/win-ci-lsp-applyedit
Closed

code-yeongyu wants to merge 1 commit into
devfrom
fix/win-ci-lsp-applyedit

Conversation

@code-yeongyu

@code-yeongyu code-yeongyu commented Sep 27, 2026 •

Copy link
Copy Markdown
Owner

Summary

This PR makes the unscoped workspace/applyEdit lease test observe the exact response event deterministically. The fixture request is now triggered by textDocument/didOpen, after the test has armed the existing subscription-based event wait.

Root cause

The failing test triggered the server request during LSP initialization and only started observing afterward. Its helper polled an event file every 10 ms and silently returned an empty array after a 2-second circuit breaker. Under the parallel Windows shard, that produced responses[0] === undefined even though the product rejection path is platform-neutral.

Evidence:

Fix

  • Arm waitForEventCountBySubscription before the request trigger.
  • Trigger the unscoped fixture request from the controlled didOpen notification.
  • Leave production code, shared polling-helper semantics, and all timeout budgets unchanged.

Evidence

  • Focused file: 8 passed, 0 failed.
  • Focused stress: 400 passed, 0 failed across 50 reruns.
  • lsp-core suite: 167 passed, 1 existing platform-specific skip, 0 failed.
  • bunx tsgo --noEmit -p packages/lsp-core/tsconfig.json: exit 0.
  • Biome changed-file check: exit 0.
  • git diff --check: exit 0.
  • Local evidence SHA-256: 135e3ebc84701e309a127aa1f015fbc084e03290c97f32824d1ee61d69b36333.

Focused Windows soak links will be added after all three 10-iteration runs complete.

Risks and residuals

  • The shared polling helper is intentionally unchanged. Historical CI evidence shows replacing it globally regresses unrelated cancellation tests.
  • This PR is test-only and does not change LSP product behavior.

Fixes #8954
Refs #8324


Summary by cubic

Fixes the flaky unscoped workspace/applyEdit lease test that failed intermittently on the Windows CI shard by triggering the request from textDocument/didOpen only after the response subscription is armed.

Bug Fixes

  • The test previously fired the request during LSP initialization and only started observing afterward, so the polling helper could miss the response.
  • The fixture server now emits an unscoped applyEdit on didOpen when the test opts in via scenario.unscopedApplyEditOnDidOpen.
  • Production LSP behavior and the shared polling helper are unchanged.

Written for commit 911293e. Summary will update on new commits.

Review in cubic

@code-yeongyu

Copy link
Copy Markdown
Owner Author

Focused Windows soaks of this branch (windows-latest, 10 iterations each): 36322413097 success, 36322416052 success, 36322419931 success.

@code-yeongyu
code-yeongyu force-pushed the fix/win-ci-lsp-applyedit branch from 5e17d48 to 911293e Compare September 27, 2026 22:27
@code-yeongyu

Copy link
Copy Markdown
Owner Author

Run 36355338604 failed only on senpi-compatibility (windows-latest), in the kibitzer wake-slot FIFO test: EPERM opening a wake ticket in reapDeadHead (palace is its cascade). That is a pre-existing dev flake fixed by #8970 and unrelated to this lsp-core change. #8970 merges first, then this PR is re-rebased and re-run.

@code-yeongyu

Copy link
Copy Markdown
Owner Author

Superseded by #8961, which lands this fix together with the other win-ci fixes as one merge (all commits of this branch kept, bundles regenerated once over the merged sources). The evidence in this PR (RED/GREEN, focused Windows soaks) still applies; the issue is closed by #8961's Fixes line.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:full-matrix Force the full 3-OS CI matrix on this PR lsp-core Changes under packages/lsp-core

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ci(windows): LSP applyEdit lease test polls past its response budget

1 participant