Harden mutation admission and storage observation
This commit is contained in:
parent
435d4fea4c
commit
1b1d8b06c7
1 changed files with 969 additions and 461 deletions
15
test/Spec.hs
15
test/Spec.hs
|
|
@ -108,6 +108,21 @@ protocolTests = testGroup "mutation protocol decisions"
|
|||
[ testProperty "request fingerprints distinguish every bound field" propFingerprintDistinction
|
||||
, testProperty "quota growth and admission preserve the limit" propQuotaInvariant
|
||||
, testProperty "object observations match the independent classifier" propObservations
|
||||
, testCase "unavailable observations match no terminal state" $ do
|
||||
let rec = sampleMutation Put (ObjectKey "shared/file") 10
|
||||
(Just (ContentSha256 "desired"))
|
||||
observation = ObjectUnavailable "timeout"
|
||||
desiredMatches rec observation @?= False
|
||||
priorMatches rec observation @?= False
|
||||
, testCase "ambiguous same-size content matches no terminal state" $ do
|
||||
let rec = (sampleMutation Put (ObjectKey "shared/file") 10
|
||||
(Just (ContentSha256 "desired")))
|
||||
{ mrPriorSize = 10
|
||||
, mrPriorSha256 = Just (ContentSha256 "prior")
|
||||
}
|
||||
observation = ObjectPresent 10 (Just (ContentSha256 "other"))
|
||||
desiredMatches rec observation @?= False
|
||||
priorMatches rec observation @?= False
|
||||
, testProperty "only settled terminal records are expiry eligible" propExpiryEligibility
|
||||
, testProperty "only stale active records are recovery eligible" propRecoveryTiming
|
||||
]
|
||||
|
|
|
|||
Loading…
Reference in a new issue