agent: Improve ForceLeave test reliability