Merge "Close repeatedly unclosed resources at the end of tests" into main