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:
2 files changed
+3
-3
No files matched your search
@@ -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
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in new issue
Block a user