client: improve test robustness