You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A recent change (#148576) causes some test initializations to throw a panic if
the binary was not build with `crdb_test`.
```
./dev bench pkg/sql/catalog/lease -f=BenchmarkAcquireLeaseConcurrent
$ bazel test pkg/sql/catalog/lease:all --nocache_test_results --test_arg -test.run=- --test_arg -test.bench=BenchmarkAcquireLeaseConcurrent --test_sharding_strategy=disabled --test_arg -test.cpu --test_arg 1 --test_arg -test.benchmem --crdb_test_off --test_env COCKROACH_TEST_FIXTURES_DIR=/Users/herko/Library/Caches/crdb-test-fixtures --sandbox_writable_path=/Users/herko/Library/Caches/crdb-test-fixtures --test_output streamed
panic: Testing override for schema_locked used in non-test binary.
goroutine 1 [running]:
github.com/cockroachdb/cockroach/pkg/sql.TestForceDisableCreateTableWithSchemaLocked(...)
pkg/sql/exec_util.go:773
github.com/cockroachdb/cockroach/pkg/sql/catalog/lease_test.TestMain(0x1400132e620?)
pkg/sql/catalog/lease/main_test.go:29 +0xcc
main.main()
```
This is problematic for benchmarks, which are not built with `crdb_test`.
Benchmarks are not built with the `crdb_test` flag, because this flag enables
metamorphic variables and extra assertions which could interfere with
performance testing.
This change adds a new `crdb_bench` flag, which is disabled by default. The
assertions added in #148576 is now also skipped when `crdb_bench` is enabled.
Informs: #148576Fixes: #149339
Epic: None
Release note: None
0 commit comments