Repository navigation
Make three timing-dependent engine tests deterministic - #814
Merged
Merged
Conversation
- waitAny: the slow branch never finishes on its own, so the run can only complete if the junction fires on the fast branch and stands the slow one down. That replaces the wall-clock bound. - Cancelled write: the losing branch always loses for the same reason, so it always attempts its Cancelled write. - FileWatcher: RunBoundedAsync started the blocking filesystem call with Task.Run, so the hard deadline also counted the wait for a pool thread. On a busy host that made a healthy directory look unreachable, in tests and in production. The call now runs on a dedicated thread, which also keeps a hung SMB call off the pool. 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.
Three backend tests failed on busy CI runners in the last day, each on a wall-clock assumption.
ExecuteAsync_WaitAnyJunction_FiresAfterFirstBranchCompletes(measured 1604 ms against a 1500 ms bound): the slow branch now waits forever, so the run can only finish if the waitAny junction fires on the fast branch and stands the slow one down. The test asserts exactly that, withbranchSlowendingCancelled. A 30 sWaitAsyncturns a regression into a failure instead of a hang.ExecuteAsync_CancelledStepWriteFailsWithNonOutageError_DoesNotFailTheWinningRun(the loser finished inside its 3 s window, so no Cancelled write happened): same approach, the loser can only end through the stand-down.FileWatcherSnapshotDeadlineTests(StartAsyncreported the temp directory as unreachable within 1 s): the cause is in the product code.RunBoundedAsyncstarted the blocking filesystem call withTask.Run, so the hard deadline also counted the wait for a pool thread. On a busy host a healthy directory could look unreachable, and that applies to production as well. The call now runs on a dedicated thread (TaskCreationOptions.LongRunning), which also keeps a hung SMB call off the pool. It runs once per registration, health probe or reconcile, so the extra thread is cheap.RunBoundedAsync_RunsWorkOffTheThreadPoolpins this, and the CHANGELOG has a line under Fixed.Tests run locally (Engine.Tests):
WorkflowEngineTests,WorkflowEngineUnpersistedFailureTests,FileWatcherTriggerSourceTestsandFileWatcherSnapshotDeadlineTests(122 tests)NodePilot.Engine.Tests.Triggersnamespace andTriggerOrchestrator(235 tests)The rest is covered by CI.
🤖 Generated with Claude Code