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
150774: asim: run no_rand tests in parallel r=tbg a=tbg
Each simulation is single-threaded, so it makes sense to evaluate different
testfiles in parallel.
A complication is that each simulation logs using our default logging library,
and since that is a singleton, we can't provide each simulation with its own
logger. When a subtest is a parallel test (as is the case here), it waits for
the parent test to return before running. This means that the `log.Scope` in
`TestDataDriven` would be cleaned up by the time the parallel subtests would
actually start simulating.
I introduced a refcounting version of `log.Scope` instead, so the scope will
be closed only when the refcount drops to zero. Each subtest will log the
scope it's using, so the logs can be found, and should then be filtered by
the log tag which is specific to the simulation of interest.
```
./dev test pkg/kv/kvserver/asim/tests -f 'TestDataDriven' --ignore-cache --rewrite -v -- --test_env COCKROACH_RUN_ASIM_TESTS=true
//pkg/kv/kvserver/asim/tests:tests_test PASSED in 202.1s # before
//pkg/kv/kvserver/asim/tests:tests_test PASSED in 60.6s # after
```
Epic: CRDB-25222
Co-authored-by: Tobias Grieger <[email protected]>
0 commit comments