|
8 | 8 | -- NOTICE: Some of these tests are /unsafe/, and will fail intermittently, since |
9 | 9 | -- they rely on ordering constraints which the Cloud Haskell runtime does not |
10 | 10 | -- guarantee. |
| 11 | +-- |
| 12 | +-- Such tests can be marked as 'flaky' using 'tasty-flaky', so they get |
| 13 | +-- retried on failure. |
11 | 14 |
|
12 | 15 | module Main where |
13 | 16 |
|
@@ -52,13 +55,17 @@ import Data.ByteString.Lazy (empty) |
52 | 55 | import Data.Maybe (catMaybes, isNothing, isJust) |
53 | 56 |
|
54 | 57 | import Test.Tasty (TestTree, testGroup) |
| 58 | +import Test.Tasty.Flaky (flakyTest, limitRetries) |
55 | 59 | import Test.Tasty.HUnit (Assertion, assertFailure, assertEqual, assertBool, testCase) |
56 | 60 | import TestUtils hiding (waitForExit) |
57 | 61 | import qualified Network.Transport as NT |
58 | 62 |
|
59 | 63 | import System.Random (mkStdGen, randomR) |
60 | 64 | -- test utilities |
61 | 65 |
|
| 66 | +flaky :: TestTree -> TestTree |
| 67 | +flaky = flakyTest (limitRetries 3) |
| 68 | + |
62 | 69 | expectedExitReason :: ProcessId -> String |
63 | 70 | expectedExitReason sup = "killed-by=" ++ (show sup) ++ |
64 | 71 | ",reason=StoppedBySupervisor" |
@@ -1304,10 +1311,11 @@ tests transport = do |
1304 | 1311 | (withSupervisor restartOne [] |
1305 | 1312 | (withClosure transientChildrenAbnormalExit |
1306 | 1313 | $(mkStaticClosure 'blockIndefinitely))) |
1307 | | - , testCase "ExitShutdown Is Considered Normal" |
1308 | | - (withSupervisor' restartOne [] |
1309 | | - (withClosure' transientChildrenExitShutdown |
1310 | | - $(mkStaticClosure 'blockIndefinitely))) |
| 1314 | + , flaky $ |
| 1315 | + testCase "ExitShutdown Is Considered Normal" |
| 1316 | + (withSupervisor' restartOne [] |
| 1317 | + (withClosure' transientChildrenExitShutdown |
| 1318 | + $(mkStaticClosure 'blockIndefinitely))) |
1311 | 1319 | , testCase "Intrinsic Children Do Restart When Exiting Abnormally (Closure)" |
1312 | 1320 | (withSupervisor restartOne [] |
1313 | 1321 | (withClosure intrinsicChildrenAbnormalExit |
|
0 commit comments