Skip to content

[C] Tests: fix flaky a_ready_user_token_connects_the_hub - #404

Open
Ewerton Scaboro da Silva (ewertons) wants to merge 3 commits into
mainfrom
fix/sas-user-token-renewal-test-flake
Open

Ewerton Scaboro da Silva (ewertons) wants to merge 3 commits into
mainfrom
fix/sas-user-token-renewal-test-flake

Conversation

@ewertons

Copy link
Copy Markdown
Contributor

a_ready_user_token_connects_the_hub used the real wall clock. When a second boundary falls between token delivery and use, the token's age rounds up to 1 s, the renewal is due 1 s earlier, and sas_token_renewal_due_ms >= before + 80000 fails. Pin the wall clock with fixed_time, as other tests in the file do. Test-only change.

The test used the real time(). A wall-clock second boundary between token
delivery and use ages the token by 1 s, so the renewal is due 1 s earlier
than the asserted bound and the test fails intermittently.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The focused test-only change correctly removes dependence on wall-clock boundaries.

0 open findings

What changed in this PR

Pins the test’s wall clock to eliminate a second-boundary timing race.

Changes:

  • Uses fixed_time for deterministic SAS token renewal timing.
  • Documents the prior flakiness cause.
File Description
c/​tests/​unit/​connection_sas_test.c Stabilizes the user-token connection test.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Copilot AI balanced review requested due to automatic review settings October 10, 2026 01:07

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The focused test-only change correctly removes dependence on wall-clock timing.

0 open findings

🧠 Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings October 10, 2026 01:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

The focused test-only change correctly removes dependence on wall-clock timing.

0 open findings

🧠 Review effort: Balanced

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants