Skip to content

Commit 56024c6

Browse files
committed
QLS tests: label failing actions with the exception raised
Initial results: Actions that failed (409 in total): 35.0% ActionFail "Open" "MErr ErrSnapshotDoesNotExist" 10.3% ActionFail "DeleteSnapshot" "MErr ErrSnapshotDoesNotExist" 7.1% ActionFail "Inserts" "MErr ErrTableHandleClosed" 6.8% ActionFail "Deletes" "MErr ErrTableHandleClosed" 6.8% ActionFail "Lookups" "MErr ErrTableHandleClosed" 6.1% ActionFail "RetrieveBlobs" "MErr ErrBlobRefInvalidated" 6.1% ActionFail "Updates" "MErr ErrTableHandleClosed" 5.4% ActionFail "ReadCursor" "MErr ErrCursorClosed" 3.9% ActionFail "Snapshot" "MErr ErrSnapshotExists" 3.4% ActionFail "RangeLookup" "MErr ErrTableHandleClosed" 3.2% ActionFail "Open" "MErr ErrSnapshotWrongType" 2.0% ActionFail "Duplicate" "MErr ErrTableHandleClosed" 2.0% ActionFail "NewCursor" "MErr ErrTableHandleClosed" 2.0% ActionFail "Snapshot" "MErr ErrTableHandleClosed" As we can see, each action has exactly one reason for failing. This shows clearly that we don't need a lot of coverage for these failures. The only non-trivial one is the blob refs becomming invalidated. Otherwise, there's no complex logic or state for any of these failures.
1 parent 1670b50 commit 56024c6

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

test/Test/Database/LSMTree/Normal/StateMachine.hs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1314,7 +1314,7 @@ data Stats = Stats {
13141314
-- | Actions that succeeded
13151315
, successActions :: [String]
13161316
-- | Actions that failed with an error
1317-
, failActions :: [String]
1317+
, failActions :: [(String, Model.Err)]
13181318
-- === Final tags (per action sequence, per table)
13191319
-- | Number of actions per table (succesful or failing)
13201320
, numActionsPerTable :: !(Map Model.TableHandleID Int)
@@ -1428,8 +1428,8 @@ updateStats action lookUp modelBefore _modelAfter result =
14281428
_ -> stats
14291429

14301430
updFailActions stats = case result of
1431-
MEither (Left _) -> stats {
1432-
failActions = actionName action : failActions stats
1431+
MEither (Left (MErr e)) -> stats {
1432+
failActions = (actionName action, e) : failActions stats
14331433
}
14341434
_ -> stats
14351435

@@ -1611,7 +1611,7 @@ data FinalTag =
16111611
-- | Which actions succeded
16121612
| ActionSuccess String
16131613
-- | Which actions failed
1614-
| ActionFail String
1614+
| ActionFail String Model.Err
16151615
-- | Total number of flushes
16161616
| NumFlushes String -- TODO: implement
16171617
-- | Number of table handles created (new, open or duplicate)
@@ -1664,8 +1664,8 @@ tagFinalState' (getModel -> ModelState finalState finalStats) = concat [
16641664
| c <- successActions finalStats ]
16651665

16661666
tagFailActions =
1667-
[ ("Actions that failed", [ActionFail c])
1668-
| c <- failActions finalStats ]
1667+
[ ("Actions that failed", [ActionFail c e])
1668+
| (c, e) <- failActions finalStats ]
16691669

16701670
tagNumTables =
16711671
[ ("Number of tables", [NumTables (showPowersOf 2 n)])

0 commit comments

Comments
 (0)