swiftlang / sourcekit-lsp

Language Server Protocol implementation for Swift and C-based languages
Apache License 2.0
3.2k stars 264 forks source link

Fix a nondeterministic test failure of `testDontStackTargetPreparationForEditorFunctionality` #1499

Closed ahoppen closed 1 week ago

ahoppen commented 1 week ago

We fulfilled the allDocumentsOpened expectation directly after dispatching the notification to open LibD.swift. This left a very short window in which LibB’s preparation could finish and LibC’s expectation could start before the open notification for LibD.swift was handled, causing an unexpected preparation of LibC.

This fixes the issue first reported as rdar://129698768 and for which I added logging in https://github.com/apple/sourcekit-lsp/pull/1478.

ahoppen commented 1 week ago

@swift-ci Please test