@@ -50,6 +50,7 @@ import Data.Map.Strict (Map)
50
50
import qualified Data.Map.Strict as Map
51
51
import qualified Data.SOP.Dict as Dict
52
52
import Data.Word
53
+ import qualified Debug.Trace as Debug
53
54
import Ouroboros.Consensus.Block
54
55
import Ouroboros.Consensus.Config
55
56
import Ouroboros.Consensus.Ledger.Abstract
@@ -598,7 +599,6 @@ instance RunModel Model (StateT Environment IO) where
598
599
Environment _ _ chainDb mkArgs fs _ cleanup rr <- get
599
600
(ldb, testInternals, getNumOpenHandles) <- lift $ do
600
601
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
602
602
openLedgerDB (argFlavorArgs args) chainDb (argLedgerDbCfg args) fs rr
603
603
put (Environment ldb testInternals chainDb mkArgs fs getNumOpenHandles cleanup rr)
604
604
perform _ WipeLedgerDB _ = do
@@ -631,7 +631,6 @@ instance RunModel Model (StateT Environment IO) where
631
631
Environment _ testInternals chainDb _ _ _ _ _ <- get
632
632
lift $ do
633
633
atomically $ modifyTVar (dbChain chainDb) (drop (fromIntegral n))
634
- -- blahblahblah
635
634
closeLedgerDB testInternals
636
635
perform state (Init secParam salt) lk
637
636
perform _ OpenAndCloseForker _ = do
@@ -677,6 +676,22 @@ instance RunModel Model (StateT Environment IO) where
677
676
pure $ volSt == vol && immSt == imm
678
677
postcondition _ _ _ _ = pure True
679
678
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
+
680
695
{- ------------------------------------------------------------------------------
681
696
Additional checks
682
697
-------------------------------------------------------------------------------}
0 commit comments