Skip to content

test(auth-sdk): SDK tests await overlapping refreshes and accepted connections instead of sleeping - #698

Open
PiquelChips wants to merge 1 commit into
mainfrom
test/sdk-waits
Open

PiquelChips wants to merge 1 commit into
mainfrom
test/sdk-waits

Conversation

@PiquelChips

@PiquelChips PiquelChips commented Nov 22, 2026 •

Copy link
Copy Markdown
Member

Three Rust SDK tests waited on time:

  • The concurrent-refresh test delayed every refresh by 100ms and hoped two would overlap.
  • The hanging revocation endpoint slept for an hour. That only passed because the test pauses time, and the check will flag a sleep outside a paused test anyway.
  • The cancelled-fetch test let a 100ms timeout run out to cancel the fetch.

Each now waits for the event it needs.

Independent of the other PRs in this series; based on main.

Tests

  • concurrent_refreshes_all_succeed: its token endpoint answers a refresh only once two have arrived (a watch counter), so the two refreshes provably overlap. Before, every answer was delayed by 100ms. A lease between the requests would leave the first unanswered. Checked: with refreshes serialized behind a mutex, the test fails at the SDK's request deadline.
  • TokenEndpoint::start loses its delay argument, since every other caller passed Duration::ZERO.
  • The hanging revocation endpoint awaits std::future::pending() instead of sleeping an hour. The logout test that uses it still pauses time, so the SDK's deadline ends the revocation at once, and its assertions are unchanged.
  • cancelled_fetches_leave_keys_unavailable: the key fetch is cancelled once the silent server accepts its connection (select! on accept), instead of after a 100ms timeout. The test then asserts the same Unavailable result.

I ran the whole sourceorigin-auth suite (49 tests, all features) five times, and it passed every time.

Council review

Rounds: 2

Delegate Round 1 Round 2
GPT 6.1 Sol no score no score
Claude Opus 5.5 8/10 9/10
Claude Fable 5.2 8/10 8/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

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 59 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

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: afcdfb92-b025-498a-b1a8-1ce53374e5c1
Commits

Reviewing files that changed from the base of the PR and between e99cc0e and 4d3770e.

Files selected for processing: 5

  • crates/auth-sdk/src/axum/tests/backchannel.rs
  • crates/auth-sdk/src/axum/tests/login.rs
  • crates/auth-sdk/src/axum/tests/mod.rs
  • crates/auth-sdk/src/axum/tests/sessions.rs
  • crates/auth-sdk/src/tests.rs
  • 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