Skip to content

test(integration): use a NodeDoctor-prefixed custom condition in the exporter fixture - #61

Merged
mattmattox merged 1 commit into
mainfrom
fix/resync-test-prefixed-condition
Oct 14, 2026
Merged

mattmattox merged 1 commit into
mainfrom
fix/resync-test-prefixed-condition

Conversation

@mattmattox

Copy link
Copy Markdown
Contributor

Fixes the flaky TestConditionManager_Resync (test/integration/kubernetes). It failed the v1.10.0-rc.4 tag CI run once ("conditions should be preserved after resync").

Cause. The shared fixture createTestExporterConfig declares a custom condition TestCustomCondition. Since #58 the exporter refuses to write conditions without the NodeDoctor prefix. A flush still copies the refused condition into the local cache, but it never reaches the node. So a resync drops it, and the result depends on timing: if GetConditions ran after the 100ms flush, the count went 3 -> 2 and the assertion failed.

Fix. Rename it to NodeDoctorTestCustomCondition. The condition is now really written, so the resync keeps it and the result does not depend on timing. This is a test-only change.

Evidence. go test -race -count=40 -run 'TestConditionManager_Resync$' ./test/integration/kubernetes/: 13/40 failed before, 0/40 after. go test -race ./test/integration/... passes.

Side note, not changed here: flushPendingUpdates still copies refused (unprefixed) pending updates into cm.conditions on success. That is harmless now, but it is how the cache and the node diverge.

Refs: cluster-services-874

…exporter fixture

TestConditionManager_Resync was flaky since #58: the fixture's custom
condition "TestCustomCondition" is unprefixed, so the exporter now refuses
to write it to the node, but a flush still copies it into the local cache.
Whether GetConditions ran before or after that flush decided whether the
resync count dropped (3 -> 2) and failed the test. With a NodeDoctor*
name the condition is really written, so resync keeps it.

Before: 13/40 failures (go test -race -count=40 -run TestConditionManager_Resync).
After:  0/40.
@mattmattox
mattmattox merged commit f895d0d into main Oct 14, 2026
11 checks passed
@mattmattox
mattmattox deleted the fix/resync-test-prefixed-condition branch October 14, 2026 22:15
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