Skip to content

Commit

Permalink
minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
sanjain-px committed Sep 17, 2024
1 parent 76e9520 commit 4d7971b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions cluster/manager/manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,15 +143,16 @@ func TestRemoveOnlineNode(t *testing.T) {
err = kvdb.SetInstance(kv)
assert.NoError(t, err)

// when force flag is false, node status check should take precedence
// when force flag is false, node status check should take precedence
err = testManager.Remove([]api.Node{nodeToRemove}, false)
assert.ErrorContains(t, err, fmt.Sprintf(decommissionErrMsg, testNodeID))
assert.Error(t, err)
assert.EqualError(t, err, fmt.Sprintf(decommissionErrMsg, testNodeID))

// when force flag is true, we shouldn't abort due to node status
mockListener.EXPECT().String().Return(testNodeID)
mockListener.EXPECT().MarkNodeDown(gomock.Any()).Return(mockErr)

err = testManager.Remove([]api.Node{nodeToRemove}, true)
assert.ErrorIs(t, err, mockErr)
assert.EqualError(t, err, mockErr.Error())

}

0 comments on commit 4d7971b

Please sign in to comment.