Skip to content

Make LSP server-busy backpressure cancellation test deterministic under suite load #4785

Description

@Widthdom

Summary

LspServerTests.RunAsync_ServerBusyBackpressureRetainsEveryRejectedResponse_Issue4721 is timing-sensitive under full-suite load. The active workspace-symbol request can finish its fixed five-second test delay before the queued cancellation is observed, so the test receives a success result and dereferences a missing error object.

Evidence

  • A Release net8.0 full-suite run failed at LspServerTests.cs:1542 after about 41 minutes with NullReferenceException.
  • A second Release net8.0 full-suite run with TRX logging reproduced the same test failure after 17 seconds.
  • Three isolated Release net8.0 reruns passed in about 0.12 seconds each.
  • The full Release net9.0 suite passed with 9,720 tests and 403 skips.
  • The test was introduced with the closed partial-result/backpressure work in Support LSP partial results and work-done progress for large symbol responses #4721.

Expected behavior / direction

Use a deterministic synchronization boundary for the active request and cancellation instead of matching two five-second timing windows. The test should prove that cancellation is observed while the request is blocked, independent of full-suite CPU or I/O load.

Scope note

Discovered while validating #4750. It is unrelated to the position-file reader change and is not included in that implementation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions