on master help sign in
Hide tests failing on CI behind DEVBUILD flag.
6da528bpranaysashank
test/Streamly/Test/Prelude/Async.hs+2
@@ -92,8 +92,10 @@ main = hspec
92 -- for Monoid that is using the right version of semigroup. Instance
92 -- for Monoid that is using the right version of semigroup. Instance
93 -- deriving can cause us to pick wrong instances sometimes.
93 -- deriving can cause us to pick wrong instances sometimes.
94
94
95+#ifdef DEVBUILD
95 describe "Async (<>) time order check" $ parallelCheck asyncly (<>)
96 describe "Async (<>) time order check" $ parallelCheck asyncly (<>)
96 describe "Async mappend time order check" $ parallelCheck asyncly mappend
97 describe "Async mappend time order check" $ parallelCheck asyncly mappend
98+#endif
97
99
98 describe "Composed MonadThrow asyncly" $ composeWithMonadThrow asyncly
100 describe "Composed MonadThrow asyncly" $ composeWithMonadThrow asyncly
99
101
test/Streamly/Test/Prelude/Concurrent.hs+5−3
@@ -19,7 +19,7 @@ import Control.Monad (void, when, forM_, replicateM_)
19import Control.Monad.IO.Class (MonadIO(liftIO))
19import Control.Monad.IO.Class (MonadIO(liftIO))
20import Control.Monad.State (MonadState, get, modify, runStateT
20import Control.Monad.State (MonadState, get, modify, runStateT
21 , StateT(..), evalStateT)
21 , StateT(..), evalStateT)
22−import Data.Foldable (fold)
22+import Data.Foldable (fold)
23import Data.IORef (readIORef, modifyIORef, newIORef)
23import Data.IORef (readIORef, modifyIORef, newIORef)
24#if !(MIN_VERSION_base(4,11,0))
24#if !(MIN_VERSION_base(4,11,0))
25import Data.Semigroup (Semigroup, (<>))
25import Data.Semigroup (Semigroup, (<>))
@@ -410,7 +410,7 @@ main = hspec
410 concurrentFoldrApplication
410 concurrentFoldrApplication
411 prop "concurrent foldl application" $ withMaxSuccess maxTestCount
411 prop "concurrent foldl application" $ withMaxSuccess maxTestCount
412 concurrentFoldlApplication
412 concurrentFoldlApplication
413−
413+
414 describe "take on infinite concurrent stream" $ takeInfinite asyncly
414 describe "take on infinite concurrent stream" $ takeInfinite asyncly
415 describe "take on infinite concurrent stream" $ takeInfinite wAsyncly
415 describe "take on infinite concurrent stream" $ takeInfinite wAsyncly
416 describe "take on infinite concurrent stream" $ takeInfinite aheadly
416 describe "take on infinite concurrent stream" $ takeInfinite aheadly
@@ -418,7 +418,7 @@ main = hspec
418 ---------------------------------------------------------------------------
418 ---------------------------------------------------------------------------
419 -- Monadic state transfer in concurrent tasks
419 -- Monadic state transfer in concurrent tasks
420 ---------------------------------------------------------------------------
420 ---------------------------------------------------------------------------
421−
421+
422 describe "Monadic state transfer in concurrent tasks" $ do
422 describe "Monadic state transfer in concurrent tasks" $ do
423 -- XXX Can we write better test cases to hit every case?
423 -- XXX Can we write better test cases to hit every case?
424 it "async: state is saved and used if the work is partially enqueued"
424 it "async: state is saved and used if the work is partially enqueued"
@@ -478,6 +478,7 @@ main = hspec
478 replicate 4000 $ S.yieldM $ threadDelay 1000000)
478 replicate 4000 $ S.yieldM $ threadDelay 1000000)
479 `shouldReturn` ()
479 `shouldReturn` ()
480
480
481+#ifdef DEVBUILD
481 describe "restricts concurrency and cleans up extra tasks" $ do
482 describe "restricts concurrency and cleans up extra tasks" $ do
482 it "take 1 asyncly" $ checkCleanup 2 asyncly (S.take 1)
483 it "take 1 asyncly" $ checkCleanup 2 asyncly (S.take 1)
483 it "take 1 wAsyncly" $ checkCleanup 2 wAsyncly (S.take 1)
484 it "take 1 wAsyncly" $ checkCleanup 2 wAsyncly (S.take 1)
@@ -486,3 +487,4 @@ main = hspec
486 it "takeWhile (< 0) asyncly" $ checkCleanup 2 asyncly (S.takeWhile (< 0))
487 it "takeWhile (< 0) asyncly" $ checkCleanup 2 asyncly (S.takeWhile (< 0))
487 it "takeWhile (< 0) wAsyncly" $ checkCleanup 2 wAsyncly (S.takeWhile (< 0))
488 it "takeWhile (< 0) wAsyncly" $ checkCleanup 2 wAsyncly (S.takeWhile (< 0))
488 it "takeWhile (< 0) aheadly" $ checkCleanup 2 aheadly (S.takeWhile (< 0))
489 it "takeWhile (< 0) aheadly" $ checkCleanup 2 aheadly (S.takeWhile (< 0))
490+#endif
test/Streamly/Test/Prelude/Parallel.hs+4−2
@@ -91,13 +91,15 @@ main = hspec
91 parallelOps $ eliminationOps folded "parallely folded"
91 parallelOps $ eliminationOps folded "parallely folded"
92 parallelOps $ eliminationOpsWord8 S.fromFoldable "parallely"
92 parallelOps $ eliminationOpsWord8 S.fromFoldable "parallely"
93 parallelOps $ eliminationOpsWord8 folded "parallely folded"
93 parallelOps $ eliminationOpsWord8 folded "parallely folded"
94−
94+
95 -- test both (<>) and mappend to make sure we are using correct instance
95 -- test both (<>) and mappend to make sure we are using correct instance
96 -- for Monoid that is using the right version of semigroup. Instance
96 -- for Monoid that is using the right version of semigroup. Instance
97 -- deriving can cause us to pick wrong instances sometimes.
97 -- deriving can cause us to pick wrong instances sometimes.
98
98
99+#ifdef DEVBUILD
99 describe "Parallel (<>) time order check" $ parallelCheck parallely (<>)
100 describe "Parallel (<>) time order check" $ parallelCheck parallely (<>)
100 describe "Parallel mappend time order check" $ parallelCheck parallely mappend
101 describe "Parallel mappend time order check" $ parallelCheck parallely mappend
102+#endif
101
103
102 describe "Composed MonadThrow parallely" $ composeWithMonadThrow parallely
104 describe "Composed MonadThrow parallely" $ composeWithMonadThrow parallely
103
105
@@ -106,4 +108,4 @@ main = hspec
106 -- the events, but that would make tests even slower.
108 -- the events, but that would make tests even slower.
107 it "take 1 parallely" $ checkCleanup 3 parallely (S.take 1)
109 it "take 1 parallely" $ checkCleanup 3 parallely (S.take 1)
108 it "takeWhile (< 0) parallely" $ checkCleanup 3 parallely (S.takeWhile (< 0))
110 it "takeWhile (< 0) parallely" $ checkCleanup 3 parallely (S.takeWhile (< 0))
109−#endif
111+#endif
test/Streamly/Test/Prelude/Serial.hs+8−1
@@ -43,7 +43,10 @@ import qualified Streamly.Internal.Data.Unfold as UF
43import qualified Streamly.Internal.Data.Stream.IsStream as IS
43import qualified Streamly.Internal.Data.Stream.IsStream as IS
44import Streamly.Internal.Data.Time.Units
44import Streamly.Internal.Data.Time.Units
45 (AbsTime, NanoSecond64(..), toRelTime64, diffAbsTime64)
45 (AbsTime, NanoSecond64(..), toRelTime64, diffAbsTime64)
46+
47+#ifdef DEVBUILD
46import Streamly.Internal.Data.Time.Clock (Clock(Monotonic), getTime)
48import Streamly.Internal.Data.Time.Clock (Clock(Monotonic), getTime)
49+#endif
47
50
48import Streamly.Test.Common
51import Streamly.Test.Common
49import Streamly.Test.Prelude.Common
52import Streamly.Test.Prelude.Common
@@ -205,6 +208,7 @@ checkTakeDropTime (mt0, mt1) = do
205 " tMax = " ++ show tMax
208 " tMax = " ++ show tMax
206 return r
209 return r
207
210
211+#ifdef DEVBUILD
208testTakeByTime :: IO Bool
212testTakeByTime :: IO Bool
209testTakeByTime = do
213testTakeByTime = do
210 r <-
214 r <-
@@ -221,6 +225,7 @@ testDropByTime = do
221 $ IS.dropByTime takeDropTime
225 $ IS.dropByTime takeDropTime
222 $ S.repeatM (threadDelay 1000 >> getTime Monotonic)
226 $ S.repeatM (threadDelay 1000 >> getTime Monotonic)
223 checkTakeDropTime (Just t0, mt1)
227 checkTakeDropTime (Just t0, mt1)
228+#endif
224
229
225unfold :: Property
230unfold :: Property
226unfold = monadicIO $ do
231unfold = monadicIO $ do
@@ -373,9 +378,11 @@ main = hspec
373 serialOps $ transformCombineOpsOrdered S.fromFoldable "serially" (==)
378 serialOps $ transformCombineOpsOrdered S.fromFoldable "serially" (==)
374 serialOps $ transformCombineOpsOrdered folded "serially" (==)
379 serialOps $ transformCombineOpsOrdered folded "serially" (==)
375
380
381+#ifdef DEVBUILD
376 describe "Filtering" $ do
382 describe "Filtering" $ do
377 it "takeByTime" (testTakeByTime `shouldReturn` True)
383 it "takeByTime" (testTakeByTime `shouldReturn` True)
378 it "dropByTime" (testDropByTime `shouldReturn` True)
384 it "dropByTime" (testDropByTime `shouldReturn` True)
385+#endif
379
386
380 describe "Stream group and split operations" $ do
387 describe "Stream group and split operations" $ do
381 groupSplitOps "serially"
388 groupSplitOps "serially"
@@ -395,7 +402,7 @@ main = hspec
395 describe "Tests for S.groupsBy" $ do
402 describe "Tests for S.groupsBy" $ do
396 prop "testGroupsBy" testGroupsBy
403 prop "testGroupsBy" testGroupsBy
397 prop "testGroupsBySep" testGroupsBySep
404 prop "testGroupsBySep" testGroupsBySep
398−
405+
399 describe "Composed MonadThrow serially" $ composeWithMonadThrow serially
406 describe "Composed MonadThrow serially" $ composeWithMonadThrow serially
400
407
401 it "fromCallback" $ testFromCallback `shouldReturn` (50*101)
408 it "fromCallback" $ testFromCallback `shouldReturn` (50*101)