Utku Ozdemir becf6bd67c
test: fix flaky etcd backup tests
Rework the etcd backup tests and the runtime testutils to:
- Not run SecretsController, instead, create a static secret bundle. When the backup tests are run in parallel, in rare cases, SecretsController does not create the bundle (probably because it is an expensive operation), causing the `BackupData` resource to not be created, failing the tests.
- Inject the KubernetesRuntime into the cluster cleanup controller so that it won't be a global shared across tests.
- Refactor the testutils to make it more extensible.
- Remove the go mock generation in etcd backup tests. Instead, create hand-crafted mocks. The `Times()` assertion on the go-mock library caused the tests to hang and eventually time out when there was an unexpected extra call, since the extra call was done by a controller runtime goroutine, and not by the test goroutine.

Signed-off-by: Utku Ozdemir <utku.ozdemir@siderolabs.com>
(cherry picked from commit 03460a9e76ce7cf99061770b56449d70d8e0a4e2)
2025-11-14 14:16:37 +03:00
..
2025-11-14 14:16:37 +03:00