arbiter-test-common-0.1.0.0
arbiter-test-common
Safe HaskellNone
LanguageGHC2024

Arbiter.Test.Concurrency

Description

Parameterized concurrency test suite that works with any MonadArbiter implementation.

Synopsis

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.