util/must: improve Expensive
build tag gating
#107425
Labels
A-testing
Testing tools and infrastructure
C-enhancement
Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)
T-testeng
TestEng Team
In #106508,
must.Expensive()
assertions are gated on therace
build tag viautil.RaceEnabled
. We should reconsider this. Some considerations:They should not be enabled in any binaries by default.
They should be possible to enable when building binaries.
They should never be enabled in benchmarks (neither roachperf nor go bench).
They should be enabled in as many tests as possible.
They may cause timing-sensitive tests to flake. If they do, we must be able to skip certain tests under expensive assertions, similarly to
skip.UnderRace
andskip.UnderDeadlock
.Pebble's invariant assertions should be enabled via the same mechanism. They are currently gated on
invariants
orrace
build tags.We may need two degrees of expensive assertions (moderate and very), similarly to how we currently gate some on
crdb_test
and others onrace
.Some options:
Gate them on
crdb_test
, currently used for all Go tests.crdb_test
(they would never run). But maybe it won't be needed.crdb_test
? If so, can we use them in roachtests?Gate them on
invariants
, a new tag for CRDB, but already used by Pebble. Would need a new nightly run (possibly both for Go tests and roachtests).Gate them on
race
, currently used for Go tests under race detector.race
.race
builds, where many tests are skipped, and can't be used in roachtests.I think I'm leaning towards trying 1 first, and if it doesn't work because too many timing-sensitive tests start flaking, do 2. To determine this quickly, we can enable Pebble's invariant tests under
crdb_test
, and useExpensive
for some of the most expensive assertions in our hottest code paths (e.g. MVCC iterators).Jira issue: CRDB-30035
The text was updated successfully, but these errors were encountered: