From 3086fcc1121bc539b2e31ef494a20dfc3470d04d Mon Sep 17 00:00:00 2001 From: fabbrik <22822543+fabbrik@users.noreply.github.com> Date: Fri, 30 Oct 2026 18:10:02 -0500 Subject: [PATCH] test: recall tests no longer race the 300 ms lookup bound on a loaded machine The shared recall test host used timers that never fire, but the recall bound is measured from the clock's timestamps, which were the system's. Under CI load (floating-dependencies, PR #219) a lookup took over 300 ms and timed out. Tests on that clock now get a one-hour bound unless they set their own; the timeout test keeps its manual clock. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01GPXz56QPQAzDSyJTxbQTTy --- .../RecallAtFailureTests.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/AgentExperience.MicrosoftAgentFramework.Tests/RecallAtFailureTests.cs b/tests/AgentExperience.MicrosoftAgentFramework.Tests/RecallAtFailureTests.cs index 017df09..9aff337 100644 --- a/tests/AgentExperience.MicrosoftAgentFramework.Tests/RecallAtFailureTests.cs +++ b/tests/AgentExperience.MicrosoftAgentFramework.Tests/RecallAtFailureTests.cs @@ -492,6 +492,9 @@ public ServiceProvider Build(Action? configure = null) ArtifactRevision: "recall-tests")); }; configure?.Invoke(options); + // On the system clock's timestamps a loaded machine can spend the default 300 ms bound before the + // lookup ends (seen in CI). A test that wants the bound to pass sets its own clock and advances it. + var realElapsed = options.TimeProvider is NeverFiringTimers; var injection = options.Injection; options.Injection = settings => { @@ -500,7 +503,13 @@ public ServiceProvider Build(Action? configure = null) settings.OnContextInjected = Injections.Add; if (settings.Recall is { } recall) { - settings.Recall = recall with { OnRecall = result => { lock (Recalls) { Recalls.Add(result); } } }; + settings.Recall = recall with + { + LookupTimeout = realElapsed && recall.LookupTimeout == ExperienceRecallOptions.DefaultLookupTimeout + ? TimeSpan.FromHours(1) + : recall.LookupTimeout, + OnRecall = result => { lock (Recalls) { Recalls.Add(result); } }, + }; } }; options.Capture = capture =>