Cherry-pick https://github.com/bazelbuild/bazel/commit/ae99c1f3a303b2993ce6dbab32ff3bd067fb296d into 6.4 to address timeout issues @iancha1992