Update agent integration test to more cleanly handle timeouts