| Safe Haskell | None |
|---|---|
| Language | GHC2024 |
Arbiter.Test.Concurrency
Description
Concurrency tests for any MonadArbiter backend.
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
- drainAll :: IO [a] -> (a -> IO ()) -> IO ()
- findDuplicates :: Ord a => [a] -> [a]
- installHolDetector :: Connection -> Text -> Text -> IO ()
- holViolations :: Connection -> Text -> Text -> IO [String]
- removeHolDetector :: Connection -> Text -> Text -> IO ()
Documentation
concurrencySpec :: (JobPayload payload, KnownSymbol (TableForPayload payload (RegistryOf m)), MonadArbiter m) => (Text -> payload) -> (forall a. env -> m a -> IO a) -> SpecWith envSource #
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.
Build the schema with setupOnce and empty it before each test with cleanupData.
raceConditionSpec :: (JobPayload payload, KnownSymbol (TableForPayload payload (RegistryOf m)), MonadArbiter m) => (Text -> payload) -> (forall a. env -> m a -> IO a) -> SpecWith envSource #
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 |
High-contention tests for concurrency defects. Many workers, large job
counts, and tight timing windows.
Build the schema with setupOnce and empty it before each test with cleanupData.
findDuplicates :: Ord a => [a] -> [a]Source #
Find duplicate entries in a list. O(n log n).
installHolDetector :: Connection -> Text -> Text -> IO ()Source #
Install the gap-free HOL violation detector on a raw connection.
holViolations :: Connection -> Text -> Text -> IO [String]Source #
One message per violation the HOL detector trigger recorded.
removeHolDetector :: Connection -> Text -> Text -> IO ()Source #
Remove the HOL detector trigger, function, and violations table.