55
66module Test.ScheduledMergesQLS (tests ) where
77
8- import Control.Monad (void )
98import Control.Monad.ST
109import Control.Tracer (Tracer , nullTracer )
1110import Data.Constraint (Dict (.. ))
@@ -19,44 +18,18 @@ import Prelude hiding (lookup)
1918import ScheduledMerges as LSM
2019
2120import Test.QuickCheck
22- import qualified Test.QuickCheck.DynamicLogic as DL
2321import Test.QuickCheck.StateModel hiding (lookUpVar )
2422import Test.QuickCheck.StateModel.Lockstep hiding (ModelOp )
2523import qualified Test.QuickCheck.StateModel.Lockstep.Defaults as Lockstep
26- import Test.QuickCheck.StateModel.Lockstep.Op.Identity (Op (OpId ))
2724import qualified Test.QuickCheck.StateModel.Lockstep.Run as Lockstep
2825import Test.Tasty
2926import Test.Tasty.QuickCheck (testProperty )
3027
3128tests :: TestTree
3229tests = testGroup " Test.ScheduledMergesQLS" [
3330 testProperty " ScheduledMerges vs model" $ mapSize (* 10 ) prop_LSM -- still <10s
34- , testProperty " propRegression_issue755" $
35- let scenario = do
36- var1 <- DL. action $ ANew (LSMConfig {configMaxWriteBufferSize = 1 , configSizeRatio = 2 })
37- void $ DL. action $ AInsert (unsafeMkGVar var1 OpId ) (Right (K 0 )) (V 0 ) Nothing
38- var16 <- DL. action $ AUnions [unsafeMkGVar var1 OpId ]
39- void $ DL. action $ AInsert (unsafeMkGVar var16 OpId ) (Right (K 0 )) (V 0 ) Nothing
40- void $ DL. action $ AInsert (unsafeMkGVar var16 OpId ) (Right (K 1 )) (V 0 ) Nothing
41- void $ DL. action $ AInsert (unsafeMkGVar var16 OpId ) (Right (K 0 )) (V 0 ) Nothing
42- void $ DL. action $ AInsert (unsafeMkGVar var16 OpId ) (Right (K 0 )) (V 0 ) Nothing
43- void $ DL. action $ AInsert (unsafeMkGVar var16 OpId ) (Right (K 1 )) (V 0 ) Nothing
44- void $ DL. action $ AInsert (unsafeMkGVar var16 OpId ) (Right (K 2 )) (V 0 ) Nothing
45- void $ DL. action $ AInsert (unsafeMkGVar var16 OpId ) (Right (K 0 )) (V 0 ) Nothing
46- void $ DL. action $ AInsert (unsafeMkGVar var16 OpId ) (Right (K 0 )) (V 0 ) Nothing
47- void $ DL. action $ AInsert (unsafeMkGVar var16 OpId ) (Right (K 0 )) (V 0 ) Nothing
48- in DL. forAllDL scenario prop_LSM
49- {-
50- The scenario above is a manually modified version of output produced by:
51-
52- cabal run prototypes-test -- \
53- --quickcheck-replay="(SMGen 3702524042292853426 14344574976030159473,92)" \
54- -p '/ScheduledMerges vs model/'
55- -}
5631 ]
5732
58- instance DL. DynLogicModel (Lockstep Model ) where
59-
6033-- TODO: add tagging, e.g. how often ASupplyUnion makes progress or completes a
6134-- union merge.
6235prop_LSM :: Actions (Lockstep Model ) -> Property
0 commit comments