Repository navigation
[C] Tests: fix flaky a_ready_user_token_connects_the_hub - #404
Open
Ewerton Scaboro da Silva (ewertons) wants to merge 3 commits into
Open
Ewerton Scaboro da Silva (ewertons) wants to merge 3 commits into
Ewerton Scaboro da Silva (ewertons) wants to merge 3 commits into
Conversation
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.
Ewerton Scaboro da Silva (ewertons)
requested review from
Avishek (avishekpant) and
Maxim Semenov (maximsemenov80)
as code owners
October 10, 2026 00:50
Copilot started reviewing on behalf of
Ewerton Scaboro da Silva (ewertons)
October 10, 2026 00:51
View session
Contributor
There was a problem hiding this comment.
🟢 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_timefor 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 started reviewing on behalf of
Ewerton Scaboro da Silva (ewertons)
October 10, 2026 01:08
View session
Copilot started reviewing on behalf of
Ewerton Scaboro da Silva (ewertons)
October 10, 2026 01:36
View session
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.
a_ready_user_token_connects_the_hubused 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, andsas_token_renewal_due_ms >= before + 80000fails. Pin the wall clock withfixed_time, as other tests in the file do. Test-only change.