close resources in tests