Revert "Revert 20202. Use other measures to prevent race in test-cmd.sh"
Revert "Revert 20202. Use other measures to prevent race in test-cmd.sh"

Kubernetes-commit: 375b4ca8d6703fb0383c1290e0bfe7494e52a181

kubernetes/api