Skip to content

Commit

Permalink
slightly change test to stop race
Browse files Browse the repository at this point in the history
  • Loading branch information
joshblakeley authored and buger committed Aug 9, 2018
1 parent 000bfe4 commit 5d4143c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions gateway_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1251,13 +1251,13 @@ func TestRateLimitForAPIAndRateLimitAndQuotaCheck(t *testing.T) {
spec.OrgID = "default"
spec.GlobalRateLimit = apidef.GlobalRateLimit{
Per: 60,
Rate: 2,
Rate: 4,
}
spec.Proxy.ListenPath = "/"
})

sess1token := createSession(func(s *user.SessionState) {
s.Rate = 1
s.Rate = 3
s.Per = 60
})

Expand All @@ -1267,6 +1267,8 @@ func TestRateLimitForAPIAndRateLimitAndQuotaCheck(t *testing.T) {
})

ts.Run(t, []test.TestCase{
{Headers: map[string]string{"Authorization": sess1token}, Code: http.StatusOK, Path: "/"},
{Headers: map[string]string{"Authorization": sess1token}, Code: http.StatusOK, Path: "/"},
{Headers: map[string]string{"Authorization": sess1token}, Code: http.StatusOK, Path: "/"},
{Headers: map[string]string{"Authorization": sess1token}, Code: http.StatusTooManyRequests, Path: "/"},
{Headers: map[string]string{"Authorization": sess2token}, Code: http.StatusOK, Path: "/"},
Expand Down

0 comments on commit 5d4143c

Please sign in to comment.