Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unstable TestTokenAuthority.tokens_are_revoked_in_time test #3804

Closed
Saviq opened this issue Mar 7, 2025 · 1 comment · Fixed by #3805
Closed

Unstable TestTokenAuthority.tokens_are_revoked_in_time test #3804

Saviq opened this issue Mar 7, 2025 · 1 comment · Fixed by #3805

Comments

@Saviq
Copy link
Collaborator

Saviq commented Mar 7, 2025

Judging by the test name, it relies on timing things, which in this case didn't work out.

The failure comes from a riscv64 build, running on QEMU, so has the potential for being our slowest.

292/325 Test #295: mir_unit_tests.TestTokenAuthority.* ..............................................................................................***Failed   13.20 sec
Running main() from main.cpp
Note: Google Test filter = TestTokenAuthority.*:-:--
[==========] Running 6 tests from 1 test suite.
[----------] Global test environment set-up.
[----------] 6 tests from TestTokenAuthority
[ RUN ] TestTokenAuthority.can_issue_tokens
[ OK ] TestTokenAuthority.can_issue_tokens (33 ms)
[ RUN ] TestTokenAuthority.tokens_are_revoked_in_time
./tests/unit-tests/shell/test_token_authority.cpp:84: Failure
Expected: (delta_ms - revocation_time) < (epsilon), actual: 14ms vs 10ms

[ FAILED ] TestTokenAuthority.tokens_are_revoked_in_time (3043 ms)
[ RUN ] TestTokenAuthority.manual_revocation_works_correctly
[ OK ] TestTokenAuthority.manual_revocation_works_correctly (32 ms)
[ RUN ] TestTokenAuthority.manual_revocation_doesnt_revoke_other_tokens
[ OK ] TestTokenAuthority.manual_revocation_doesnt_revoke_other_tokens (312 ms)
[ RUN ] TestTokenAuthority.revoke_all_actually_revokes_all
[ OK ] TestTokenAuthority.revoke_all_actually_revokes_all (19 ms)
[ RUN ] TestTokenAuthority.bogus_token_is_actually_bogus
[ OK ] TestTokenAuthority.bogus_token_is_actually_bogus (7 ms)
[----------] 6 tests from TestTokenAuthority (3463 ms total)

[----------] Global test environment tear-down
[==========] 6 tests from 1 test suite ran. (3470 ms total)
[ PASSED ] 5 tests.
[ FAILED ] 1 test, listed below:
[ FAILED ] TestTokenAuthority.tokens_are_revoked_in_time

1 FAILED TEST
@Saviq
Copy link
Collaborator Author

Saviq commented Mar 7, 2025

FWIW to have a reliable test here, we'd need to not rely on actual time, but rather mock and control the time source.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant