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
While debugging #540, I realized that I was running cargo test from two different clones of omicron with the same value of $TMPDIR in my environment, and that they could totally stomp on each other if one of their "build" steps initialized $TMPDIR/crdb-base while the other one's test suite was running trying to create a new database directory from that directory.
If we move the seed directory to ./target, it will at least be scoped to one local clone of Omicron.
The text was updated successfully, but these errors were encountered:
This new behavior abides by the rules for generating output from a build script, by using the OUT_DIR path available at compile-time.
To ensure that the OUT_DIR path is available to the build script and invocations of test_setup_database, the crates are organized as follows:
- test-utils, the top-level crate, contains functionality for both populating + copying from a seed directory. This is made available to both the build script (in nexus/test-utils) and any tests (in nexus) that want to call test_setup_database. Calling the test-utils version of test_setup_database now explicitly requires providing a path to the seed directory.
- The build script within nexus/test-utils defines an OUT_DIR, and creates the crdb-base directory there. It additionally provides another implementation of test_setup_database, which also embeds the path to the crdb-base directory.
- Most tests use the version of test_setup_database from nexus/test-utils, which embeds the path to crdb-base created from the build script.
Fixes#548
While debugging #540, I realized that I was running
cargo test
from two different clones ofomicron
with the same value of$TMPDIR
in my environment, and that they could totally stomp on each other if one of their "build" steps initialized $TMPDIR/crdb-base while the other one's test suite was running trying to create a new database directory from that directory.If we move the seed directory to
./target
, it will at least be scoped to one local clone of Omicron.The text was updated successfully, but these errors were encountered: