Skip to content

Commit 0847e29

Browse files
committed
Run chain-gen tests serially
tasty 1.5 changed the default to parallel https://github.com/UnkindPartition/tasty/blob/master/core/CHANGELOG.md#version-154
1 parent bc7567d commit 0847e29

1 file changed

Lines changed: 11 additions & 7 deletions

File tree

cardano-chain-gen/test/Main.hs

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import qualified Test.Cardano.Db.Mock.Unit.Babbage as Babbage
1212
import qualified Test.Cardano.Db.Mock.Unit.Conway as Conway
1313
import Test.Tasty
1414
import Test.Tasty.QuickCheck (testProperty)
15+
import Test.Tasty.Runners (NumThreads (..))
1516
import Prelude
1617

1718
main :: IO ()
@@ -27,14 +28,17 @@ main = do
2728

2829
tests :: IOManager -> IO TestTree
2930
tests iom = do
31+
-- Tests share a single Postgres instance and DB, so they must run serially.
32+
-- tasty 1.5+ defaults to parallel execution; override that here.
3033
pure $
31-
testGroup
32-
"cardano-chain-gen"
33-
[ Conway.unitTests iom knownMigrationsPlain
34-
, Babbage.unitTests iom knownMigrationsPlain
35-
, Alonzo.unitTests iom knownMigrationsPlain
36-
, testProperty "QSM" $ Property.prop_empty_blocks iom knownMigrationsPlain
37-
]
34+
localOption (NumThreads 1) $
35+
testGroup
36+
"cardano-chain-gen"
37+
[ Conway.unitTests iom knownMigrationsPlain
38+
, Babbage.unitTests iom knownMigrationsPlain
39+
, Alonzo.unitTests iom knownMigrationsPlain
40+
, testProperty "QSM" $ Property.prop_empty_blocks iom knownMigrationsPlain
41+
]
3842
where
3943
knownMigrationsPlain :: [(Text, Text)]
4044
knownMigrationsPlain = (\x -> (hash x, filepath x)) <$> knownMigrations

0 commit comments

Comments
 (0)