Perhaps it'd be useful to move `freeLocks` from tests to the main module,
as this functionality will be needed anyway if the daemon detects a client
has died and needs to purge all its locks.

Otherwise LGTM (including the interdiff).


On Tue, Feb 18, 2014 at 5:23 PM, Klaus Aehlig <[email protected]> wrote:

>
> As discussed offline, I'd like to include an interdiff, to make
> the code more portable.
>
> commit cd01fc6ded34e14a83f48843a6720aaafd9f11ca
> Author: Klaus Aehlig <[email protected]>
> Date:   Tue Feb 18 17:09:34 2014 +0100
>
>     Interdiff [PATCH master 06/10] Verify that the set of blocking owners
> is big enough
>
>     Prefer Data.Foldable.foldl over Data.Set.foldl and Data.Set.fold, as
> the first is
>     not available on older Haskell versions (as on debian squeeze) and the
> latter
>     is already announced to be removed.
>
> diff --git a/test/hs/Test/Ganeti/Locking/Allocation.hs
> b/test/hs/Test/Ganeti/Locking/Allocation.hs
> index b5209fc..fb271a2 100644
> --- a/test/hs/Test/Ganeti/Locking/Allocation.hs
> +++ b/test/hs/Test/Ganeti/Locking/Allocation.hs
> @@ -29,6 +29,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor,
> Boston, MA
>  module Test.Ganeti.Locking.Allocation (testLocking_Allocation) where
>
>  import Control.Applicative
> +import qualified Data.Foldable as F
>  import qualified Data.Map as M
>  import qualified Data.Set as S
>
> @@ -186,7 +187,7 @@ prop_BlockSufficient =
>    let (_, result) = updateLocks a request state
>        blockedOn = genericResult (const S.empty) id result
>    in  printTestCase "After all blockers release, a request must succeed"
> -      . isOk . snd . updateLocks a request $ S.foldl freeLocks state
> blockedOn
> +      . isOk . snd . updateLocks a request $ F.foldl freeLocks state
> blockedOn
>
>  testSuite "Locking/Allocation"
>   [ 'prop_LocksDisjoint
>
>
> --
> Klaus Aehlig
> Google Germany GmbH, Dienerstr. 12, 80331 Muenchen
> Registergericht und -nummer: Hamburg, HRB 86891
> Sitz der Gesellschaft: Hamburg
> Geschaeftsfuehrer: Graham Law, Christine Elizabeth Flores
>

Reply via email to