Repository navigation
Run the blocking parts of the rotation race test on dedicated threads - #809
Merged
Merged
Conversation
The test parks the rotation inside Unprotect and then needs a second thread for the concurrent save. Both ran on the thread pool, so a busy runner could leave the save unscheduled for the full 10 s barrier and the test failed with "test barrier". Dedicated threads remove the dependency on thread-pool growth. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
RuntimeOverridesSecretRotationTests.Rotation_ConcurrentSettingsSaveWaits_ThenUsesResealedDocumentAndBackupfailed three times today, on #807 and twice on #808, each time withTimeoutException: test barrierafter 10 s. Main passed the same test in between.The test parks the rotation inside a mocked
Unprotectuntil the concurrent save has started. Both the rotation and the save were started withTask.Run, so the save needs a second thread-pool thread while the first one is blocked. On a busy runner the pool can take longer than the 10 s barrier to grow. The rotation then throws "test barrier", which also hides the assertion in thefinally. Today's other backend flakes are timing failures as well, on a waitAny elapsed bound and a 1 s FileWatcher deadline, which fits a loaded runner.The fix runs both blocking parts on dedicated threads (
TaskCreationOptions.LongRunning). The test no longer depends on thread-pool growth, and there are no sleeps or longer timeouts.I could not reproduce the starvation locally.
DOTNET_ThreadPool_ForceMaxWorkerThreadshad no effect on .NET 10, and both versions passed with it.Tests run locally:
NodePilot.Api.Testswith filterRuntimeOverridesSecretRotationTests, 5 runs (4 tests each)🤖 Generated with Claude Code