backport the patch to fix intermittent failures inside build farms