About

Metadata

  • Last updated , by LaurentRDC
  • License BSD-3-Clause
  • Categories Testing
  • Maintained by: Laurent René de Cotret

  • Lottery factor: 1

Links

Installation

Tested Compilers

  1. 9.12.2
  2. 9.10.3
  3. 9.8.4
  4. 9.6.7
  5. 9.4.8
  6. 9.2.8
  7. 9.0.2
  8. 8.10.7

Readme

tasty-flaky

This provides tasty integration for flaky tests, which are tests that are known to fail intermittently. tasty-flaky can be installed from Hackage.

Example usage

This package provides functions, like flakyTest, which can attach retrying logic to any test. For example, you can retry test cases from tasty-hunit like so:

import Test.Tasty.HUnit ( testCase ) -- from tasty-hunit

myFlakyTest :: TestTree
myFlakyTest 
    = flakyTest (limitRetries 5 <> constantDelay 1000) 
    $ testCase "some test case" 
    $ do ... 

In the example above, the test will be retried up to 5 times, with a delay of 1000 microseconds between tries, if a failure occurs.