Skip to content

Commit

Permalink
[test-utils] Give a little hint about running CockroachDB on test fai…
Browse files Browse the repository at this point in the history
…lures (#5125)

This is a pattern I use a lot, but I want to help make it more visible
to folks during test failures.

Digging into the state of Cockroach after a test failure is a useful
debugging tool, so I want to make
it obvious "how to do that".
  • Loading branch information
smklein authored Feb 23, 2024
1 parent 2088693 commit 65ebf72
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions test-utils/src/dev/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -640,8 +640,13 @@ impl Drop for CockroachInstance {
// Do NOT clean up the temporary directory in this case.
let path = temp_dir.into_path();
eprintln!(
"WARN: temporary directory leaked: {}",
path.display()
"WARN: temporary directory leaked: {path:?}\n\
\tIf you would like to access the database for debugging, run the following:\n\n\
\t# Run the database\n\
\tcargo run --bin omicron-dev db-run --no-populate --store-dir {data_path:?}\n\
\t# Access the database. Note the port may change if you run multiple databases.\n\
\tcockroach sql --host=localhost:32221 --insecure",
data_path = path.join("data"),
);
}
}
Expand Down

0 comments on commit 65ebf72

Please sign in to comment.