From da675c2cdaa3b52038536bf4017f5f96e49b0663 Mon Sep 17 00:00:00 2001 From: Edmund Noble Date: Wed, 15 Jan 2025 13:23:54 -0500 Subject: [PATCH] Use deleteRange to clean up testRocksDb This makes our rocksdb smaller, which makes certain tests faster, especially the Cut property tests like meetAssociative which mine a lot of blocks. Change-Id: Id000000077e9012e622fc8577efd411f2fbb3993 --- .../src/Chainweb/Storage/Table/RocksDB.hs | 13 ++ test/lib/Chainweb/Test/Cut.hs | 10 +- test/lib/Chainweb/Test/Cut/TestBlockDb.hs | 20 +-- test/lib/Chainweb/Test/Pact4/Utils.hs | 14 +- .../Pact4/VerifierPluginTest/Transaction.hs | 19 +- .../Transaction/Message/After225.hs | 26 +-- .../Transaction/Message/Before225.hs | 11 +- test/lib/Chainweb/Test/Pact5/Utils.hs | 51 +----- test/lib/Chainweb/Test/Utils.hs | 58 +++---- .../Test/Pact4/ModuleCacheOnRestart.hs | 2 +- .../Chainweb/Test/Pact4/PactMultiChainTest.hs | 27 +-- .../Test/Pact4/PactSingleChainTest.hs | 9 +- test/unit/Chainweb/Test/Pact4/SPV.hs | 162 +++++++++--------- .../Chainweb/Test/Pact4/VerifierPluginTest.hs | 8 +- test/unit/Chainweb/Test/Pact5/CutFixture.hs | 2 +- .../Chainweb/Test/Pact5/PactServiceTest.hs | 4 +- .../Test/Pact5/TransactionExecTest.hs | 4 +- test/unit/ChainwebTests.hs | 6 +- 18 files changed, 204 insertions(+), 242 deletions(-) diff --git a/libs/chainweb-storage/src/Chainweb/Storage/Table/RocksDB.hs b/libs/chainweb-storage/src/Chainweb/Storage/Table/RocksDB.hs index 11811baee0..7cd49aca0d 100644 --- a/libs/chainweb-storage/src/Chainweb/Storage/Table/RocksDB.hs +++ b/libs/chainweb-storage/src/Chainweb/Storage/Table/RocksDB.hs @@ -84,6 +84,7 @@ module Chainweb.Storage.Table.RocksDB -- * RocksDB-specific tools , checkpointRocksDb , deleteRangeRocksDb + , deleteNamespaceRocksDb , compactRangeRocksDb ) where @@ -696,6 +697,18 @@ deleteRangeRocksDb table range = do minKeyPtr (fromIntegral minKeyLen :: CSize) maxKeyPtr (fromIntegral maxKeyLen :: CSize) +-- | Batch delete all contents of rocksdb +deleteNamespaceRocksDb :: HasCallStack => RocksDb -> IO () +deleteNamespaceRocksDb rdb = do + let R.DB dbPtr = _rocksDbHandle rdb + R.withCWriteOpts R.defaultWriteOptions $ \optsPtr -> + BU.unsafeUseAsCStringLen (namespaceFirst $ _rocksDbNamespace rdb) $ \(minKeyPtr, minKeyLen) -> + BU.unsafeUseAsCStringLen (namespaceLast $ _rocksDbNamespace rdb) $ \(maxKeyPtr, maxKeyLen) -> + checked "Chainweb.Storage.Table.RocksDB.deleteAllContentsRocksDb" $ + C.rocksdb_delete_range dbPtr optsPtr + minKeyPtr (fromIntegral minKeyLen :: CSize) + maxKeyPtr (fromIntegral maxKeyLen :: CSize) + compactRangeRocksDb :: HasCallStack => RocksDbTable k v -> (Maybe k, Maybe k) -> IO () compactRangeRocksDb table range = BU.unsafeUseAsCStringLen (fst range') $ \(minKeyPtr, minKeyLen) -> diff --git a/test/lib/Chainweb/Test/Cut.hs b/test/lib/Chainweb/Test/Cut.hs index 428c75db95..58b962510c 100644 --- a/test/lib/Chainweb/Test/Cut.hs +++ b/test/lib/Chainweb/Test/Cut.hs @@ -97,8 +97,9 @@ import Chainweb.Cut import Chainweb.Cut.Create import Chainweb.Graph import Chainweb.Payload -import Chainweb.Test.Utils.BlockHeader import Chainweb.Test.TestVersions +import Chainweb.Test.Utils.BlockHeader +import Chainweb.Test.Utils import Chainweb.Time (Micros(..), Time, TimeSpan) import qualified Chainweb.Time as Time (second) import Chainweb.Utils @@ -665,9 +666,10 @@ ioTest -> ChainwebVersion -> (WebBlockHeaderDb -> T.PropertyM IO Bool) -> T.Property -ioTest db v f = T.monadicIO $ - liftIO (initWebBlockHeaderDb db v) >>= f >>= T.assert +ioTest baseDb v f = T.monadicIO $ do + db' <- liftIO $ testRocksDb "Chainweb.Test.Cut" baseDb + liftIO (initWebBlockHeaderDb db' v) >>= f >>= T.assert + liftIO $ deleteNamespaceRocksDb db' pickBlind :: T.Gen a -> T.PropertyM IO a pickBlind = fmap T.getBlind . T.pick . fmap T.Blind - diff --git a/test/lib/Chainweb/Test/Cut/TestBlockDb.hs b/test/lib/Chainweb/Test/Cut/TestBlockDb.hs index e9602283b5..e09f463192 100644 --- a/test/lib/Chainweb/Test/Cut/TestBlockDb.hs +++ b/test/lib/Chainweb/Test/Cut/TestBlockDb.hs @@ -10,7 +10,6 @@ module Chainweb.Test.Cut.TestBlockDb ( TestBlockDb(..) - , withTestBlockDb , mkTestBlockDb , addTestBlockDb , getParentTestBlockDb @@ -24,7 +23,10 @@ module Chainweb.Test.Cut.TestBlockDb import Control.Concurrent.MVar import Control.Lens +import Control.Monad import Control.Monad.Catch +import Control.Monad.IO.Class +import Control.Monad.Trans.Resource import qualified Data.HashMap.Strict as HM import Chainweb.Block @@ -32,7 +34,7 @@ import Chainweb.BlockHeader import Chainweb.BlockHeaderDB import Chainweb.ChainId import Chainweb.Cut -import Chainweb.Test.Utils (testRocksDb) +import Chainweb.Test.Utils import Chainweb.Test.Cut (GenBlockTime, testMine', MineFailure(BadAdjacents)) import Chainweb.Payload import Chainweb.Payload.PayloadStore @@ -43,7 +45,6 @@ import Chainweb.WebBlockHeaderDB import Chainweb.Storage.Table.RocksDB import Chainweb.BlockHeight -import Control.Monad data TestBlockDb = TestBlockDb { _bdbWebBlockHeaderDb :: WebBlockHeaderDb @@ -55,22 +56,17 @@ instance HasChainwebVersion TestBlockDb where _chainwebVersion = _chainwebVersion . _bdbWebBlockHeaderDb -- | Initialize TestBlockDb. -withTestBlockDb :: ChainwebVersion -> (TestBlockDb -> IO a) -> IO a -withTestBlockDb cv a = do - withTempRocksDb "TestBlockDb" $ \rdb -> do - bdb <- mkTestBlockDb cv rdb - a bdb - --- | Initialize TestBlockDb. -mkTestBlockDb :: ChainwebVersion -> RocksDb -> IO TestBlockDb +mkTestBlockDb :: ChainwebVersion -> RocksDb -> ResourceT IO TestBlockDb mkTestBlockDb cv rdb = do - testRdb <- testRocksDb "mkTestBlockDb" rdb + testRdb <- withTestRocksDb "mkTestBlockDb" rdb + liftIO $ do wdb <- initWebBlockHeaderDb testRdb cv let pdb = newPayloadDb testRdb initializePayloadDb cv pdb initCut <- newMVar $ genesisCut cv return $! TestBlockDb wdb pdb initCut + -- | Add a block. -- -- Returns False when mining fails due to BadAdjacents, which usually means that diff --git a/test/lib/Chainweb/Test/Pact4/Utils.hs b/test/lib/Chainweb/Test/Pact4/Utils.hs index 5bb8016b1c..3ba7d3d710 100644 --- a/test/lib/Chainweb/Test/Pact4/Utils.hs +++ b/test/lib/Chainweb/Test/Pact4/Utils.hs @@ -100,7 +100,6 @@ module Chainweb.Test.Pact4.Utils , freeGasModel , testPactServiceConfig , withBlockHeaderDb -, withTemporaryDir , withSqliteDb -- * Mempool utils , delegateMemPoolAccess @@ -160,8 +159,6 @@ import Database.SQLite3.Direct (Database) import GHC.Generics import Streaming.Prelude qualified as S -import System.Directory -import System.IO.Temp (createTempDirectory) import System.LogLevel import Test.Tasty @@ -947,11 +944,6 @@ withBlockHeaderDb iordb b = withResource start stop testBlockHeaderDb rdb b stop = closeBlockHeaderDb -withTemporaryDir :: (IO FilePath -> TestTree) -> TestTree -withTemporaryDir = withResource - (getTemporaryDirectory >>= \d -> createTempDirectory d "test-pact") - removeDirectoryRecursive - -- | Single-chain Pact via service queue. -- -- The difference between this and 'withPactTestBlockDb' is that, @@ -969,7 +961,7 @@ withPactTestBlockDb' -> (IO (SQLiteEnv,PactQueue,TestBlockDb) -> TestTree) -> TestTree withPactTestBlockDb' version cid rdb sqlEnvIO mempoolIO pactConfig f = - withResource' (mkTestBlockDb version rdb) $ \bdbio -> + withResourceT (mkTestBlockDb version rdb) $ \bdbio -> withResource (startPact bdbio) stopPact $ f . fmap (view _2) where startPact bdbio = do @@ -1023,8 +1015,8 @@ withPactTestBlockDb -> (IO (SQLiteEnv,PactQueue,TestBlockDb) -> TestTree) -> TestTree withPactTestBlockDb version cid rdb mempoolIO pactConfig f = - withTemporaryDir $ \iodir -> - withResource' (mkTestBlockDb version rdb) $ \bdbio -> + withResourceT (withTempDir "pact-dir") $ \iodir -> + withResourceT (mkTestBlockDb version rdb) $ \bdbio -> withResource (startPact bdbio iodir) stopPact $ f . fmap (view _2) where startPact bdbio iodir = do diff --git a/test/lib/Chainweb/Test/Pact4/VerifierPluginTest/Transaction.hs b/test/lib/Chainweb/Test/Pact4/VerifierPluginTest/Transaction.hs index 54b5fafeb1..912aa762ff 100644 --- a/test/lib/Chainweb/Test/Pact4/VerifierPluginTest/Transaction.hs +++ b/test/lib/Chainweb/Test/Pact4/VerifierPluginTest/Transaction.hs @@ -12,6 +12,7 @@ module Chainweb.Test.Pact4.VerifierPluginTest.Transaction import Control.Lens hiding ((.=)) import Control.Monad.Reader +import Data.IORef import qualified Data.Vector as V import Test.Tasty import Test.Tasty.HUnit @@ -28,18 +29,19 @@ import Pact.Types.Verifier hiding (verifierName) import Chainweb.Miner.Pact import Chainweb.Pact.Types +import Chainweb.Storage.Table.RocksDB import Chainweb.Test.Cut.TestBlockDb import Chainweb.Test.Pact4.Utils +import Chainweb.Test.Utils +import Chainweb.Version import qualified Chainweb.Test.Pact4.VerifierPluginTest.Transaction.Message.After225 as After225 import qualified Chainweb.Test.Pact4.VerifierPluginTest.Transaction.Message.Before225 as Before225 import Chainweb.Test.Pact4.VerifierPluginTest.Transaction.Utils -import Data.IORef -import Chainweb.Version -tests :: TestTree -tests = testGroup testName +tests :: RocksDb -> TestTree +tests rdb = testGroup testName [ test generousConfig "verifierTest" verifierTest , test generousConfig "recoverValidatorAnnouncementSuccess" hyperlaneRecoverValidatorAnnouncementSuccess @@ -49,8 +51,8 @@ tests = testGroup testName hyperlaneRecoverValidatorAnnouncementDifferentSignerFailure , testGroup "Message" - [ Before225.tests - , After225.tests + [ Before225.tests rdb + , After225.tests rdb ] ] where @@ -60,8 +62,9 @@ tests = testGroup testName generousConfig = testPactServiceConfig { _pactNewBlockGasLimit = 300_000 } test pactConfig tname f = - testCaseSteps tname $ \step -> - withTestBlockDb testVersion $ \bdb -> do + withResourceT (mkTestBlockDb testVersion rdb) $ \bdbIO -> do + testCaseSteps tname $ \step -> do + bdb <- bdbIO let logger = hunitDummyLogger step mempools <- onAllChains testVersion $ \_ -> do mempoolRef <- newIORef mempty diff --git a/test/lib/Chainweb/Test/Pact4/VerifierPluginTest/Transaction/Message/After225.hs b/test/lib/Chainweb/Test/Pact4/VerifierPluginTest/Transaction/Message/After225.hs index 4683d9edac..73b6ee237c 100644 --- a/test/lib/Chainweb/Test/Pact4/VerifierPluginTest/Transaction/Message/After225.hs +++ b/test/lib/Chainweb/Test/Pact4/VerifierPluginTest/Transaction/Message/After225.hs @@ -28,8 +28,10 @@ import Pact.Types.Verifier hiding (verifierName) import Chainweb.Miner.Pact import Chainweb.Pact.Types +import Chainweb.Storage.Table.RocksDB import Chainweb.Test.Cut.TestBlockDb import Chainweb.Test.Pact4.Utils +import Chainweb.Test.Utils import Chainweb.Utils import Chainweb.Utils.Serialization import Chainweb.VerifierPlugin.Hyperlane.Binary @@ -39,8 +41,8 @@ import Chainweb.Test.Pact4.VerifierPluginTest.Transaction.Utils import Chainweb.Version import Data.IORef -tests :: TestTree -tests = testGroup "After225" +tests :: RocksDb -> TestTree +tests rdb = testGroup "After225" [ test generousConfig "verifySuccess" hyperlaneVerifySuccess , test generousConfig "verifyMoreValidatorsSuccess" hyperlaneVerifyMoreValidatorsSuccess , test generousConfig "verifyThresholdZeroError" hyperlaneVerifyThresholdZeroError @@ -55,16 +57,16 @@ tests = testGroup "After225" -- we can be generous. generousConfig = testPactServiceConfig { _pactNewBlockGasLimit = 300_000 } - test pactConfig tname f = - testCaseSteps tname $ \step -> - withTestBlockDb testVersion $ \bdb -> do - let logger = hunitDummyLogger step - mempools <- onAllChains testVersion $ \_ -> do - mempoolRef <- newIORef mempty - return (mempoolRef, delegateMemPoolAccess mempoolRef) - withWebPactExecutionService logger testVersion pactConfig bdb (snd <$> mempools) $ \(pact,_) -> - runReaderT f $ - SingleEnv bdb pact (mempools ^?! atChain cid . _1) noMiner cid + test pactConfig tname f = withResourceT (mkTestBlockDb testVersion rdb) $ \bdbIO -> + testCaseSteps tname $ \step -> do + bdb <- bdbIO + let logger = hunitDummyLogger step + mempools <- onAllChains testVersion $ \_ -> do + mempoolRef <- newIORef mempty + return (mempoolRef, delegateMemPoolAccess mempoolRef) + withWebPactExecutionService logger testVersion pactConfig bdb (snd <$> mempools) $ \(pact,_) -> + runReaderT f $ + SingleEnv bdb pact (mempools ^?! atChain cid . _1) noMiner cid -- hyperlane message tests diff --git a/test/lib/Chainweb/Test/Pact4/VerifierPluginTest/Transaction/Message/Before225.hs b/test/lib/Chainweb/Test/Pact4/VerifierPluginTest/Transaction/Message/Before225.hs index 498f93b541..c2d8a1ac63 100644 --- a/test/lib/Chainweb/Test/Pact4/VerifierPluginTest/Transaction/Message/Before225.hs +++ b/test/lib/Chainweb/Test/Pact4/VerifierPluginTest/Transaction/Message/Before225.hs @@ -27,8 +27,10 @@ import Pact.Types.Verifier hiding (verifierName) import Chainweb.Miner.Pact import Chainweb.Pact.Types +import Chainweb.Storage.Table.RocksDB import Chainweb.Test.Cut.TestBlockDb import Chainweb.Test.Pact4.Utils +import Chainweb.Test.Utils import Chainweb.Utils import Chainweb.Utils.Serialization import Chainweb.VerifierPlugin.Hyperlane.Binary @@ -38,8 +40,8 @@ import Chainweb.Test.Pact4.VerifierPluginTest.Transaction.Utils import Data.IORef import Chainweb.Version -tests :: TestTree -tests = testGroup "Before225" +tests :: RocksDb -> TestTree +tests rdb = testGroup "Before225" [ testGroup "MessageId metadata tests" [ test generousConfig "verifySuccess" hyperlaneVerifyMessageIdSuccess , test generousConfig "verifyEmptyRecoveredSignaturesSuccess" hyperlaneVerifyMessageIdEmptyRecoveredSignaturesSuccess @@ -58,8 +60,9 @@ tests = testGroup "Before225" generousConfig = testPactServiceConfig { _pactNewBlockGasLimit = 300_000 } test pactConfig tname f = - testCaseSteps tname $ \step -> - withTestBlockDb testVersion $ \bdb -> do + withResourceT (mkTestBlockDb testVersion rdb) $ \bdbIO -> + testCaseSteps tname $ \step -> do + bdb <- bdbIO let logger = hunitDummyLogger step mempools <- onAllChains testVersion $ \_ -> do mempoolRef <- newIORef mempty diff --git a/test/lib/Chainweb/Test/Pact5/Utils.hs b/test/lib/Chainweb/Test/Pact5/Utils.hs index a807fffc4a..23f0d6d1e9 100644 --- a/test/lib/Chainweb/Test/Pact5/Utils.hs +++ b/test/lib/Chainweb/Test/Pact5/Utils.hs @@ -24,13 +24,10 @@ module Chainweb.Test.Pact5.Utils -- * Resources , withTempSQLiteResource , withInMemSQLiteResource - , withTestRocksDb , withPactQueue , withMempool , withRunPactService , withBlockDbs - , withTestBlockHeaderDb - , testRocksDb -- * Properties , event @@ -43,9 +40,6 @@ module Chainweb.Test.Pact5.Utils import Chainweb.Chainweb (validatingMempoolConfig) import "pact" Pact.Types.Command qualified as Pact4 import "pact" Pact.Types.Hash qualified as Pact4 -import Chainweb.BlockHeader -import Chainweb.BlockHeaderDB (BlockHeaderDb, initBlockHeaderDb, closeBlockHeaderDb) -import Chainweb.BlockHeaderDB qualified as BlockHeaderDB import Chainweb.ChainId import Chainweb.Logger import Chainweb.Mempool.Consensus @@ -70,14 +64,13 @@ import Chainweb.Version import Chainweb.WebBlockHeaderDB import Chainweb.WebPactExecutionService import Control.Concurrent hiding (throwTo) -import Control.Exception (AsyncException (..), finally, throwTo) +import Control.Exception (AsyncException (..), throwTo) import Control.Lens hiding (elements, only) import Control.Monad import Control.Monad.IO.Class import Control.Monad.Trans.Resource (ResourceT, allocate) import Control.Monad.Trans.Resource qualified as Resource import Data.Aeson qualified as Aeson -import Data.ByteString (ByteString) import Data.ByteString.Short qualified as SBS import Data.HashSet (HashSet) import Data.HashSet qualified as HashSet @@ -88,17 +81,13 @@ import Data.Text.Encoding qualified as Text import Data.Text.IO qualified as Text import Data.Vector (Vector) import Data.Vector qualified as Vector -import Data.Word (Word64) -import Database.RocksDB.Internal qualified as R import Pact.Core.Command.Types qualified as Pact5 import Pact.Core.Hash qualified as Pact5 import Pact.Core.Pretty qualified as Pact5 import Pact.JSON.Encode qualified as J import Pact.Types.Gas qualified as Pact4 import System.Environment (lookupEnv) -import System.IO.Temp (createTempDirectory, getCanonicalTemporaryDirectory) import System.LogLevel -import System.Random (randomIO) import PropertyMatchers ((?)) import PropertyMatchers qualified as P import Pact.Core.PactValue @@ -112,44 +101,6 @@ withBlockDbs v rdb = do liftIO $ initializePayloadDb v payloadDb return (payloadDb, webBHDb) -testBlockHeaderDb - :: RocksDb - -> BlockHeader - -> IO BlockHeaderDb -testBlockHeaderDb rdb h = do - rdb' <- testRocksDb "withTestBlockHeaderDb" rdb - initBlockHeaderDb (BlockHeaderDB.Configuration h rdb') - -withTestBlockHeaderDb - :: RocksDb - -> BlockHeader - -> ResourceT IO BlockHeaderDb -withTestBlockHeaderDb rdb h = - snd <$> allocate (testBlockHeaderDb rdb h) closeBlockHeaderDb - -testRocksDb - :: ByteString -- ^ Prefix - -> RocksDb - -> IO RocksDb -testRocksDb l r = do - prefix <- (<>) l . sshow <$> (randomIO @Word64) - return r { _rocksDbNamespace = prefix } - -withTestRocksDb :: ResourceT IO RocksDb -withTestRocksDb = view _2 . snd <$> allocate create destroy - where - create = do - sysdir <- getCanonicalTemporaryDirectory - dir <- createTempDirectory sysdir "chainweb-rocksdb-tmp" - opts@(R.Options' opts_ptr _ _) <- R.mkOpts modernDefaultOptions - rocks <- openRocksDb dir opts_ptr - return (dir, rocks, opts) - - destroy (dir, rocks, opts) = - closeRocksDb rocks `finally` - R.freeOpts opts `finally` - destroyRocksDb dir - -- | Internal. See https://www.sqlite.org/c3ref/open.html withSQLiteResource :: String diff --git a/test/lib/Chainweb/Test/Utils.hs b/test/lib/Chainweb/Test/Utils.hs index 243e15f167..692df8935b 100644 --- a/test/lib/Chainweb/Test/Utils.hs +++ b/test/lib/Chainweb/Test/Utils.hs @@ -40,6 +40,7 @@ module Chainweb.Test.Utils -- * Test RocksDb , testRocksDb +, withTestRocksDb -- * Intialize Test BlockHeader DB , testBlockHeaderDb @@ -132,14 +133,14 @@ module Chainweb.Test.Utils , withNodeDbDirs , withPactDir , NodeDbDirs(..) +, withTempDir ) where -import Chainweb.Test.Pact5.Utils (getTestLogLevel) import Control.Concurrent import Control.Concurrent.STM import Control.Lens import Control.Monad -import Control.Monad.Catch (MonadCatch, catch, finally, bracket) +import Control.Monad.Catch (finally, bracket) import Control.Monad.IO.Class import Control.Monad.Trans.Resource import Control.Retry @@ -224,6 +225,7 @@ import Chainweb.Pact.Backend.Utils (openSQLiteConnection, closeSQLiteConnection, import Chainweb.Payload.PayloadStore import Chainweb.RestAPI import Chainweb.RestAPI.NetworkID +import Chainweb.Test.Pact5.Utils (getTestLogLevel) import Chainweb.Test.P2P.Peer.BootstrapConfig (testBootstrapCertificate, testBootstrapKey, testBootstrapPeerConfig) import Chainweb.Test.Utils.BlockHeader @@ -313,6 +315,12 @@ testRocksDb l r = do prefix <- (<>) l . sshow <$> (randomIO @Word64) return r { _rocksDbNamespace = prefix } +withTestRocksDb :: B.ByteString -> RocksDb -> ResourceT IO RocksDb +withTestRocksDb l r = snd <$> allocate create destroy + where + create = testRocksDb l r + destroy = deleteNamespaceRocksDb + withRocksResource :: ResourceT IO RocksDb withRocksResource = view _2 . snd <$> allocate create destroy where @@ -1079,41 +1087,23 @@ data NodeDbDirs = NodeDbDirs } withPactDir :: Word -> ResourceT IO FilePath -withPactDir nid = do - fmap snd $ allocate - (do - targetDir <- getCanonicalTemporaryDirectory - createTempDirectory targetDir ("pactdb-dir-" ++ show nid) - ) - (\dir -> ignoringIOErrors $ removeDirectoryRecursive dir) +withPactDir nid = withTempDir $ "pactdb-dir-" ++ show nid + +withTempDir :: FilePath -> ResourceT IO FilePath +withTempDir template = snd <$> allocate create destroy + where + create = do + targetDir <- getCanonicalTemporaryDirectory + createTempDirectory targetDir template + destroy = removeDirectoryRecursive withNodeDbDirs :: RocksDb -> Word -> ResourceT IO [NodeDbDirs] withNodeDbDirs rdb n = do - let create :: IO [NodeDbDirs] - create = do - forM [0 .. n - 1] $ \nid -> do - targetDir1 <- getCanonicalTemporaryDirectory - targetDir2 <- getCanonicalTemporaryDirectory - - nodePactDbDir <- createTempDirectory targetDir1 ("pactdb-dir-" ++ show nid) - nodeBackupsDbDir <- createTempDirectory targetDir2 ("backups-dir-" ++ show nid) - nodeRocksDb <- testRocksDb (sshow nid) rdb - - pure NodeDbDirs { .. } - - let destroy :: [NodeDbDirs] -> IO () - destroy dirs = flip foldMap dirs $ \NodeDbDirs {..} -> do - ignoringIOErrors $ do - removeDirectoryRecursive nodePactDbDir - removeDirectoryRecursive nodeBackupsDbDir - -- we can't delete a testRocksDb effectively, chainweb-storage only - -- offers DeleteRange on tables - - (_, m) <- allocate create destroy - pure m - -ignoringIOErrors :: (MonadCatch m) => m () -> m () -ignoringIOErrors ioe = ioe `catch` (\(_ :: IOError) -> pure ()) + forM [0 .. n - 1] $ \nid -> do + nodePactDbDir <- withTempDir ("pactdb-dir-" ++ show nid) + nodeBackupsDbDir <- withTempDir ("backups-dir-" ++ show nid) + nodeRocksDb <- withTestRocksDb (sshow nid) rdb + pure NodeDbDirs { .. } deadbeef :: TransactionHash deadbeef = TransactionHash "deadbeefdeadbeefdeadbeefdeadbeef" diff --git a/test/unit/Chainweb/Test/Pact4/ModuleCacheOnRestart.hs b/test/unit/Chainweb/Test/Pact4/ModuleCacheOnRestart.hs index 2c0b25b6c3..ec98b22b49 100644 --- a/test/unit/Chainweb/Test/Pact4/ModuleCacheOnRestart.hs +++ b/test/unit/Chainweb/Test/Pact4/ModuleCacheOnRestart.hs @@ -79,7 +79,7 @@ tests :: RocksDb -> TestTree tests rdb = withResource' (newMVar mempty) $ \iom -> withResource' newEmptyMVar $ \rewindDataM -> - withResource' (mkTestBlockDb testVer rdb) $ \bdbio -> + withResourceT (mkTestBlockDb testVer rdb) $ \bdbio -> withResourceT withTempSQLiteResource $ \ioSqlEnv -> independentSequentialTestGroup "Chainweb.Test.Pact4.ModuleCacheOnRestart" [ testCaseSteps "testInitial" $ withPact' bdbio ioSqlEnv iom testInitial diff --git a/test/unit/Chainweb/Test/Pact4/PactMultiChainTest.hs b/test/unit/Chainweb/Test/Pact4/PactMultiChainTest.hs index 63415deef4..adb21fa389 100644 --- a/test/unit/Chainweb/Test/Pact4/PactMultiChainTest.hs +++ b/test/unit/Chainweb/Test/Pact4/PactMultiChainTest.hs @@ -56,12 +56,14 @@ import Chainweb.ChainId import Chainweb.Cut import Chainweb.Mempool.Mempool import Chainweb.Miner.Pact - +import Chainweb.Pact.Backend.Types import Chainweb.Pact.Types import qualified Chainweb.Pact4.Transaction as Pact4 import Chainweb.Pact4.TransactionExec (listErrMsg) import Chainweb.Payload +import Chainweb.Payload.PayloadStore (lookupPayloadWithHeight) import Chainweb.SPV.CreateProof +import Chainweb.Storage.Table.RocksDB import Chainweb.Test.Cut import Chainweb.Test.Cut.TestBlockDb import Chainweb.Test.Pact4.Utils @@ -72,8 +74,6 @@ import Chainweb.Utils import Chainweb.Version import Chainweb.WebPactExecutionService -import Chainweb.Payload.PayloadStore (lookupPayloadWithHeight) -import Chainweb.Pact.Backend.Types testVersion :: ChainwebVersion testVersion = slowForkingCpmTestVersion peterson @@ -121,8 +121,8 @@ data PactTxTest = PactTxTest , _pttTest :: CommandResult Hash -> Assertion } -tests :: TestTree -tests = testGroup testName +tests :: RocksDb -> TestTree +tests rdb = testGroup testName [ test generousConfig "pact4coin3UpgradeTest" pact4coin3UpgradeTest , test generousConfig "pact42UpgradeTest" pact42UpgradeTest , test generousConfig "minerKeysetTest" minerKeysetTest @@ -142,7 +142,7 @@ tests = testGroup testName , test generousConfig "chainweb223Test" chainweb223Test , test generousConfig "compactAndSyncTest" compactAndSyncTest , test generousConfig "compactionCompactsUnmodifiedTables" compactionCompactsUnmodifiedTables - , quirkTest + , quirkTest rdb , test generousConfig "checkTransferCreate" checkTransferCreate ] @@ -157,8 +157,9 @@ tests = testGroup testName } test pactConfig tname f = - testCaseSteps tname $ \step -> - withTestBlockDb testVersion $ \bdb -> do + withResourceT (mkTestBlockDb testVersion rdb) $ \bdbIO -> do + testCaseSteps tname $ \step -> do + bdb <- bdbIO mempools <- onAllChains testVersion $ \_chain -> do r <- newIORef mempty return (r, delegateMemPoolAccess r) @@ -1364,14 +1365,14 @@ checkTransferCreate = do where coinCaps = [ mkGasCap, mkTransferCap "sender00" "sender01" 1.0 ] --- TODO: pact5. -quirkTest :: TestTree -quirkTest = do +quirkTest :: RocksDb -> TestTree +quirkTest rdb = do let v = quirkedGasInstantCpmTestVersion peterson let mempoolCmdBuilder = buildBasic (mkExec' "(+ 1 2)") - testCaseSteps "quirkTest" $ \step -> - withTestBlockDb v $ \bdb -> do + withResourceT (mkTestBlockDb v rdb) $ \bdbIO -> + testCaseSteps "quirkTest" $ \step -> do + bdb <- bdbIO mempools <- onAllChains v $ \_cid -> do r <- newIORef mempty return (r, delegateMemPoolAccess r) diff --git a/test/unit/Chainweb/Test/Pact4/PactSingleChainTest.hs b/test/unit/Chainweb/Test/Pact4/PactSingleChainTest.hs index f53801924b..dd97770d1f 100644 --- a/test/unit/Chainweb/Test/Pact4/PactSingleChainTest.hs +++ b/test/unit/Chainweb/Test/Pact4/PactSingleChainTest.hs @@ -385,7 +385,7 @@ compactionIsIdempotent :: () compactionIsIdempotent rdb = -- This requires a bit more than 'compactionSetup', since we -- are compacting more than once. - withTemporaryDir $ \twiceDir -> withSqliteDb cid twiceDir $ \twiceSqlEnvIO -> + withResourceT (withTempDir "pact-dir") $ \twiceDir -> withSqliteDb cid twiceDir $ \twiceSqlEnvIO -> compactionSetup "compactionIsIdempotent" rdb testPactServiceConfig $ \cr -> do let numBlocks :: Num a => a numBlocks = 100 @@ -1387,11 +1387,12 @@ compactionSetup :: () -> (CompactionResources -> IO ()) -> TestTree compactionSetup pat rdb pactCfg f = - withTemporaryDir $ \srcDir -> withSqliteDb cid srcDir $ \srcSqlEnvIO -> - withTemporaryDir $ \targetDir -> withSqliteDb cid targetDir $ \targetSqlEnvIO -> + withResourceT (withTempDir "src-pact-dir") $ \srcDir -> withSqliteDb cid srcDir $ \srcSqlEnvIO -> + withResourceT (withTempDir "src-pact-dir") $ \targetDir -> withSqliteDb cid targetDir $ \targetSqlEnvIO -> + withResourceT (mkTestBlockDb testVersion rdb) $ \blockDbIO -> withDelegateMempool $ \dm -> testCase pat $ do - blockDb <- mkTestBlockDb testVersion rdb + blockDb <- blockDbIO bhDb <- getWebBlockHeaderDb (_bdbWebBlockHeaderDb blockDb) cid let payloadDb = _bdbPayloadDb blockDb srcSqlEnv <- srcSqlEnvIO diff --git a/test/unit/Chainweb/Test/Pact4/SPV.hs b/test/unit/Chainweb/Test/Pact4/SPV.hs index ab34886119..0ce12c4e62 100644 --- a/test/unit/Chainweb/Test/Pact4/SPV.hs +++ b/test/unit/Chainweb/Test/Pact4/SPV.hs @@ -40,6 +40,7 @@ import Data.ByteString.Lazy (toStrict) import qualified Data.HashMap.Strict as HM import Data.IORef import Data.List (isInfixOf) +import Data.LogMessage import Data.Text (pack,Text) import qualified Data.Text.IO as T import qualified Data.Text as T @@ -78,9 +79,11 @@ import Chainweb.Cut import Chainweb.Graph import Chainweb.Miner.Pact +import Chainweb.Pact.Types (MemPoolAccess, mpaGetBlock) import Chainweb.Payload import Chainweb.Payload.PayloadStore import Chainweb.SPV.CreateProof +import Chainweb.Storage.Table.RocksDB import Chainweb.Test.Cut import Chainweb.Test.Cut.TestBlockDb import Chainweb.Test.Pact4.Utils @@ -91,22 +94,22 @@ import qualified Chainweb.Pact4.Transaction as Pact4 import Chainweb.Utils hiding (check) import Chainweb.Version as Chainweb import Chainweb.WebPactExecutionService +import Control.Monad.Trans.Resource +import Control.Monad.IO.Class -import Data.LogMessage -import Chainweb.Pact.Types (MemPoolAccess, mpaGetBlock) -- | Note: These tests are intermittently non-deterministic due to the way -- random chain sampling works with our test harnesses. -- -tests :: TestTree -tests = testGroup "Chainweb.Test.Pact4.SPV" - [ testCaseSteps "standard SPV verification round trip" standard - , testCaseSteps "contTXOUTOld" contTXOUTOld - , testCaseSteps "contTXOUTNew" contTXOUTNew - , testCaseSteps "tfrTXOUTNew" tfrTXOUTNew - , testCaseSteps "ethReceiptProof" ethReceiptProof - , testCaseSteps "noEthReceiptProof" noEthReceiptProof - , testCaseSteps "invalid proof formats fail" invalidProof +tests :: RocksDb -> TestTree +tests rdb = testGroup "Chainweb.Test.Pact4.SPV" + [ testCaseSteps "standard SPV verification round trip" $ standard rdb + , testCaseSteps "contTXOUTOld" $ contTXOUTOld rdb + , testCaseSteps "contTXOUTNew" $ contTXOUTNew rdb + , testCaseSteps "tfrTXOUTNew" $ tfrTXOUTNew rdb + , testCaseSteps "ethReceiptProof" $ ethReceiptProof rdb + , testCaseSteps "noEthReceiptProof" $ noEthReceiptProof rdb + , testCaseSteps "invalid proof formats fail" $ invalidProof rdb ] testVer :: ChainwebVersion @@ -133,62 +136,61 @@ _handle' e = -- -------------------------------------------------------------------------- -- -- tests -standard :: (String -> IO ()) -> Assertion -standard step = do - (c1,c3) <- roundtrip 0 1 burnGen createSuccess step +standard :: RocksDb -> (String -> IO ()) -> Assertion +standard rdb step = do + (c1,c3) <- roundtrip rdb 0 1 burnGen createSuccess step checkResult c1 0 "ObjectMap" checkResult c3 1 "Write succeeded" -contTXOUTOld :: (String -> IO ()) -> Assertion -contTXOUTOld step = do +contTXOUTOld :: RocksDb -> (String -> IO ()) -> Assertion +contTXOUTOld rdb step = do code <- T.readFile "test/pact/contTXOUTOld.pact" - (c1,c3) <- roundtrip 0 1 burnGen (createVerify False code mdata) step + (c1,c3) <- roundtrip rdb 0 1 burnGen (createVerify False code mdata) step checkResult c1 0 "ObjectMap" checkResult' c3 1 $ PactResult $ Right $ PLiteral $ LString rSuccessTXOUT where mdata = toJSON [fst sender01] :: Value -contTXOUTNew :: (String -> IO ()) -> Assertion -contTXOUTNew step = do +contTXOUTNew :: RocksDb -> (String -> IO ()) -> Assertion +contTXOUTNew rdb step = do code <- T.readFile "test/pact/contTXOUTNew.pact" - (c1,c3) <- roundtrip' bridgeVer 0 1 burnGen (createVerify True code mdata) step + (c1,c3) <- roundtrip' rdb bridgeVer 0 1 burnGen (createVerify True code mdata) step checkResult c1 0 "ObjectMap" checkResult' c3 1 $ PactResult $ Right $ PLiteral $ LString rSuccessTXOUT where mdata = toJSON [fst sender01] -tfrTXOUTNew :: (String -> IO ()) -> Assertion -tfrTXOUTNew step = do +tfrTXOUTNew :: RocksDb -> (String -> IO ()) -> Assertion +tfrTXOUTNew rdb step = do code <- T.readFile "test/pact/tfrTXOUTNew.pact" - (c1,c3) <- roundtrip' bridgeVer 0 1 transferGen (createVerify True code mdata) step + (c1,c3) <- roundtrip' rdb bridgeVer 0 1 transferGen (createVerify True code mdata) step checkResult c1 0 "Write succeeded" checkResult' c3 1 $ PactResult $ Right $ PLiteral $ LString rSuccessTXOUT where mdata = toJSON [fst sender01] :: Value -ethReceiptProof :: (String -> IO ()) -> Assertion -ethReceiptProof step = do +ethReceiptProof :: RocksDb -> (String -> IO ()) -> Assertion +ethReceiptProof rdb step = do code <- T.readFile "test/pact/ethReceiptProof.pact" - (c1,c3) <- roundtrip' bridgeVer 0 1 transferGen (createVerifyEth code) step + (c1,c3) <- roundtrip' rdb bridgeVer 0 1 transferGen (createVerifyEth code) step checkResult c1 0 "Write succeeded" checkResult' c3 1 $ PactResult $ Right $ PLiteral $ LString "ETH Success" - -noEthReceiptProof :: (String -> IO ()) -> Assertion -noEthReceiptProof step = do +noEthReceiptProof :: RocksDb -> (String -> IO ()) -> Assertion +noEthReceiptProof rdb step = do code <- T.readFile "test/pact/ethReceiptProof.pact" - (c1,c3) <- roundtrip' testVer 0 1 transferGen (createVerifyEth code) step + (c1,c3) <- roundtrip' rdb testVer 0 1 transferGen (createVerifyEth code) step checkResult c1 0 "Write succeeded" checkResult c3 1 "unsupported SPV types: ETH" rSuccessTXOUT :: Text rSuccessTXOUT = "TXOUT Success" -invalidProof :: (String -> IO ()) -> Assertion -invalidProof step = do - (c1,c3) <- roundtrip 0 1 burnGen createInvalidProof step +invalidProof :: RocksDb -> (String -> IO ()) -> Assertion +invalidProof rdb step = do + (c1,c3) <- roundtrip rdb 0 1 burnGen createInvalidProof step checkResult c1 0 "ObjectMap" checkResult c3 1 "Failure: resumePact: no previous execution found" @@ -217,7 +219,8 @@ runCut' v bdb pact = do getCutOutputs bdb roundtrip - :: Word32 + :: RocksDb + -> Word32 -- ^ source chain id -> Word32 -- ^ target chain id @@ -227,10 +230,11 @@ roundtrip -- ^ create tx generator -> (String -> IO ()) -> IO (CutOutputs, CutOutputs) -roundtrip = roundtrip' testVer +roundtrip rdb = roundtrip' rdb testVer roundtrip' - :: ChainwebVersion + :: RocksDb + -> ChainwebVersion -> Word32 -- ^ source chain id -> Word32 @@ -242,48 +246,50 @@ roundtrip' -> (String -> IO ()) -- ^ logging backend -> IO (CutOutputs, CutOutputs) -roundtrip' v sid0 tid0 burn create step = withTestBlockDb v $ \bdb -> do - tg <- newMVar mempty - let logger = hunitDummyLogger step - mempools <- onAllChains v $ \chain -> - return $ chainToMPA' chain tg - withWebPactExecutionService logger v testPactServiceConfig bdb mempools $ \(pact,_) -> do - - sid <- mkChainId v maxBound sid0 - tid <- mkChainId v maxBound tid0 - - -- track the continuation pact id - pidv <- newEmptyMVar @PactId - - -- cut 0: empty run (not sure why this is needed but test fails without it) - step "cut 0: empty run" - void $ runCut' v bdb pact - - -- cut 1: burn - step "cut 1: burn" - -- Creating the parent took at least 1 second. So 1s is fine as creation time - let t1 = add second epoch - txGen1 <- burn v t1 pidv sid tid - void $ swapMVar tg txGen1 - co1 <- runCut' v bdb pact - - -- setup create txgen with cut 1 - step "setup create txgen with cut 1" - (BlockCreationTime t2) <- view blockCreationTime <$> getParentTestBlockDb bdb tid - hi <- view blockHeight <$> getParentTestBlockDb bdb sid - txGen2 <- create v t2 bdb pidv sid tid hi - - -- cut 2: empty cut for diameter 1 - step "cut 2: empty cut for diameter 1" - void $ swapMVar tg mempty - void $ runCut' v bdb pact - - -- cut 3: create - step "cut 3: create" - void $ swapMVar tg txGen2 - co2 <- runCut' v bdb pact - - return (co1,co2) +roundtrip' rdb v sid0 tid0 burn create step = runResourceT $ do + bdb <- mkTestBlockDb v rdb + liftIO $ do + tg <- newMVar mempty + let logger = hunitDummyLogger step + mempools <- onAllChains v $ \chain -> + return $ chainToMPA' chain tg + withWebPactExecutionService logger v testPactServiceConfig bdb mempools $ \(pact,_) -> do + + sid <- mkChainId v maxBound sid0 + tid <- mkChainId v maxBound tid0 + + -- track the continuation pact id + pidv <- newEmptyMVar @PactId + + -- cut 0: empty run (not sure why this is needed but test fails without it) + step "cut 0: empty run" + void $ runCut' v bdb pact + + -- cut 1: burn + step "cut 1: burn" + -- Creating the parent took at least 1 second. So 1s is fine as creation time + let t1 = add second epoch + txGen1 <- burn v t1 pidv sid tid + void $ swapMVar tg txGen1 + co1 <- runCut' v bdb pact + + -- setup create txgen with cut 1 + step "setup create txgen with cut 1" + (BlockCreationTime t2) <- view blockCreationTime <$> getParentTestBlockDb bdb tid + hi <- view blockHeight <$> getParentTestBlockDb bdb sid + txGen2 <- create v t2 bdb pidv sid tid hi + + -- cut 2: empty cut for diameter 1 + step "cut 2: empty cut for diameter 1" + void $ swapMVar tg mempty + void $ runCut' v bdb pact + + -- cut 3: create + step "cut 3: create" + void $ swapMVar tg txGen2 + co2 <- runCut' v bdb pact + + return (co1,co2) _debugCut :: CanReadablePayloadCas tbl => String -> Cut -> PayloadDb tbl -> IO () diff --git a/test/unit/Chainweb/Test/Pact4/VerifierPluginTest.hs b/test/unit/Chainweb/Test/Pact4/VerifierPluginTest.hs index d33b68cc80..16c0f69d1c 100644 --- a/test/unit/Chainweb/Test/Pact4/VerifierPluginTest.hs +++ b/test/unit/Chainweb/Test/Pact4/VerifierPluginTest.hs @@ -4,11 +4,13 @@ module Chainweb.Test.Pact4.VerifierPluginTest import Test.Tasty +import Chainweb.Storage.Table.RocksDB + import qualified Chainweb.Test.Pact4.VerifierPluginTest.Transaction import qualified Chainweb.Test.Pact4.VerifierPluginTest.Unit -tests :: TestTree -tests = testGroup "Chainweb.Test.Pact4.VerifierPluginTest" +tests :: RocksDb -> TestTree +tests rdb = testGroup "Chainweb.Test.Pact4.VerifierPluginTest" [ Chainweb.Test.Pact4.VerifierPluginTest.Unit.tests - , Chainweb.Test.Pact4.VerifierPluginTest.Transaction.tests + , Chainweb.Test.Pact4.VerifierPluginTest.Transaction.tests rdb ] diff --git a/test/unit/Chainweb/Test/Pact5/CutFixture.hs b/test/unit/Chainweb/Test/Pact5/CutFixture.hs index ab0436efa0..c1f972b64a 100644 --- a/test/unit/Chainweb/Test/Pact5/CutFixture.hs +++ b/test/unit/Chainweb/Test/Pact5/CutFixture.hs @@ -64,7 +64,7 @@ import Chainweb.Payload.PayloadStore import Chainweb.Storage.Table.RocksDB import Chainweb.Sync.WebBlockHeaderStore import Chainweb.Test.Pact5.Utils -import Chainweb.Test.Utils(TestPact5CommandResult) +import Chainweb.Test.Utils import Chainweb.Time import Chainweb.Utils import Chainweb.Utils.Serialization (runGetS, runPutS) diff --git a/test/unit/Chainweb/Test/Pact5/PactServiceTest.hs b/test/unit/Chainweb/Test/Pact5/PactServiceTest.hs index e303724ad9..44c617f1a7 100644 --- a/test/unit/Chainweb/Test/Pact5/PactServiceTest.hs +++ b/test/unit/Chainweb/Test/Pact5/PactServiceTest.hs @@ -45,7 +45,7 @@ import Chainweb.Payload import Chainweb.Storage.Table.RocksDB import Chainweb.Test.Cut.TestBlockDb (TestBlockDb (_bdbPayloadDb, _bdbWebBlockHeaderDb), addTestBlockDb, getCutTestBlockDb, getParentTestBlockDb, mkTestBlockDb, setCutTestBlockDb) import Chainweb.Test.Pact5.CmdBuilder -import Chainweb.Test.Pact5.Utils hiding (withTempSQLiteResource, testRocksDb) +import Chainweb.Test.Pact5.Utils hiding (withTempSQLiteResource) import Chainweb.Test.TestVersions import Chainweb.Test.Utils import Chainweb.Time @@ -94,7 +94,7 @@ data Fixture = Fixture mkFixtureWith :: PactServiceConfig -> RocksDb -> ResourceT IO Fixture mkFixtureWith pactServiceConfig baseRdb = do sqlite <- withTempSQLiteResource - tdb <- liftIO $ mkTestBlockDb v =<< testRocksDb "fixture" baseRdb + tdb <- mkTestBlockDb v baseRdb perChain <- iforM (HashSet.toMap (chainIds v)) $ \chain () -> do bhdb <- liftIO $ getWebBlockHeaderDb (_bdbWebBlockHeaderDb tdb) chain pactQueue <- liftIO $ newPactQueue 2_000 diff --git a/test/unit/Chainweb/Test/Pact5/TransactionExecTest.hs b/test/unit/Chainweb/Test/Pact5/TransactionExecTest.hs index 091c1c6cfb..5b06e943b2 100644 --- a/test/unit/Chainweb/Test/Pact5/TransactionExecTest.hs +++ b/test/unit/Chainweb/Test/Pact5/TransactionExecTest.hs @@ -47,7 +47,7 @@ import Data.String (fromString) import Data.Text qualified as T import Data.Text.Encoding qualified as T import Data.Text.IO qualified as T -import Chainweb.Test.Pact5.Utils hiding (testRocksDb, withTempSQLiteResource) +import Chainweb.Test.Pact5.Utils hiding (withTempSQLiteResource) import GHC.Stack import Pact.Core.Capabilities import Pact.Core.Command.Types @@ -104,8 +104,8 @@ tests baseRdb = testGroup "Pact5 TransactionExecTest" readFromAfterGenesis :: ChainwebVersion -> RocksDb -> PactBlockM GenericLogger RocksDbTable a -> IO a readFromAfterGenesis ver rdb act = runResourceT $ do sql <- withTempSQLiteResource + tdb <- mkTestBlockDb ver rdb liftIO $ do - tdb <- mkTestBlockDb ver =<< testRocksDb "testBuyGasShouldTakeGasTokensFromTheTransactionSender" rdb bhdb <- getWebBlockHeaderDb (_bdbWebBlockHeaderDb tdb) cid logger <- testLogger T2 a _finalPactState <- withPactService ver cid logger Nothing bhdb (_bdbPayloadDb tdb) sql testPactServiceConfig $ do diff --git a/test/unit/ChainwebTests.hs b/test/unit/ChainwebTests.hs index 499d22be7d..751c05b6e7 100644 --- a/test/unit/ChainwebTests.hs +++ b/test/unit/ChainwebTests.hs @@ -127,11 +127,11 @@ pactTestSuite rdb = testGroup "Chainweb-Pact Tests" , Chainweb.Test.Pact4.DbCacheTest.tests , Chainweb.Test.Pact4.Checkpointer.tests - , Chainweb.Test.Pact4.PactMultiChainTest.tests -- BROKEN few tests + , Chainweb.Test.Pact4.PactMultiChainTest.tests rdb -- BROKEN few tests , Chainweb.Test.Pact4.PactSingleChainTest.tests rdb - , Chainweb.Test.Pact4.VerifierPluginTest.tests -- BROKEN + , Chainweb.Test.Pact4.VerifierPluginTest.tests rdb -- BROKEN , Chainweb.Test.Pact4.PactReplay.tests rdb , Chainweb.Test.Pact4.ModuleCacheOnRestart.tests rdb @@ -170,7 +170,7 @@ suite rdb = , Chainweb.Test.RestAPI.tests rdb , testGroup "SPV" [ Chainweb.Test.SPV.tests rdb - , Chainweb.Test.Pact4.SPV.tests + , Chainweb.Test.Pact4.SPV.tests rdb , Chainweb.Test.SPV.EventProof.properties ] , Chainweb.Test.Mempool.InMem.tests