test(notebook): decouple redirect trust from probe timing - #2228
Merged
Conversation
Codex ReviewVerdict: mergeable No actionable findings. Summary: The change only removes a timing-sensitive competing candidate from an existing redirect-trust test. Static inspection found no concrete merge-blocking defect. |
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.
Problem
PR #2226's Ubuntu full-suite shard failed the existing USTC-to-NJU redirect trust test. The test expected USTC to be selected even when the equally valid official mirror completed faster. Coverage aggregation inherited the same failure. This test entered main in #2217; it is unrelated to the Specialist implementation.
Proposed change
Test accepted redirects with USTC as the sole candidate. Retain the untrusted-redirect fallback assertion and existing dedicated fastest-mirror tests. Production behavior is unchanged.
Acceptance criteria and validation
Reproduced the exact CI mismatch deterministically by making mocked USTC requests advance a controlled
Date.nowclock while official requests did not: original assertion selected the official mirror and failed. The corrected assertion passed under the same clock. The clock instrumentation was then removed because acceptance no longer depends on relative latency.Final test-only diff ->
npm test -- src/main/notebook/mirror-probe.test.ts-> all 14 tests passed.npm run lint, targeted Prettier andgit diff --checkpassed after the material edit. No production interfaces, consumers, persistence, UI, or data compatibility changed; no full local test run. Final-head PR Gate and independent review remain required.Review focus
Ensure trust rejection/fallback remains covered and the accepted-redirect assertion no longer assumes wall-clock ordering. No latency policy or timeout changes.