What directories should I delete regularly to keep my disk usage under control when regularly running Bitcoin Core and the unit/functional tests?
This was answered on Twitter by various individuals.
You should remove the directory
/tmp/test_common_Bitcoin Core regularly. For Martin Leitner-Ankerl this was 6GB of leftover files (leftovers only happen when tests fail or are canceled).
theStack also recommends running
rm -rf /tmp/bitcoin_func_test_* every now and then.
/tmp directory is usually only deleted at boot. It is uncommon on modern Linux distros for
/tmp to be cleaned up automatically during runtime.
Occasionally (e.g. with the merge of #23371) you need to run
rm -rf ./test/cache to force cache regeneration. In the #23371 case the pre-mined chain of the functional test framework changed and the functional tests using MiniWallet would fail (credit: theStack)
For general advice on compiling Bitcoin Core and running the tests see this doc from Jon Atack.