Unskip 14 passing formatting fourslash tests#2863
Closed
Conversation
Co-authored-by: jakebailey <5341706+jakebailey@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix unstable test cases for consistent results
Unskip 14 passing formatting fourslash tests
Feb 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
These 14 formatting tests were skipped but now pass consistently after recent formatter fixes in #2793 and #2852.
Root cause
The tests exercised three bugs in
internal/format/span.go, all now fixed:lastIndentedLinezero-value bug (Fixed a formatting crash on comments inside blocks starting on first line #2793): Go zero-value0matched line 0 incomputeIndentation, returning-1indentation. Fixed by initializing to-1..go(porting bug) #2852):listStartToken != -1was always true sinceast.Kinduses0(KindUnknown), not-1. Fixed to compare againstast.KindUnknown.child.Flags&ast.NodeFlagsReparsed != 0guard inprocessChildNode.Potential race (not confirmed)
warmAutoImportCacheruns in a background goroutine and callsgetSnapshot→flushChanges, which drainspendingFileChanges. The dispatch loop does the same for formatting requests. If the background task runs between adidChangebeing queued and the formatting request'sgetSnapshot, it could drain the change first. The snapshot ends up correct either way, but goroutine scheduling determines who flushes. Unable to reproduce flakiness despite 200+ runs with race detector, stress conditions, and full suite repetition.Changes
internal/fourslash/_scripts/failingTests.txt🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.