serversession/serversession-backend-acid-state/tests/Main.hs
Felipe Lessa ec4623da34 Do not run large data tests in parallel.
Brings peak memory usage of the persistent test suite from 6 GiB to
4 GiB.  Still very bad, though.
2015-05-28 13:02:54 -03:00

22 lines
762 B
Haskell

module Main (main) where
import Data.Acid.Local (openLocalState, createCheckpointAndClose)
import Data.Acid.Memory (openMemoryState)
import Test.Hspec
import Web.ServerSession.Backend.Acid
import Web.ServerSession.Core.StorageTests
import qualified Control.Exception as E
main :: IO ()
main =
E.bracket
(AcidStorage <$> openLocalState emptyState)
(createCheckpointAndClose . acidState) $
\acidLocal -> hspec $ do
acidMem <- runIO $ AcidStorage <$> openMemoryState emptyState
describe "AcidStorage on memory only" $
allStorageTests acidMem it runIO parallel shouldBe shouldReturn shouldThrow
describe "AcidStorage on local storage" $
allStorageTests acidLocal it runIO parallel shouldBe shouldReturn shouldThrow