Repository navigation
Conversation
rintaro
marked this pull request as draft
September 19, 2026 15:53
Member
Author
|
@swift-ci Please test |
rintaro
force-pushed
the
fix-index-timeout-test-flakiness
branch
from
September 19, 2026 21:19
69917e6 to
2d3d1f1
Compare
Member
Author
|
@swift-ci Please test Windows |
1 similar comment
Member
Author
|
@swift-ci Please test Windows |
All tests share one module cache, so a test can wait on a module lock that another test holds. Cancelling an index or preparation task kills the compiler, and `TaskScheduler.shutDown` cancels every in-flight task when a server shuts down, so tests routinely kill compilers that may hold a lock. `LockFileManager.processStillExecuting` only detects a dead lock owner on Unix, so on other platforms the waiter blocks for the full lock timeout before clearing the lock and building the module itself, which can exceed what an index task absorbs within its own timeout. Report module builds with `-Rmodule-build` and lock acquisitions with `-Rmodule-lock`, which is a separate diagnostic group, so that the log shows every lock event rather than only a timeout. Lower the wait to 10 seconds so that contention shorter than the 90 second default is reported instead of resolving silently. The shorter wait makes clang clear a lock that a live owner still holds, so some duplicate module builds are expected. That is acceptable for reproducing the stalls and is why this is not intended to be merged.
rintaro
force-pushed
the
fix-index-timeout-test-flakiness
branch
from
September 20, 2026 04:19
2d3d1f1 to
d5ba1c3
Compare
Member
Author
|
@swift-ci Please test Windows |
13 similar comments
Member
Author
|
@swift-ci Please test Windows |
Member
Author
|
@swift-ci Please test Windows |
Member
Author
|
@swift-ci Please test Windows |
Member
Author
|
@swift-ci Please test Windows |
Member
Author
|
@swift-ci Please test Windows |
Member
Author
|
@swift-ci Please test Windows |
Member
Author
|
@swift-ci Please test Windows |
Member
Author
|
@swift-ci Please test Windows |
Member
Author
|
@swift-ci Please test Windows |
Member
Author
|
@swift-ci Please test Windows |
Member
Author
|
@swift-ci Please test Windows |
Member
Author
|
@swift-ci Please test Windows |
Member
Author
|
@swift-ci Please test Windows |
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.
Investigating #2766
All tests share one module cache, so a test can wait on a module lock
that another test holds. Cancelling an index or preparation task kills
the compiler, and
TaskScheduler.shutDowncancels every in-flight taskwhen a server shuts down, so tests routinely kill compilers that may
hold a lock.
LockFileManager.processStillExecutingonly detects adead lock owner on Unix, so on other platforms the waiter blocks for
the full
-fimplicit-modules-lock-timeout, which defaults to 90seconds, before clearing the lock and building the module itself. That
exceeds what an index task can absorb within its own timeout, and the
resulting failure looks like slow indexing rather than lock contention.
Lower the wait to 30 seconds so that it cannot consume the index store
timeout, and pass
-Rmodule-buildso thatremark_module_lock_timeoutidentifies the module whose lock was contended.
Whether lock contention actually causes the observed stalls is not
established; the remark is what would confirm or rule it out.