Skip to content

Commit 6cf7f51

Browse files
committed
Re-enable the DL example, but make it a very small example
1 parent ee6448f commit 6cf7f51

File tree

1 file changed

+6
-11
lines changed
  • test/Test/Database/LSMTree/Normal/StateMachine

1 file changed

+6
-11
lines changed

test/Test/Database/LSMTree/Normal/StateMachine/DL.hs

+6-11
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,14 @@ import qualified Test.QuickCheck.Gen as QC
2020
import qualified Test.QuickCheck.Random as QC
2121
import Test.QuickCheck.StateModel.Lockstep
2222
import Test.Tasty (TestTree, testGroup)
23+
import qualified Test.Tasty.QuickCheck as QC
2324
import Test.Util.PrettyProxy
2425

2526
tests :: TestTree
2627
tests = testGroup "Test.Database.LSMTree.Normal.StateMachine.DL" [
27-
-- This one is not actually enabled, because it runs for rather a long time
28-
-- and it's not in itself a very import property.
29-
-- QC.testProperty "prop_example" prop_example
28+
29+
QC.testProperty "prop_example" prop_example
3030
]
31-
where
32-
_unused = prop_example
3331

3432
instance DynLogicModel (Lockstep (ModelState R.Table))
3533

@@ -52,22 +50,21 @@ prop_example =
5250
-- instead
5351
tr = nullTracer
5452

55-
-- | Create an initial "large" table, and then proceed with random actions as
56-
-- usual.
53+
-- | Create an initial "large" table
5754
dl_example :: DL (Lockstep (ModelState R.Table)) ()
5855
dl_example = do
5956
-- Create an initial table and fill it with some inserts
6057
var3 <- action $ New (PrettyProxy @((Key, Value, Blob))) (TableConfig {
6158
confMergePolicy = MergePolicyLazyLevelling
6259
, confSizeRatio = Four
63-
, confWriteBufferAlloc = AllocNumEntries (NumEntries 30)
60+
, confWriteBufferAlloc = AllocNumEntries (NumEntries 4)
6461
, confBloomFilterAlloc = AllocFixed 10
6562
, confFencePointerIndex = CompactIndex
6663
, confDiskCachePolicy = DiskCacheNone
6764
, confMergeSchedule = OneShot })
6865
let kvs :: Map.Map Key Value
6966
kvs = Map.fromList $
70-
QC.unGen (QC.vectorOf 678 $ (,) <$> QC.arbitrary <*> QC.arbitrary)
67+
QC.unGen (QC.vectorOf 37 $ (,) <$> QC.arbitrary <*> QC.arbitrary)
7168
(QC.mkQCGen 42) 30
7269
ups :: V.Vector (Key, Update Value Blob)
7370
ups = V.fromList
@@ -84,5 +81,3 @@ dl_example = do
8481
| Just tbl <- (Model.fromSomeTable @Key @Value @Blob smTbl)
8582
-> Map.size (Model.values tbl) == Map.size kvs
8683
_ -> False
87-
-- Perform any sequence of actions after
88-
anyActions_

0 commit comments

Comments
 (0)