https://github.com/laurentrdc/tasty-flaky
Handle flaky Tasty-based tests
https://github.com/laurentrdc/tasty-flaky
flaky-tests haskell tasty-framework testing
Last synced: 5 months ago
JSON representation
Handle flaky Tasty-based tests
- Host: GitHub
- URL: https://github.com/laurentrdc/tasty-flaky
- Owner: LaurentRDC
- License: bsd-3-clause
- Created: 2024-09-24T18:19:37.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2026-01-01T17:46:51.000Z (6 months ago)
- Last Synced: 2026-01-06T18:50:49.974Z (6 months ago)
- Topics: flaky-tests, haskell, tasty-framework, testing
- Language: Haskell
- Homepage: https://hackage.haskell.org/package/tasty-flaky
- Size: 26.4 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# `tasty-flaky`
This provides [`tasty`](https://hackage.haskell.org/package/tasty) integration for flaky tests, which are tests that are known to fail intermittently. [`tasty-flaky`](https://hackage.haskell.org/package/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`](https://hackage.haskell.org/package/tasty-hunit) like so:
```haskell
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.