resource not closed in test