Skip to content

test(mcp): assert the fresh retry ceiling in the serialized clock domain - #1482

Open
Seyamalam wants to merge 1 commit into
zzet:mainfrom
Seyamalam:fix/fresh-symbol-retry-clock-domain
Open

Seyamalam wants to merge 1 commit into
zzet:mainfrom
Seyamalam:fix/fresh-symbol-retry-clock-domain

Conversation

@Seyamalam

Copy link
Copy Markdown

Summary

Fixes #1318.

TestFreshSymbolSearchPersistentDriftAndCancellationStayBounded derived its expected ceiling from a monotonic-bearing time.Now().Add(120ms), while the request serializes wait_deadline as RFC3339Nano and takeRequestFreshness parses a wall-clock-only deadline — so the "drift exhausted its ceiling" assertion ran in a different clock domain than the retry loop, and could fire before the serialized ceiling had actually passed. The test now parses its expected deadline from the exact serialized string sent in the request, matching the domain the handler uses.

Changes

  • Parse the expected ceiling with time.Parse(time.RFC3339, serialized) — the same parse the request path performs — instead of retaining the monotonic-bearing time.Now() value
  • Verify on every attempt that the retry retains the same absolute ceiling, with the attempt number and both deadlines in the failure message
  • Report the attempt count and the serialized ceiling when the drift-exhaustion assertion fails
  • 120 ms allowance, multiple-attempt requirement, and error/cancellation assertions unchanged; no product timeout or retry change

Testing

  • Tests for the touched packages pass (make test PKGS=./internal/mcp/...); CI runs the full suite
  • New tests added for new functionality
  • Benchmarks run if performance-relevant

Checklist

  • Code follows existing patterns in the codebase
  • No unnecessary abstractions added
  • Language extractor includes Meta["methods"] for interfaces (if applicable)
  • Methods have EdgeMemberOf edges to their containing type (if applicable)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix clock-domain comparison in fresh-symbol retry regression

1 participant