Skip to content

Make concurrency regression tests independent of wall time - #65353

Merged
Jake Bailey (jakebailey) merged 4 commits into
microsoft:mainfrom
jakebailey:completion-race-timeout
Nov 6, 2026
Merged

Jake Bailey (jakebailey) merged 4 commits into
microsoft:mainfrom
jakebailey:completion-race-timeout

Conversation

@jakebailey

@jakebailey Jake Bailey (jakebailey) commented Nov 6, 2026 •

Copy link
Copy Markdown
Member

Regression from #64178, but then other fixes.

I recommend reviewing with https://github.com/microsoft/TypeScript/pull/65353/changes?w=1

The race-enabled suite can delay a valid completion beyond the test's
ten-second watchdog, causing a false deadlock failure on busy workers.
Deadlock coverage should depend on blocked goroutines, not elapsed
wall time.
Copilot AI balanced review requested due to automatic review settings November 6, 2026 06:54
@github-project-automation github-project-automation Bot moved this to Not started in PR Backlog Nov 6, 2026
@typescript-automation typescript-automation Bot added Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Nov 6, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are reported for the change replacing the completion regression test’s wall-clock timeout with synctest deadlock detection.

No open issues 🎉

What changed in this PR

This PR makes the completion deadlock regression test independent of wall time, avoiding false failures when race-enabled runs are slow while preserving coverage for completions with symbols and existing imports.

Changes:

  • Wraps the test setup and completion request in synctest.Test.
  • Removes the goroutine, result channel, and ten-second watchdog.
  • Preserves the assertion that the expected auto-import completion is returned.
File Description
tsc/​internal/​api/​session_completion_test.go Replaces the wall-clock timeout with synctest deadlock detection.

Review effort: Balanced

Other in-memory concurrency regressions use wall-clock watchdogs or
sleep to infer that work is blocked. On busy workers those checks can
report false failures or miss premature shutdown, while the mapper
initialization test always spends five real seconds waiting for its
deadline.
@jakebailey Jake Bailey (jakebailey) changed the title Make completion deadlock regression independent of wall time Make concurrency regression tests independent of wall time Nov 6, 2026
@github-project-automation github-project-automation Bot moved this from Not started to Needs merge in PR Backlog Nov 6, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, can you add a line to Copilot's testing instructions about this?

@github-project-automation github-project-automation Bot moved this from Needs merge to Waiting on author in PR Backlog Nov 6, 2026
@jakebailey

Copy link
Copy Markdown
Member Author

As in, "don't use sleeps, use synctest"? Yeah.

@jakebailey

Copy link
Copy Markdown
Member Author

Er, the compiler and fourslash test skill exists and we've been shoving instructions in it, but it's not supposed to be loaded for regular tests like these. Should that be renamed? I can tack into it in any case.

Wall-clock watchdogs can mistake slow race-enabled execution for a
deadlock. Keep guidance alongside the existing testing instructions so
future in-memory concurrency tests avoid timing-dependent assertions.
@jakebailey

Copy link
Copy Markdown
Member Author

I'm confusing this for the API skill. I don't think it should go in any of those so I'm moving it to the general file.

Concurrency tests outside compiler and fourslash work also need this
guidance. Repository-wide instructions make it discoverable without
requiring an unrelated testing skill to be loaded.
@github-project-automation github-project-automation Bot moved this from Waiting on author to Needs merge in PR Backlog Nov 6, 2026
@jakebailey
Jake Bailey (jakebailey) added this pull request to the merge queue Nov 6, 2026
Merged via the queue into microsoft:main with commit 64aa467 Nov 6, 2026
34 checks passed
@jakebailey
Jake Bailey (jakebailey) deleted the completion-race-timeout branch November 6, 2026 21:51
@github-project-automation github-project-automation Bot moved this from Needs merge to Done in PR Backlog Nov 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants