Bug 27526: Improve robustness of tests