Merge pull request #17551 from rook/mergify/bp/release-1.19/pr-17545

osd: fix flaky TestAddRemoveNode failure (backport #17545)
This commit is contained in:
mergify[bot] authored and GitHub committed 2026-05-15 20:10:51 +00:00
commit a436e008d9
2 files changed
+3 -3

No files matched your search

+2 -2
View File
@@ -201,7 +201,7 @@ func TestAddRemoveNode(t *testing.T) {
cmErr := createDiscoverConfigmap(nodeName, "rook-system", clientset)
assert.Nil(t, cmErr)
statusMapWatcher := watch.NewFake()
statusMapWatcher := watch.NewRaceFreeFake()
clientset.PrependWatchReactor("configmaps", k8stesting.DefaultWatchReactor(statusMapWatcher, nil))
clusterInfo := &cephclient.ClusterInfo{
@@ -361,7 +361,7 @@ func TestAddRemoveNode(t *testing.T) {
c = New(context, clusterInfo, cephCluster.Spec, "myversion")
// reset the orchestration status watcher
statusMapWatcher = watch.NewFake()
statusMapWatcher = watch.NewRaceFreeFake()
clientset.PrependWatchReactor("configmaps", k8stesting.DefaultWatchReactor(statusMapWatcher, nil))
startErr = nil
+1 -1
View File
@@ -67,7 +67,7 @@ func TestOrchestrationStatus(t *testing.T) {
assert.Equal(t, status, *retrievedStatus)
}
func mockNodeOrchestrationCompletion(c *Cluster, nodeName string, statusMapWatcher *watch.FakeWatcher) {
func mockNodeOrchestrationCompletion(c *Cluster, nodeName string, statusMapWatcher *watch.RaceFreeFakeWatcher) {
ctx := context.TODO()
// if no valid osd node, don't need to check its status, return immediately
if len(c.spec.Storage.Nodes) == 0 {