Skip to content

test: session expiry and listener tests wait for their events instead of sleeping - #695

Open
PiquelChips wants to merge 1 commit into
test/jobs-waitsfrom
test/expiry-waits
Open

PiquelChips wants to merge 1 commit into
test/jobs-waitsfrom
test/expiry-waits

Conversation

@PiquelChips

@PiquelChips PiquelChips commented Nov 22, 2026 •

Copy link
Copy Markdown
Member

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_now to 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

  • New SessionRepository::expire(id) (test-util): sets expires_at = clock_timestamp(), like the existing RecoveryRepository::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 the Utc::now() recheck removed from Session::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 by Utc::now(), which paused tokio time doesn't move. Removing this sleep would need a clock injected into AdminService, 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

Delegate Round 1 Round 2 Round 3
GPT 6.1 Sol no score no score no score
Claude Opus 5.5 8/10 9/10 9/10
Claude Fable 5.2 8/10 8/10 9/10

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)

@coderabbitai

coderabbitai Bot commented Nov 22, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 897840b2-233b-4ab1-805f-91396ebde939

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@PiquelChips
PiquelChips marked this pull request as ready for review November 22, 2026 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Needs Triage

Development

Successfully merging this pull request may close these issues.

1 participant