Commit 2dcbfddb authored by Klaus Aehlig's avatar Klaus Aehlig
Browse files

Verify that some progress is made after lock releases

Add a basic sanity check for progress on pending requests. If a
request is pending and all owners it is blocked on release their
locks, there is at least one pending request that can be granted
(the said one). So verify that at least one owner gets notified
of the granting of his request.
Signed-off-by: default avatarKlaus Aehlig <>
Reviewed-by: default avatarPetr Pudlak <>
parent bdb272a6
......@@ -174,9 +174,26 @@ prop_PendingGetNotifiedEventually =
\ resources, a pending owner must be notified"
$ S.member owner notified
-- | Verify that some progress is made after the direct blockers give up their
-- locks. Note that we cannot guarantee that the original requester gets its
-- request granted, as someone else might have a more important priority.
prop_Progress :: Property
prop_Progress =
forAllBlocked $ \state owner prio req ->
let (state', (resultBlockers, _)) = updateLocksWaiting prio owner req state
blockers = genericResult (const S.empty) id resultBlockers
releaseOneOwner (s, tonotify) o =
let (s', newnotify) = releaseResources o s
in (s', newnotify `S.union` tonotify)
(_, notified) = S.foldl releaseOneOwner (state', S.empty) blockers
in printTestCase "Some progress must be made after all blockers release\
\ their locks"
. not $ S.null notified
testSuite "Locking/Waiting"
[ 'prop_NoActionWithPendingRequests
, 'prop_WaitingRequestsGetPending
, 'prop_PendingGetFulfilledEventually
, 'prop_PendingGetNotifiedEventually
, 'prop_Progress
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment