Repository navigation
test(integration): use a NodeDoctor-prefixed custom condition in the exporter fixture - #61
Merged
Merged
Conversation
…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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
createTestExporterConfigdeclares a custom conditionTestCustomCondition. Since #58 the exporter refuses to write conditions without theNodeDoctorprefix. 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: ifGetConditionsran 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:
flushPendingUpdatesstill copies refused (unprefixed) pending updates intocm.conditionson success. That is harmless now, but it is how the cache and the node diverge.Refs: cluster-services-874