asim: better outputs for data-driven tests#108059
asim: better outputs for data-driven tests#108059craig[bot] merged 2 commits intocockroachdb:masterfrom
Conversation
25834f0 to
0718940
Compare
f5c485f to
4e8902f
Compare
c9fd0b7 to
4e8902f
Compare
6ce66c1 to
0bc7449
Compare
234a481 to
ac5e103
Compare
kvoli
left a comment
There was a problem hiding this comment.
A couple non-blocking questions.
Reviewed 2 of 2 files at r1, 16 of 16 files at r2, all commit messages.
Reviewable status:complete! 0 of 0 LGTMs obtained (waiting on @wenyihu6)
pkg/kv/kvserver/asim/gen/generator.go line 121 at r2 (raw file):
func (bl BasicLoad) String() string { return fmt.Sprintf("basic load with rw_ratio=%0.2f, rate=%0.2f, skewed_access=%t, min_block_size=%d, max_block_size=%d, min_key=%d, max_key=%d", bl.RWRatio, bl.Rate, bl.SkewedAccess, bl.MinBlockSize, bl.MaxBlockSize, bl.MinKey, bl.MaxKey)
nit: truncate to 80 chars
pkg/kv/kvserver/asim/state/state.go line 60 at r2 (raw file):
// PrettyPrint returns a pretty formatted string representation of the // state (more concise than String()). PrettyPrint() string
nit: perhaps CompactPrint?
pkg/kv/kvserver/asim/tests/output.go line 27 at r2 (raw file):
const ( // OutputResultOnly only shows whether the test passed or failed, along with
Was there a compelling reason to use a bitset, instead of a struct?
pkg/kv/kvserver/asim/tests/testdata/rand/rand_ranges line 136 at r2 (raw file):
# factor of 1. Assertion failures on some samples are expected due to this # factor. When there is only one replica, the removal target in rebalancing is a # leaseholder, it is locked into the current replica distribution. The
Could you clarify "it is locked into the current replica distribution"?
pkg/kv/kvserver/asim/tests/testdata/rand/rand_ranges line 138 at r2 (raw file):
# leaseholder, it is locked into the current replica distribution. The # rebalancer falls back to adding one replica, hoping the rebalancing would # happen next time this range is checked. This can case thrashing where settling
nit: cause
ac5e103 to
2002222
Compare
|
Previously, kvoli (Austen) wrote…
I feel |
|
Previously, kvoli (Austen) wrote…
If we use structs here, we would need to create a boolean field for each flag and explicitly checking each field's boolean value. I think using bitset here achieves the same goal but in a cleaner and more efficient way. |
bb8984c to
849496a
Compare
|
Previously, kvoli (Austen) wrote…
Done. |
448c0f0 to
27e9bd4
Compare
Previously, the simulator iterates over an unordered map when formatting and printing states, stores, and ranges, resulting in non-deterministic output. This patch addresses the issue by sorting the maps by key before printing and formatting. Release note: none Epic: none
Previously, the randomized testing framework's output only indicates whether
each iteration passes. This lack of of detail makes checking the randomized
framework and debugging challenging. This patch adds more info to the output,
including the selected configurations, the initial state of each simulation.
Additionally, this patch removes the verbosity flag for printing history plots
as it does not seem to have any practical use cases.
New verbosity flags for eval are now supported.
```
"eval"
[verbose=(<[]("result_only","test_settings","initial_state","config_gen","topology","all")>)]
- verbose(default value is OutputResultOnly): used to set flags on what to
show in the test output messages. By default, all details are displayed
upon assertion failure.
- result_only: only shows whether the test passed or failed, along with
any failure messages
- test_settings: displays settings used for the repeated tests
- initial_state: displays the initial state of each test iteration
- config_gen: displays the input configurations generated for each test
iteration
- topology: displays the topology of cluster configurations
- all: displays everything above
```
Part Of: [cockroachdb#106311](https://github.com/kvoli/cockroach/issues/106311)
Release Note: none
(cherry picked from commit 27e9bd438a6ef1f6f0ed7205d91f28c9b54fd314)
27e9bd4 to
2385787
Compare
|
After the PR approval, I did two smaller changes 1. Renamed |
|
TFTR! bors r=kvoli |
|
Build succeeded: |
asim: sort before iterating over maps when printing
Previously, the simulator iterates over an unordered map when formatting and
printing states, stores, and ranges, resulting in non-deterministic output. This
patch addresses the issue by sorting the maps by key before printing and
formatting.
Release note: none
Epic: none
asim: better outputs for data-driven tests
Previously, the randomized testing framework's output only indicates whether
each iteration passes. This lack of of detail makes checking the randomized
framework and debugging challenging. This patch adds more info to the output,
including the selected configurations, the initial state of each simulation.
Additionally, this patch removes the verbosity flag for printing history plots
as it does not seem to have any practical use cases.
New verbosity flags for eval are now supported.
Part Of: #106311
Release Note: none