| Safe Haskell | None |
|---|---|
| Language | GHC2024 |
Arbiter.Test.Concurrency
Description
Parameterized concurrency test suite that works with any MonadArbiter implementation.
Synopsis
- concurrencySpec :: (JobPayload payload, KnownSymbol (TableForPayload payload (RegistryOf m)), MonadArbiter m) => (Text -> payload) -> (forall a. env -> m a -> IO a) -> SpecWith env
- raceConditionSpec :: (JobPayload payload, KnownSymbol (TableForPayload payload (RegistryOf m)), MonadArbiter m) => (Text -> payload) -> (forall a. env -> m a -> IO a) -> SpecWith env
- installHolDetector :: Connection -> Text -> Text -> IO ()
- countHolViolations :: Connection -> Text -> Text -> IO Int64
- removeHolDetector :: Connection -> Text -> Text -> IO ()
Documentation
Source #concurrencySpec :: (JobPayload payload, KnownSymbol (TableForPayload payload (RegistryOf m)), MonadArbiter m) => (Text -> payload) -> (forall a. env -> m a -> IO a) -> SpecWith env
Arguments
| :: (JobPayload payload, KnownSymbol (TableForPayload payload (RegistryOf m)), MonadArbiter m) | |
| => (Text -> payload) | Constructor for a simple test message payload |
| -> (forall a. env -> m a -> IO a) | Runner for monad actions |
| -> SpecWith env |
Parameterized concurrency test suite. These tests need a connection pool of at least 10 connections.
Source #raceConditionSpec :: (JobPayload payload, KnownSymbol (TableForPayload payload (RegistryOf m)), MonadArbiter m) => (Text -> payload) -> (forall a. env -> m a -> IO a) -> SpecWith env
High-contention tests for concurrency defects. Many workers, large job counts, and tight timing windows.
Source #installHolDetector :: Connection -> Text -> Text -> IO ()
Install the gap-free HOL violation detector on a raw connection.
Source #countHolViolations :: Connection -> Text -> Text -> IO Int64
Count violations detected by the HOL detector trigger.
Source #removeHolDetector :: Connection -> Text -> Text -> IO ()
Remove the HOL detector trigger, function, and violations table.