Skip to content

Conversation

@amartinezfayo
Copy link
Member

Fix for TestTLSConfig/success_watching_cert_file_changes flaky test where the test would occasionally fail with "Condition never satisfied" errors when checking for certificate updates.

The test had a race condition where it would advance the mock clock and immediately check for certificate updates, but the watcher goroutine's ticker might not have been fully initialized yet. This caused intermittent failures when the test ran before the ticker was ready.

Added clk.WaitForTicker() synchronization after starting the file watcher goroutine. This ensures the ticker is fully initialized before any test cases execute, eliminating the race condition.

Signed-off-by: Agustín Martínez Fayó <[email protected]>
@sorindumitru sorindumitru merged commit 9903bf7 into spiffe:main Dec 27, 2025
49 checks passed
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.

Flaky test: TestTLSConfig/success_watching_cert_file_changes

2 participants