Skip to content

Conversation

@amartinezfayo
Copy link
Member

@amartinezfayo amartinezfayo commented Jan 20, 2026

The TestTLSConfig test in the diskcertmanager package failed again in CI: https://github.com/spiffe/spire/actions/runs/21166557075/job/60872657392#step:5:413

Multiple previous attempts to fix this test revealed that its design (using a complex pattern of shared goroutine state, mock clocks, and log assertions) is inherently difficult to make reliably deterministic. Last attempt was #6570.

This PR completely refactors the diskcertmanager test suite. The refactored tests separate concerns by introducing three distinct test functions: TestNew for initialization scenarios, TestSyncCertificateFiles for unit testing the sync logic directly without goroutines, and TestWatchFileChanges for integration testing of the ticker behavior.

I looked at the test coverage to make sure that the refactor keeps the same coverage as before (94.6%)

@amartinezfayo amartinezfayo force-pushed the refactor-diskcertmanager-tests branch from a7c5caf to c0b22f3 Compare January 20, 2026 13:22
@amartinezfayo amartinezfayo changed the title Refactor DiskCertManager tests for determinism and maintainability Refactor diskcertmanager tests for determinism and maintainability Jan 20, 2026
@sorindumitru sorindumitru added this pull request to the merge queue Jan 21, 2026
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jan 21, 2026
@amartinezfayo amartinezfayo added this to the 1.14.2 milestone Jan 21, 2026
@amartinezfayo amartinezfayo added this pull request to the merge queue Jan 21, 2026
Merged via the queue into spiffe:main with commit b6ea314 Jan 21, 2026
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.

2 participants