Repository navigation
test(app): remove real reconciliation cooldown waits - #1923
Merged
Merged
Conversation
Remove real cooldown waits from reconciliation result tests while retaining manually controlled polling and cooldown-enforcement coverage. Co-Authored-By: mecatl <[email protected]>
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.
Summary
Use the existing
mcpReconcilerOptions.afterdependency-injection seam to remove real one-second cooldown waits from three reconciliation result tests:TestMCPSourceReconciliation_Scenario1_OrderedSourcesLKGAndEmptyTestMCPSourceReconciliation_Scenario1_ProductionTriggerMatrixTestMCPSourceReconciliation_StatusPublishesOnlyActiveCandidateInventoryA test-only helper checks the requested cooldown duration and supplies a fresh, buffered, already-fired timer channel. The production loop still consumes its cooldown channel; no production code or polling interval changes.
The ToolHive polling channel and jitter-bound assertions remain manually controlled. Dedicated notification-storm and deferred-runtime-drain tests retain their held timers, so cooldown enforcement is still exercised. All existing assertions are preserved.
Measured benefit
Same targeted selection, forced uncached with
-count=1, measured withgo test -json:This is measured test execution time, not a command-count estimate or a whole-suite speedup claim.
Verification
internal/apppackage passed (54.684 s in this run).TestMCPReconcilerNotificationStormCooldownandTestDeferredRuntimeDrainAutomaticallyReconcilesAndPublishespassed 20 repetitions under-race.Stale=falsemade all four inventory failure variants fail; the production mutation was reverted before the final package run.git diff --checkpassed.Scope and readiness
Routine: test-only use of an existing injected timer dependency. No production behavior, interfaces, assertions, or documentation changes.
Draft because repository-wide final lint/test/race gates have not been run for this candidate. The scoped checks above are complete; aggregate pre-ready verification is not claimed.