Skip to content

Comments

Testing: one MockAdminAPI per cluster#561

Merged
jan-g merged 1 commit intomainfrom
v1-unit-test-race-condition
Mar 24, 2025
Merged

Testing: one MockAdminAPI per cluster#561
jan-g merged 1 commit intomainfrom
v1-unit-test-race-condition

Conversation

@jan-g
Copy link
Contributor

@jan-g jan-g commented Mar 24, 2025

Given the desire to merge the drift controller with the general cluster reconciler, we need to track the mock admin api state on a per-cluster basis - otherwise the rapid reassertion of state will cause flapping as the mock API is poked on behalf of multiple clusters.

Copy link
Contributor

@chrisseto chrisseto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Given the desire to merge the drift controller with the general
cluster reconciler, we need to track the mock admin api state
on a per-cluster basis - otherwise the rapid reassertion of state
will cause flapping as the mock API is poked on behalf of multiple
clusters.
@jan-g jan-g force-pushed the v1-unit-test-race-condition branch from 50399f8 to 6d718c2 Compare March 24, 2025 15:56
@jan-g
Copy link
Contributor Author

jan-g commented Mar 24, 2025

There was one glitch to fix - the zero value of the MockAdminAPI struct isn't quite usable without calling .Clear() on it, which marks the cluster as defaulting to healthy. I think the failures I was seeing on my "drop drift controller" branch are entirely down to that.

@jan-g
Copy link
Contributor Author

jan-g commented Mar 24, 2025

What I don't fully understand is how/why we haven't seen more of these race conditions already - even with a separate drift controller, state should still be being reasserted. I think we were just really lucky, and a left-behind value from test A was viewed as an ad-hoc setting for test B, so didn't cause a reassertion of state (!)

@jan-g jan-g merged commit 3443050 into main Mar 24, 2025
12 checks passed
@jan-g jan-g deleted the v1-unit-test-race-condition branch March 24, 2025 17:11
alenkacz pushed a commit that referenced this pull request Apr 7, 2025
Given the desire to merge the drift controller with the general
cluster reconciler, we need to track the mock admin api state
on a per-cluster basis - otherwise the rapid reassertion of state
will cause flapping as the mock API is poked on behalf of multiple
clusters.
RafalKorepta pushed a commit that referenced this pull request Apr 7, 2025
Given the desire to merge the drift controller with the general
cluster reconciler, we need to track the mock admin api state
on a per-cluster basis - otherwise the rapid reassertion of state
will cause flapping as the mock API is poked on behalf of multiple
clusters.
alenkacz added a commit that referenced this pull request Apr 8, 2025
* Testing: one MockAdminAPI per cluster (#561)

Given the desire to merge the drift controller with the general
cluster reconciler, we need to track the mock admin api state
on a per-cluster basis - otherwise the rapid reassertion of state
will cause flapping as the mock API is poked on behalf of multiple
clusters.

* V1 drop drift controller (#543)

* Periodically cycle to reassert cluster configuration
* Drop drift controller
* Fix up unit test failures
* Drop three-way merge code
* Drop annotation copy in secret

---------

Co-authored-by: jan grant <3430517+jan-g@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants