HORIZON HASKELLDocslts/ghc-9.14.xd82dee82026-10-12Search names, modules, packages, or :: a typeCtrl K

GHC 9.14.1 · lts/ghc-9.14.x · d82dee8 · 2026-10-12

Modulehedgehog-extras-0.10.1.0Haskell2010

Hedgehog.Extras.Test.TestWatchdog

This module provides a test watchdog - an utility monitoring test cases and killing them if they don't finish in time. Watchdog thread runs in the background, and after specified timeout, it throws WatchdogException to the target thread. A user is able to kickWatchdog, which delays the killing and poisonWatchdog which stops the watchdog.

To wrap a test case in a watchdog just use

runWithWatchdog watchdogConfig $ \watchdog -> do
  -- body of your test case
  • 3 types
  • 8 values

Wrap in watchdog

4 declarations

Watchdog control

2 declarations
valuekickWatchdog :: MonadIO m => Watchdog -> m ()
#

Enqueue a kick for the watchdog. It will extend the timeout by another one defined in the watchdog configuration.

Types

3 declarations
datadata Watchdog
#

A watchdog instance. See the module header for more detailed description.

Instances1Show
  • Show WatchdogDefined in hedgehog-extras-0.10.1.0 · Hedgehog.Extras.Test.TestWatchdog

Low level API

2 declarations

There is also a lower-level API available, giving the ability to provide target thread ID, which watchdog will try to kill.