on master help sign in
disable some intermittently failing tests

These are parallel/concurrent tests that fail due to unpredictable delays in scheduling.

commit83dc30a7fe9f9b3f04992c97d3e88885574187df authorHarendra Kumar <harendra.kumar@gmail.com> dateWed 12 Sep 2018, 11:53 (8 years ago) parentcca869f
1 file changed+16−13
test/Main.hs+16−13
test/Main.hs+16−13
@@ -40,8 +40,24 @@ main :: IO ()
4040main = hspec $ do
4141 parallelTests
4242
43+ describe "restricts concurrency and cleans up extra tasks" $ do
44+ it "take 1 asyncly" $ checkCleanup 2 asyncly (S.take 1)
45+ it "take 1 wAsyncly" $ checkCleanup 2 wAsyncly (S.take 1)
46+ it "take 1 aheadly" $ checkCleanup 2 aheadly (S.take 1)
47+
48+ it "takeWhile (< 0) asyncly" $ checkCleanup 2 asyncly (S.takeWhile (< 0))
49+ it "takeWhile (< 0) wAsyncly" $ checkCleanup 2 wAsyncly (S.takeWhile (< 0))
50+ it "takeWhile (< 0) aheadly" $ checkCleanup 2 aheadly (S.takeWhile (< 0))
51+
52+#ifdef DEVBUILD
53+ let timed :: (IsStream t, Monad (t IO)) => Int -> t IO Int
54+ timed x = S.yieldM (threadDelay (x * 100000)) >> return x
55+
4356 -- These are not run parallely because the timing gets affected
4457 -- unpredictably when other tests are running on the same machine.
58+ --
59+ -- Also, they fail intermittently due to scheduling delays, so not run on
60+ -- CI machines.
4561 describe "Nested parallel and serial compositions" $ do
4662 let t = timed
4763 p = wAsyncly
@@ -83,16 +99,6 @@ main = hspec $ do
8399 <> ((t 4 <> t 8) <> (t 0 <> t 2)))
84100 `shouldReturn` ([0,0,2,2,4,4,8,8])
85101
86− describe "restricts concurrency and cleans up extra tasks" $ do
87− it "take 1 asyncly" $ checkCleanup 2 asyncly (S.take 1)
88− it "take 1 wAsyncly" $ checkCleanup 2 wAsyncly (S.take 1)
89− it "take 1 aheadly" $ checkCleanup 2 aheadly (S.take 1)
90−
91− it "takeWhile (< 0) asyncly" $ checkCleanup 2 asyncly (S.takeWhile (< 0))
92− it "takeWhile (< 0) wAsyncly" $ checkCleanup 2 wAsyncly (S.takeWhile (< 0))
93− it "takeWhile (< 0) aheadly" $ checkCleanup 2 aheadly (S.takeWhile (< 0))
94−
95−#ifdef DEVBUILD
96102 -- parallely fails on CI machines, may need more difference in times of
97103 -- the events, but that would make tests even slower.
98104 it "take 1 parallely" $ checkCleanup 3 parallely (S.take 1)
@@ -789,9 +795,6 @@ nestTwoParallelApp =
789795 in ((S.toList . parallely) ((+) <$> s1 <*> s2) >>= return . sort)
790796 `shouldReturn` sort ([6,7,7,8,8,8,9,9,9,9,10,10,10,11,11,12] :: [Int])
791797
792−timed :: (IsStream t, Monad (t IO)) => Int -> t IO Int
793−timed x = S.yieldM (threadDelay (x * 100000)) >> return x
794−
795798interleaveCheck :: IsStream t
796799 => (t IO Int -> SerialT IO Int)
797800 -> (t IO Int -> t IO Int -> t IO Int)