From 9f145b636aaf2d250aa8906c6d1c7b5d5ac7d11a Mon Sep 17 00:00:00 2001 From: alice-px Date: Fri, 19 Jan 2024 13:35:17 -0800 Subject: [PATCH] fixing e2e tests Signed-off-by: alice-px --- api/server/sdk/node_test.go | 2 +- pkg/loadbalancer/roundrobin.go | 3 --- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/api/server/sdk/node_test.go b/api/server/sdk/node_test.go index 8fb537fbe..a1b3ab0ad 100644 --- a/api/server/sdk/node_test.go +++ b/api/server/sdk/node_test.go @@ -460,7 +460,7 @@ func TestSdkVolumeUsageByNode(t *testing.T) { s.MockCluster().EXPECT().Enumerate().Return(cluster, nil).Times(1) s.MockCluster().EXPECT().Inspect(nodeid).Return(node, nil).Times(2) - s.MockDriver().EXPECT().VolumeUsageByNode(context.TODO(), nodeid).Return(&volumeUsageInfo, nil).Times(1) + s.MockDriver().EXPECT().VolumeUsageByNode(context.Background(), nodeid).Return(&volumeUsageInfo, nil).Times(1) // Setup client c := api.NewOpenStorageNodeClient(s.Conn()) diff --git a/pkg/loadbalancer/roundrobin.go b/pkg/loadbalancer/roundrobin.go index 1baafa99c..eba62e256 100644 --- a/pkg/loadbalancer/roundrobin.go +++ b/pkg/loadbalancer/roundrobin.go @@ -149,9 +149,6 @@ func (rr *roundRobin) getTargetAndIncrement(filteredNodes []*api.Node, selfNodeI return "", false } targetNodeNumber = rr.nextCreateNodeNumber % len(filteredNodes) - if rr.nextCreateNodeNumber != 0 { - targetNodeNumber = rr.nextCreateNodeNumber - } targetNode := filteredNodes[targetNodeNumber] if targetNode.Id != selfNodeID { // NodeID set on the cluster object is this node's ID.