test-utils: Disable CockroachDB's automatic emergency ballast#1005
Conversation
| // | ||
| // https://www.cockroachlabs.com/docs/v21.2/cluster-setup-troubleshooting#automatic-ballast-files | ||
| let mut store_arg = OsString::from("--store=path="); | ||
| store_arg.push(&store_dir); |
There was a problem hiding this comment.
Does this still work if the store_dir has a space in it? I think it would have before because we were passing it as a separate exec argument. Now...I think it still will but I'm less clear on it.
There was a problem hiding this comment.
It appears that it does. I changed the code above this that creates the temp dir to
let temp_dir = tempfile::tempdir_in("/tmp/my dir").with_context(|| "creating temporary directory")?;and confirmed the tests pass (and that I was seeing cockroachdb files under /tmp/my dir/.tmpXXXXXX).
One thing that surprised me was that originally I had written this as
.arg("--store")
.arg(&store_arg) // "path={store_dir),ballast-size=0"
and the tests failed in a way that looked like the path was not being set at all (specifically, the cleanup was failing claiming that the expected /tmp/.tmpXXXXXX directory didn't exist); possibly Cockroach was treating the full string as a path? I did not look into this but assume we're at the mercy of their command line parsing.
There was a problem hiding this comment.
Thanks for testing it!
Should fix #1004