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

Fix for TestRotator flaky test #5643

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

amartinezfayo
Copy link
Member

@amartinezfayo amartinezfayo commented Nov 8, 2024

There is a race condition in the TestRotator test that can make it to fail:
https://github.com/spiffe/spire/actions/runs/11742647891/job/32713865973?pr=5642

--- FAIL: TestRotator (60.10s)
    --- FAIL: TestRotator/reattest_expires_after_startup (60.02s)
        rotator_test.go:211: timed out waiting for rotation check to finish
FAIL
FAIL	github.com/spiffe/spire/pkg/agent/svid	60.267s

For the "reattest expires after startup" test case, we advance the clock two minutes. But since the rotator is launched in a separated go routine, that may happen before the rotator is running.
Added a hook to make sure that we advance the clock after the rotator is running.

Signed-off-by: Agustín Martínez Fayó <[email protected]>
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 this pull request may close these issues.

1 participant