Skip to content

Commit 3c5e4ad

Browse files
craig[bot]mgartner
andcommitted
Merge #130412
130412: opt: make invalid isolation error more readable in tests r=mgartner a=mgartner The error message when using an invalid `isolation` option in an opt test now prints a more readable message. It previously read: invalid isolation level (must be found in map[ReadCommitted:2 Serializable:0 Snapshot:1]): foo And it now reads: invalid isolation level "foo", must be one of [Serializable Snapshot ReadCommitted] Release note: None Co-authored-by: Marcus Gartner <[email protected]>
2 parents 0bd3b44 + e5c6e14 commit 3c5e4ad

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkg/sql/opt/testutils/opttester/opt_tester.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1164,7 +1164,7 @@ func (f *Flags) Set(arg datadriven.CmdArg) error {
11641164
level, ok := isolation.Level_value[arg.Vals[0]]
11651165
if !ok {
11661166
return fmt.Errorf(
1167-
"invalid isolation level (must be found in %v): %v", isolation.Level_value, arg.Vals[0],
1167+
"invalid isolation level %q, must be one of %s", arg.Vals[0], isolation.Levels(),
11681168
)
11691169
}
11701170
f.TxnIsoLevel = isolation.Level(level)

0 commit comments

Comments
 (0)