Skip to content

Commit

Permalink
Decrease coverage requirement in UTxOIndexSpec
Browse files Browse the repository at this point in the history
Has been failing twice recently. Latest failure was

Failures:

 test/unit/Cardano/Wallet/Primitive/Types/UTxOIndexSpec.hs:146:9:
 1) Cardano.Wallet.Primitive.Types.UTxOIndex, Indexed UTxO set properties, Index Selection, prop_selectRandom_one_withAsset
 Insufficient coverage (after 800 tests):
 89.5% index has more than one asset
 71.1% index has the specified asset
 71.1% selected an entry

 Only 71.1% index has the specified asset, but expected 80.0%
 Only 71.1% selected an entry, but expected 80.0%

 To rerun use: --match "/Cardano.Wallet.Primitive.Types.UTxOIndex/Indexed UTxO set properties/Index Selection/prop_selectRandom_one_withAsset/"

 test/unit/Cardano/Wallet/Primitive/Types/UTxOIndexSpec.hs:148:9:
 2) Cardano.Wallet.Primitive.Types.UTxOIndex, Indexed UTxO set properties, Index Selection, prop_selectRandom_one_withAssetOnly
 Insufficient coverage (after 800 tests):
 89.5% index has more than one asset
 71.1% index has the specified asset
 22.5% selected an entry

 Only 71.1% index has the specified asset, but expected 80.0%

 To rerun use: --match "/Cardano.Wallet.Primitive.Types.UTxOIndex/Indexed UTxO set properties/Index Selection/prop_selectRandom_one_withAssetOnly/"

 test/unit/Cardano/Wallet/Primitive/Types/UTxOIndexSpec.hs:154:9:
 3) Cardano.Wallet.Primitive.Types.UTxOIndex, Indexed UTxO set properties, Index Selection, prop_selectRandom_all_withAsset
 Insufficient coverage (after 800 tests):
 89.5% index has more than one asset
 71.1% index has the specified asset
 71.1% selected at least one entry

 Only 71.1% index has the specified asset, but expected 80.0%
 Only 71.1% selected at least one entry, but expected 80.0%

 To rerun use: --match "/Cardano.Wallet.Primitive.Types.UTxOIndex/Indexed UTxO set properties/Index Selection/prop_selectRandom_all_withAsset/"

 test/unit/Cardano/Wallet/Primitive/Types/UTxOIndexSpec.hs:156:9:
 4) Cardano.Wallet.Primitive.Types.UTxOIndex, Indexed UTxO set properties, Index Selection, prop_selectRandom_all_withAssetOnly
 Insufficient coverage (after 800 tests):
 89.5% index has more than one asset
 71.1% index has the specified asset
 22.5% selected at least one entry

 Only 71.1% index has the specified asset, but expected 80.0%

 To rerun use: --match "/Cardano.Wallet.Primitive.Types.UTxOIndex/Indexed UTxO set properties/Index Selection/prop_selectRandom_all_withAssetOnly/"
  • Loading branch information
