Skip to content

Implement testing for Token Bucket algorithm #4

@shalarewicz

Description

@shalarewicz

Use a TDD approach to verify correctness of the Token Bucket algorithm used for rate limiting incoming GraphQL requests.

Testing should not be concerned with computing an incoming requests complexity. Each request should be considered to consume 1 token.

Testing should verify the following;

  1. Requests are limited as expected based on user IP address.
  2. CAPACITY and REFILL_RATE are accepted input parameters.
  3. Size of the token bucket never exceeds the set CAPACITY
  4. Token bucket is refilled at the provided REFILL_RATE

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions