Improve robustness of Writer test