close test file before deleting