func shouldRetryCreateVM()

in integration_test/gce-testing-internal/gce/gce_testing.go [1590:1606]


func shouldRetryCreateVM(err error, options VMOptions) bool {
	// VM creation can hit quota, especially when re-running presubmits,
	// or when multple people are running tests.
	return strings.Contains(err.Error(), "Quota") ||
		// Rarely, instance creation fails due to internal errors in the compute API.
		strings.Contains(err.Error(), "Internal error") ||
		// Instance creation can also fail due to service unavailability.
		strings.Contains(err.Error(), "currently unavailable") ||
		// This error is a consequence of running gcloud concurrently, which is actually
		// unsupported. In the absence of a better fix, just retry such errors.
		strings.Contains(err.Error(), "database is locked") ||
		// windows-*-core instances sometimes fail to be ssh-able: b/305721001
		(IsWindowsCore(options.ImageSpec) && strings.Contains(err.Error(), windowsStartupFailedMessage)) ||
		// SLES instances sometimes fail to be ssh-able: b/186426190
		(IsSUSEImageSpec(options.ImageSpec) && strings.Contains(err.Error(), startupFailedMessage)) ||
		strings.Contains(err.Error(), prepareSLESMessage)
}