@@ -42,7 +42,7 @@ import Hydra.Options (defaultContestationPeriod)
42
42
import Hydra.Party (Party , deriveParty )
43
43
import Hydra.Persistence (PersistenceIncremental (.. ), eventPairFromPersistenceIncremental )
44
44
import Test.Hydra.Fixture (alice , aliceSk , bob , bobSk , carol , carolSk , cperiod , deriveOnChainId , testEnvironment , testHeadId , testHeadSeed )
45
- import Test.QuickCheck (classify , counterexample , elements , forAllBlind , forAllShrink , forAllShrinkBlind , idempotentIOProperty , listOf , listOf1 , (==>) )
45
+ import Test.QuickCheck (classify , counterexample , elements , forAllBlind , forAllShrink , forAllShrinkBlind , idempotentIOProperty , listOf , listOf1 , resize , (==>) )
46
46
import Test.Util (isStrictlyMonotonic )
47
47
48
48
spec :: Spec
@@ -112,16 +112,19 @@ spec = parallel $ do
112
112
getMockSinkEvents2 `shouldReturn` events
113
113
114
114
it " event ids are strictly monotonic" $ \ dryNode -> do
115
- forAllShrinkBlind arbitrary shrink $ \ someInputs ->
115
+ -- NOTE: Arbitrary inputs in open head state results more likely in
116
+ -- multiple state change events per input (during tx processing).
117
+ let genInputs = do
118
+ -- Resize to reducing complexity of additional input contents
119
+ someInput <- resize 1 arbitrary
120
+ pure $ inputsToOpenHead <> [someInput]
121
+
122
+ forAllShrinkBlind genInputs shrink $ \ someInputs ->
116
123
idempotentIOProperty $ do
117
124
(sink, getSinkEvents) <- createRecordingSink
118
-
119
125
hydrate (mockSource [] ) [sink] dryNode
120
126
>>= notConnect
121
- -- NOTE: Arbitrary inputs in open head state results more likely
122
- -- in multiple state change events per input (during tx
123
- -- processing).
124
- >>= primeWith (inputsToOpenHead <> someInputs)
127
+ >>= primeWith someInputs
125
128
>>= runToCompletion
126
129
127
130
events <- getSinkEvents
@@ -131,7 +134,7 @@ spec = parallel $ do
131
134
& counterexample " Not strictly monotonic"
132
135
& counterexample (" Event ids: " <> show eventIds)
133
136
& counterexample (" Events: " <> show events)
134
- & counterexample (" Additional inputs : " <> show someInputs)
137
+ & counterexample (" Inputs : " <> show someInputs)
135
138
& classify (null eventIds) " empty list of events"
136
139
137
140
it " can continue after re-hydration" $ \ dryNode ->
0 commit comments