Avoid memory leak in a Future test case