Skip to content

Commit 467dfa9

Browse files
committed
Mention error involving drop and restore
1 parent 5db1b7c commit 467dfa9

File tree

1 file changed

+17
-2
lines changed
  • ouroboros-consensus/test/storage-test/Test/Ouroboros/Storage/LedgerDB

1 file changed

+17
-2
lines changed

ouroboros-consensus/test/storage-test/Test/Ouroboros/Storage/LedgerDB/StateMachine.hs

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ import Data.Map.Strict (Map)
5050
import qualified Data.Map.Strict as Map
5151
import qualified Data.SOP.Dict as Dict
5252
import Data.Word
53+
import qualified Debug.Trace as Debug
5354
import Ouroboros.Consensus.Block
5455
import Ouroboros.Consensus.Config
5556
import Ouroboros.Consensus.Ledger.Abstract
@@ -598,7 +599,6 @@ instance RunModel Model (StateT Environment IO) where
598599
Environment _ _ chainDb mkArgs fs _ cleanup rr <- get
599600
(ldb, testInternals, getNumOpenHandles) <- lift $ do
600601
let args = mkArgs secParam salt
601-
-- TODO after a drop and restore we restart the db but the session has been closed below where I wrote blahblahblah
602602
openLedgerDB (argFlavorArgs args) chainDb (argLedgerDbCfg args) fs rr
603603
put (Environment ldb testInternals chainDb mkArgs fs getNumOpenHandles cleanup rr)
604604
perform _ WipeLedgerDB _ = do
@@ -631,7 +631,6 @@ instance RunModel Model (StateT Environment IO) where
631631
Environment _ testInternals chainDb _ _ _ _ _ <- get
632632
lift $ do
633633
atomically $ modifyTVar (dbChain chainDb) (drop (fromIntegral n))
634-
-- blahblahblah
635634
closeLedgerDB testInternals
636635
perform state (Init secParam salt) lk
637636
perform _ OpenAndCloseForker _ = do
@@ -677,6 +676,22 @@ instance RunModel Model (StateT Environment IO) where
677676
pure $ volSt == vol && immSt == imm
678677
postcondition _ _ _ _ = pure True
679678

679+
{-
680+
681+
An error involving drop and restore:
682+
683+
*** Failed! Exception: 'ErrSessionClosed' (after 1 test and 5 shrinks):
684+
do action $ Init (SecurityParam (NonZero {unNonZero = 2})) 1698955
685+
action $ ValidateAndCommit 0 [TestBlockWith {tbHash = (testHashFromList [0]), tbSlot = SlotNo 1, tbValid = Valid, tbPayload = Tx {consumed = Token {unToken = Point Origin}, produced = (Token {unToken = Point (At (Block {blockPointSlot = SlotNo 1, blockPointHash = (testHashFromList [0])}))},TValue ())}}]
686+
action $ ValidateAndCommit 0 [TestBlockWith {tbHash = (testHashFromList [0,0]), tbSlot = SlotNo 2, tbValid = Valid, tbPayload = Tx {consumed = Token {unToken = Point (At (Block {blockPointSlot = SlotNo 1, blockPointHash = (testHashFromList [0])}))}, produced = (Token {unToken = Point (At (Block {blockPointSlot = SlotNo 2, blockPointHash = (testHashFromList [0,0])}))},TValue ())}},TestBlockWith {tbHash = (testHashFromList [0,0,0]), tbSlot = SlotNo 3, tbValid = Valid, tbPayload = Tx {consumed = Token {unToken = Point (At (Block {blockPointSlot = SlotNo 2, blockPointHash = (testHashFromList [0,0])}))}, produced = (Token {unToken = Point (At (Block {blockPointSlot = SlotNo 3, blockPointHash = (testHashFromList [0,0,0])}))},TValue ())}}]
687+
action $ ForceTakeSnapshot
688+
action $ DropAndRestore 4 1509061
689+
pure ()
690+
Use --quickcheck-replay="(SMGen 13015259844219613625 4264157041701000393,27)" to reproduce.
691+
692+
cabal run test:storage-test -- -p /LSM/ --quickcheck-replay="(SMGen 13015259844219613625 4264157041701000393,27)"
693+
-}
694+
680695
{-------------------------------------------------------------------------------
681696
Additional checks
682697
-------------------------------------------------------------------------------}

0 commit comments

Comments
 (0)