| Safe Haskell | None |
|---|---|
| Language | GHC2024 |
Arbiter.Test.RateLimit
Description
Backend-parameterized integration tests for per-job rate limiting. Each
backend supplies a runner over the shared RLReg registry.
Synopsis
- data RLPayload = RLPayload {}
- type RLReg = '[Queue "arbiter_ratelimit_test" RLPayload]
- rateLimitTable :: Text
- setupRateLimitPolicy :: ByteString -> Text -> IO ()
- rateLimitSpec :: forall env m. HasRegistry m RLReg => (forall a. env -> m a -> IO a) -> SpecWith env
Documentation
A payload keyed by tenant, with a per-job token cost.
Constructors
| RLPayload | |
Instances
type RLReg = '[Queue "arbiter_ratelimit_test" RLPayload]Source #
A one-queue registry over RLPayload.
rateLimitTable :: TextSource #
Table name for RLReg, shared across backends.
setupRateLimitPolicy :: ByteString -> Text -> IO ()Source #
Upsert the registry's reflected policy rows into a schema.
rateLimitSpec :: forall env m. HasRegistry m RLReg => (forall a. env -> m a -> IO a) -> SpecWith envSource #
The rate-limit suite, run against any backend.
Build the schema with setupOnce and empty it before each test with cleanupData.
Seed the policies once with setupRateLimitPolicy. cleanupData keeps them.