test(relay): make mesh demo test use production's directory lease - #7402
Open
rebekz wants to merge 1 commit into
Open
test(relay): make mesh demo test use production's directory lease#7402rebekz wants to merge 1 commit into
rebekz wants to merge 1 commit into
Conversation
Stabilize the upstream test from ccb021d/block#1670 by using the same 30-second SessionDirectory default as production instead of a 5-second lease shorter than the 10-second echo timeout. Signed-off-by: Fitra Kacamarga <fitra.19@gmail.com>
🔐 Codex Security Review
|
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
mesh_demo::demo_join_forwarded_arm_round_trips_echofails with a 504 under load and passes in isolation — a timing race, not a logic bug.The test helper builds its
SessionDirectorywith a test-only 5-second lease override, whilerun_demo_join's echo timeout is 10 seconds and the demo join intentionally does not renew. The lease therefore expires mid-wait and the echo can never arrive in time. The detached owner task hides the fence expiry, so it surfaces as an opaque 504.Adding tracing changed the scheduling enough for the same test to pass in 0.01s, which confirms the race.
Fix
Drop the test-only override and construct the directory exactly as production does:
SessionDirectory::newdelegates towith_lease_ttl(pool, DEFAULT_LEASE_TTL)whereDEFAULT_LEASE_TTL = 30s(tunnel/directory.rs:15,191).Note this deliberately makes the test faithful rather than merely tolerant — inflating the TTL to some larger number would have widened the race window instead of removing the premise. The test was exercising a lease configuration production never uses.
Verification
Isolated test passes, exit 0. No production code changed — the diff is confined to
#[cfg(test)] mod tests.🤖 Generated with Claude Code