Skip to content
This repository has been archived by the owner on Apr 19, 2024. It is now read-only.

Commit

Permalink
Allow test to pass when run with -count n; n > 1.
Browse files Browse the repository at this point in the history
  • Loading branch information
Baliedge committed Feb 22, 2024
1 parent 310708b commit 13c3547
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion functional_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
"context"
"fmt"
"io"
"math/rand"
"net/http"
"os"
"strings"
Expand Down Expand Up @@ -1025,6 +1026,7 @@ func TestGlobalRateLimitsWithLoadBalancing(t *testing.T) {
owner := cluster.PeerAt(2).GRPCAddress
peer := cluster.PeerAt(0).GRPCAddress
assert.NotEqual(t, owner, peer)
key := fmt.Sprintf("key:%04x", rand.Intn(1<<16))

dialOpts := []grpc.DialOption{
grpc.WithResolvers(newStaticBuilder()),
Expand All @@ -1045,7 +1047,7 @@ func TestGlobalRateLimitsWithLoadBalancing(t *testing.T) {
Requests: []*guber.RateLimitReq{
{
Name: "test_global",
UniqueKey: "account:12345",
UniqueKey: key,
Algorithm: guber.Algorithm_LEAKY_BUCKET,
Behavior: guber.Behavior_GLOBAL,
Duration: guber.Minute * 5,
Expand Down

0 comments on commit 13c3547

Please sign in to comment.