Repository navigation
test: session expiry and listener tests wait for their events instead of sleeping - #695
Open
PiquelChips wants to merge 1 commit into
Open
PiquelChips wants to merge 1 commit into
PiquelChips wants to merge 1 commit into
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
PiquelChips
force-pushed
the
test/jobs-waits
branch
from
November 22, 2026 14:33
84252d6 to
b7820f6
Compare
PiquelChips
force-pushed
the
test/expiry-waits
branch
from
November 22, 2026 14:33
908854f to
8442b4d
Compare
PiquelChips
force-pushed
the
test/expiry-waits
branch
from
November 22, 2026 14:51
8442b4d to
7954eec
Compare
PiquelChips
force-pushed
the
test/jobs-waits
branch
from
November 22, 2026 14:51
b7820f6 to
e10c34c
Compare
PiquelChips
marked this pull request as ready for review
November 22, 2026 14:55
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.
This covers the last three auth-service tests that waited on time. One slept 1.5s for a session to expire. Another trusted a single
yield_nowto get a request into its handler. The third waits on the system clock and has to keep doing so, so it now says why.Stacked on #694.
Changes
SessionRepository::expire(id)(test-util): setsexpires_at = clock_timestamp(), like the existingRecoveryRepository::expire. It adds one SQLx cache entry.Tests
session_lock_rechecks_expiry_after_waiting: the session now lasts an hour. Once the change is blocked on the account lock (until_blocked), the test expires it. Before, the session lasted one second and the test slept 1.5s. The change's transaction still starts before the expiry, so only the recheck after the lock can refuse it. Checked: with theUtc::now()recheck removed fromSession::lock, the test fails.a_stop_cuts_off_requests_after_the_grace_period: the handler reports on a channel when the request reaches it, and the test awaits that before stopping. Before, it yielded once and hoped. The test still asserts exactly the grace period in paused time.mutations_recheck_the_confirmation_after_waiting: keeps its sleep, now with a// wall-clock:comment. The dashboard confirmation ends byUtc::now(), which paused tokio time doesn't move. Removing this sleep would need a clock injected intoAdminService, which is a change of its own.I ran the 3 tests five times against a scratch cluster, and they passed every time.
Council review
Rounds: 3
GPT 6.1 Sol could not take part: its account hit its usage limit.
Note
Written by Claude Opus 5.5 in Claude Code and reviewed by Claude Opus 5.5 and Claude Fable 5.2 (via T3 Code)