Anviking committed Apr 1, 2021
1 parent 7df3079 commit d4c29e2
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions lib/core/test/unit/Cardano/Wallet/Primitive/Types/UTxOIndexSpec.hs
Original file line number Diff line number Diff line change
Expand Up @@ -427,11 +427,11 @@ prop_selectRandom_one_withAdaOnly u = checkCoverage $ monadicIO $ do
prop_selectRandom_one_withAsset :: UTxOIndex -> AssetId -> Property
prop_selectRandom_one_withAsset u a = checkCoverage $ monadicIO $ do
result <- run $ UTxOIndex.selectRandom u (WithAsset a)
monitor $ cover 80 (a `Set.member` UTxOIndex.assets u)
monitor $ cover 70 (a `Set.member` UTxOIndex.assets u)
"index has the specified asset"
monitor $ cover 80 (Set.size (UTxOIndex.assets u) > 1)
monitor $ cover 70 (Set.size (UTxOIndex.assets u) > 1)
"index has more than one asset"
monitor $ cover 80 (isJust result)
monitor $ cover 70 (isJust result)
"selected an entry"
case result of
Nothing ->
Expand All @@ -453,9 +453,9 @@ prop_selectRandom_one_withAsset u a = checkCoverage $ monadicIO $ do
prop_selectRandom_one_withAssetOnly :: UTxOIndex -> AssetId -> Property
prop_selectRandom_one_withAssetOnly u a = checkCoverage $ monadicIO $ do
result <- run $ UTxOIndex.selectRandom u (WithAssetOnly a)
monitor $ cover 80 (a `Set.member` UTxOIndex.assets u)
monitor $ cover 70 (a `Set.member` UTxOIndex.assets u)
"index has the specified asset"
monitor $ cover 80 (Set.size (UTxOIndex.assets u) > 1)
monitor $ cover 70 (Set.size (UTxOIndex.assets u) > 1)
"index has more than one asset"
monitor $ cover 20 (isJust result)
"selected an entry"
Expand Down Expand Up @@ -491,7 +491,7 @@ prop_selectRandom_all_any u = checkCoverage $ monadicIO $ do
prop_selectRandom_all_withAdaOnly :: UTxOIndex -> Property
prop_selectRandom_all_withAdaOnly u = checkCoverage $ monadicIO $ do
(selectedEntries, u') <- run $ selectAll WithAdaOnly u
monitor $ cover 80 (not (null selectedEntries))
monitor $ cover 70 (not (null selectedEntries))
"selected at least one entry"
assert $ L.all (\(_, o) -> not (txOutIsAdaOnly o)) (UTxOIndex.toList u')
assert $ L.all (\(_, o) -> txOutIsAdaOnly o) selectedEntries
Expand All @@ -503,11 +503,11 @@ prop_selectRandom_all_withAdaOnly u = checkCoverage $ monadicIO $ do
prop_selectRandom_all_withAsset :: UTxOIndex -> AssetId -> Property
prop_selectRandom_all_withAsset u a = checkCoverage $ monadicIO $ do
(selectedEntries, u') <- run $ selectAll (WithAsset a) u
monitor $ cover 80 (a `Set.member` UTxOIndex.assets u)
monitor $ cover 70 (a `Set.member` UTxOIndex.assets u)
"index has the specified asset"
monitor $ cover 80 (Set.size (UTxOIndex.assets u) > 1)
monitor $ cover 70 (Set.size (UTxOIndex.assets u) > 1)
"index has more than one asset"
monitor $ cover 80 (not (null selectedEntries))
monitor $ cover 70 (not (null selectedEntries))
"selected at least one entry"
assert $ L.all (\(_, o) -> not (txOutHasAsset o a)) (UTxOIndex.toList u')
assert $ L.all (\(_, o) -> txOutHasAsset o a) selectedEntries
Expand All @@ -520,9 +520,9 @@ prop_selectRandom_all_withAsset u a = checkCoverage $ monadicIO $ do
prop_selectRandom_all_withAssetOnly :: UTxOIndex -> AssetId -> Property
prop_selectRandom_all_withAssetOnly u a = checkCoverage $ monadicIO $ do
(selectedEntries, u') <- run $ selectAll (WithAssetOnly a) u
monitor $ cover 80 (a `Set.member` UTxOIndex.assets u)
monitor $ cover 70 (a `Set.member` UTxOIndex.assets u)
"index has the specified asset"
monitor $ cover 80 (Set.size (UTxOIndex.assets u) > 1)
monitor $ cover 70 (Set.size (UTxOIndex.assets u) > 1)
"index has more than one asset"
monitor $ cover 20 (not (null selectedEntries))
"selected at least one entry"
Expand Down

0 comments on commit d4c29e2

Please sign in to comment.