HORIZON HASKELLDocslts/ghc-10.0.x8fef28d2026-11-02Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 8fef28d · 2026-11-02

  • Packagesydtest-0.33.0.0
  • Exports32
  • LanguageHaskell2010
  • LicenceLicenseRef-OtherLicense
  • SourceModify.hs

Declaring different test settings

datadata TestRunSettings
#
Instances4Eq, Show, Generic, Rep

Declaring parallelism

valueparallelWith :: Word -> TestDefM a b c -> TestDefM a b c

Declare that at most this many of the tests below may run at once.

The bound is across everything below this point together, not per group, and it does not add threads: it only ever holds tests back. Reach for it when tests contend for something the suite does not own, such as one database server shared by a database per test, where running all of them at once is slower than running some of them and sequential gives up more than it needs to.

datadata Parallelism
#

Constructors

  • Parallel

    As many at once as there are threads to run them.

  • ParallelWith !Word

    At most this many at once, however many threads there are.

    For tests that contend for something the test suite does not own, like one database server behind a database per test. Running fewer of those at once can be faster than running all of them, and is the smaller instrument where Sequential would do.

  • Sequential

    One at a time.

Instances4Eq, Show, Generic, Rep

Declaring randomisation order

Instances4Eq, Show, Generic, Rep

Modifying timeouts

Modifying the number of retries

Declaring flakiness

valueflaky :: Word -> TestDefM a b c -> TestDefM a b c

Mark a test suite as "potentially flaky" with a given number of retries.

This will retry any test in the given test group up to the given number of tries, and pass a test if it passes once. The test output will show which tests were flaky.

WARNING: This is only a valid approach to dealing with test flakiness if it is true that tests never pass accidentally. In other words: tests using flaky must be guaranteed to fail every time if an error is introduced in the code, it should only be added to deal with accidental failures, never accidental passes.

valueflakyWith :: Word -> String -> TestDefM a b c -> TestDefM a b c

Like flaky, but also shows the given message to the user whenever the test is flaky.

You could use it like this:

Example1 expression
flakyWith 3 "Something sometimes goes wrong with the database, see issue 6346" ourTestSuite
valuenotFlaky :: TestDefM a b c -> TestDefM a b c

Mark a test suite as "must not be flaky".

This is useful to have a subgroup of a group marked as flaky that must not be flaky afteral.

datadata FlakinessMode
#
Instances4Eq, Show, Generic, Rep

Declaring expectations

datadata ExpectationMode
#
Instances4Eq, Show, Generic, Rep