update run_tests to work robustly in parallel