[#66893118] Make CLEANUP_ENVIRONMENT tests more backwards-compatible