Skip to content

Commit 0ce5793

Browse files
committed
Add balancerStop cmd for e2e-tests
1 parent 773b8a7 commit 0ce5793

File tree

1 file changed

+19
-0
lines changed
  • e2e-tests/pkg/tests/sharded

1 file changed

+19
-0
lines changed

e2e-tests/pkg/tests/sharded/cmd.go

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package sharded
2+
3+
import (
4+
"context"
5+
"log"
6+
7+
"go.mongodb.org/mongo-driver/bson"
8+
"go.mongodb.org/mongo-driver/mongo"
9+
)
10+
11+
func (c *Cluster) stopBalancer(ctx context.Context, conn *mongo.Client) {
12+
err := conn.Database("admin").RunCommand(
13+
ctx,
14+
bson.D{{"balancerStop", 1}},
15+
).Err()
16+
if err != nil {
17+
log.Fatalf("ERROR: stopping balancer: %v", err)
18+
}
19+
}

0 commit comments

Comments
 (0)