> While doing some local testing, I noticed that my /tmp drive completely > filled with test artifact files (e.g. data directories, logs, commit logs, > etc). Mick pointed out that we do attempt to do some "find" based cleanup > in CI ( > https://github.com/apache/cassandra-builds/blob/trunk/jenkins-dsl/cassandra_job_dsl_seed.groovy#L437-439), > but I was wondering if it might be better to do the following for direct > ant builds: > > 1. If TMPDIR is set, use it. It does not appear to be honored, currently, > so I need to do some analysis of what would need to be done here > 2. If TMPDIR is not set, use "mktemp" to create a temp directory and set > TMPDIR with that directory > 3. Update the "ant clean" task to delete TMPDIR when we've generated it, > or attempt the find-based cleanup if TMPDIR was provided > > Does anyone know if there are any hard-coded assumptions that test files > will live directly under /tmp? >
This will need testing with in-tree scripts, ci-cassandra, and circleci :( What comes to mind: - TMPDIR works best today with the python and scripting stuff - setting TMPDIR can break tests, hence unit test script set instead $TMP_DIR which is passed to `-Dtmp.dir=…` - /tmp is often set up to be a more appropropriate fs (and volume size) - it is hard to customise everything - it needs to work locally on your machine as well as in docker containers, as well as CI If we want something that is wiped by `ant clean` I would suggest using the build/tmp directory by default. In-tree scripts do this for unit tests: https://github.com/apache/cassandra/blob/trunk/.build/run-tests.sh#L160 but are not yet doing it for the dtests: https://github.com/apache/cassandra/blob/trunk/.build/run-python-dtests.sh#L58 So I don't think we need (3). If the caller has specified TMPDIR it is then their responsibility to clean it. We can probably avoid trying to set TMPDIR, instead defaulting the `tmp.dir` property to the build/tmp directory. The goal of any changes in build.xml should be, in addition to providing the best dev exp, to simplify the testing and CI layers above it.