Put 'test_pool' function in a try/finally statement