You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
return codersdk.Workspace{}, codersdk.WorkspaceAgent{}, xerrors.Errorf("start workspace with active template version: %w", err)
670
+
}
671
+
_, _=fmt.Fprintln(inv.Stdout, "Unable to start the workspace with template version from last build. Your workspace has been updated to the current active template version.")
664
672
}
665
-
_, _=fmt.Fprintln(inv.Stdout, "Unable to start the workspace with template version from last build. Your workspace has been updated to the current active template version.")
666
673
} elseiferr!=nil {
667
674
return codersdk.Workspace{}, codersdk.WorkspaceAgent{}, xerrors.Errorf("start workspace with current template version: %w", err)
// Either allow the command to start the workspace or fail
196
+
// due to conflict (race), in which case it retries.
197
+
match:=proc.pty.ExpectRegexMatchContext(ctx, "(Waiting for the workspace agent to connect|Unable to start the workspace due to conflict, the workspace may be starting, retrying without autostart...)")
198
+
ifstrings.Contains(match, "Unable to start the workspace due to conflict, the workspace may be starting, retrying without autostart...") {
199
+
foundConflict++
200
+
// It should retry without autostart.
201
+
proc.pty.ExpectMatchContext(ctx, "Waiting for the workspace agent to connect")
202
+
}
203
+
}
204
+
// TODO(mafredri): Remove this if it's racy.
205
+
require.Greater(t, foundConflict, 0, "expected at least one conflict")
0 commit comments