HORIZON HASKELLDocslts/ghc-9.14.x99ffbb82026-10-19Search packagesCtrl K
Theme: |

GHC 9.14.1 · lts/ghc-9.14.x · 99ffbb8 · 2026-10-19

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
Contents
  1. Wrap in watchdog
  2. Watchdog control
  3. Types
  4. Low level API
Synopsis

Wrap in watchdog

Watchdog control

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

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

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