Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
neekolas committed Mar 21, 2024
1 parent 5a4d878 commit 00e38a4
Showing 1 changed file with 2 additions and 16 deletions.
18 changes: 2 additions & 16 deletions pkg/api/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -780,14 +780,7 @@ func Test_Ratelimits_Regular(t *testing.T) {
require.NoError(t, err)
_, err = client.Publish(ctx, &messageV1.PublishRequest{Envelopes: envs[1:2]})
require.Error(t, err)
errMsg := "1 exceeds rate limit R"
if _, ok := status.FromError(err); ok {
// GRPC
errMsg += "ip_unknownPUB"
} else {
// HTTP
errMsg += "127.0.0.1PUB"
}
errMsg := "1 exceeds rate limit R127.0.0.1PUB"
requireErrorEqual(t, err, codes.ResourceExhausted, errMsg)
// check that Query is not affected by publish quota
_, err = client.Query(ctx, &messageV1.QueryRequest{ContentTopics: []string{"topic"}})
Expand Down Expand Up @@ -815,14 +808,7 @@ func Test_Ratelimits_Priority(t *testing.T) {
require.NoError(t, err)
_, err = client.Publish(ctx, &messageV1.PublishRequest{Envelopes: envs[2:3]})
require.Error(t, err)
errMsg := "1 exceeds rate limit P"
if _, ok := status.FromError(err); ok {
// GRPC
errMsg += "ip_unknownPUB"
} else {
// HTTP
errMsg += "127.0.0.1PUB"
}
errMsg := "1 exceeds rate limit P127.0.0.1PUB"
requireErrorEqual(t, err, codes.ResourceExhausted, errMsg)
// check that query is not affected by publish quota
_, err = client.Query(ctx, &messageV1.QueryRequest{ContentTopics: []string{"topic"}})
Expand Down

0 comments on commit 00e38a4

Please sign in to comment.