Commit 40d77fd
authored
LedgerDB.StateMachine test: actually test rollbacks (#1576)
This PR fixes a bug in the LedgerDB state machine test that caused us to
never generate non-trivial rollbacks, only chain extensions.
The first commit adds appropriate command labelling, demonstrating the
problem:
```
Rollback depths (526356 in total):
100.0000% 0
```
The second commit fixes the bug causing this: The precondition is
overzeleaos, so all generated `ValidateAndCommit` actions that have a
positive rollback are rejected:
```
Actions rejected by precondition (584429 in total):
100.0000% ValidateAndCommit
```
The third commit fixes a trivial bug in the testing infrastructure where
rollbacks were not accounted for.
With this PR, we now get a variety or rollback depths:
```
Rollback depths (898533 in total):
44.2447% 0
25.9243% 1
14.6631% 2
7.9446% 3
4.3239% 4
2.1126% 5
0.7868% 6
```File tree
1 file changed
+9
-2
lines changed- ouroboros-consensus/test/storage-test/Test/Ouroboros/Storage/LedgerDB
1 file changed
+9
-2
lines changedLines changed: 9 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
365 | 365 | | |
366 | 366 | | |
367 | 367 | | |
368 | | - | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
369 | 371 | | |
370 | 372 | | |
371 | 373 | | |
| |||
551 | 553 | | |
552 | 554 | | |
553 | 555 | | |
554 | | - | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
555 | 559 | | |
556 | 560 | | |
557 | 561 | | |
| |||
567 | 571 | | |
568 | 572 | | |
569 | 573 | | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
570 | 577 | | |
571 | 578 | | |
572 | 579 | | |
| |||
0 commit comments