Skip to content

fix: do not set max deadline for workspaces on template update #12446

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Mar 7, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add test comment
  • Loading branch information
Emyrk committed Mar 6, 2024
commit e2058d19ca21301864a27c5055e9ecb6327b5183
8 changes: 7 additions & 1 deletion enterprise/coderd/schedule/template_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,13 @@ func TestTemplateUpdateBuildDeadlines(t *testing.T) {
newMaxDeadline: nextQuietHours,
},
{
name: "MaxDealineShouldBeUnset",
// There was a bug if a user has no quiet hours set, and autostop
// req is not turned on, then the max deadline is set to `time.Time{}`.
// This zero value was "in the past", so the workspace deadline would
// be set to "now" + 2 hours.
// This is a mistake because the max deadline being zero means
// there is no max deadline.
name: "MaxDeadlineShouldBeUnset",
now: buildTime,
deadline: buildTime.Add(time.Hour * 8),
maxDeadline: time.Time{}, // No max set
Expand Down