Make sure doing query only when the test hasn't timed out #26