Skip to content

Commit

Permalink
Revert call order of getOS and waitForStartLinux.
Browse files Browse the repository at this point in the history
  • Loading branch information
franciscovalentecastro committed May 22, 2024
1 parent 26455b7 commit a9d7330
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions integration_test/gce/gce_testing.go
Original file line number Diff line number Diff line change
Expand Up @@ -1252,14 +1252,14 @@ func attemptCreateInstance(ctx context.Context, logger *log.Logger, options VMOp
logger.Printf("Unable to retrieve information about the VM's boot disk: %v", err)
}

if os, err := getOS(ctx, logger, vm); err != nil {
if err := waitForStart(ctx, logger, vm); err != nil {
return nil, err
} else {
vm.OS = *os
}

if err := waitForStart(ctx, logger, vm); err != nil {
if os, err := getOS(ctx, logger, vm); err != nil {
return nil, err
} else {
vm.OS = *os
}

if IsSUSEVM(vm) {
Expand Down Expand Up @@ -1773,7 +1773,7 @@ func waitForStartWindows(ctx context.Context, logger *log.Logger, vm *VM) error
func waitForStartLinux(ctx context.Context, logger *log.Logger, vm *VM) error {
var backoffPolicy backoff.BackOff
backoffPolicy = backoff.NewConstantBackOff(vmInitBackoffDuration)
if IsSUSEVM(vm) {
if IsSUSEImageSpec(vm.ImageSpec) {
// Give up early on SUSE due to b/186426190. If this step times out, the
// error will be retried with a fresh VM.
backoffPolicy = backoff.WithMaxRetries(backoffPolicy, uint64((5*time.Minute)/vmInitBackoffDuration))
Expand Down Expand Up @@ -1815,7 +1815,7 @@ func waitForStartLinux(ctx context.Context, logger *log.Logger, vm *VM) error {
return fmt.Errorf("%v. Last err=%v", startupFailedMessage, err)
}

if IsSUSEVM(vm) {
if IsSUSEImageSpec(vm.ImageSpec) {
// TODO(b/259122953): SUSE needs additional startup time. Remove once we have more
// sensible/deterministic workarounds for each of the individual problems.
time.Sleep(slesStartupDelay)
Expand Down

0 comments on commit a9d7330

Please sign in to comment.