tests: Minor imporvement in agent invocation