@@ -193,7 +193,7 @@ func TestExecutorAutostopOK(t *testing.T) {
193193
194194 // When: the autobuild executor ticks *after* the deadline:
195195 go func () {
196- tickCh <- workspace .LatestBuild .Deadline .Add (time .Minute )
196+ tickCh <- workspace .LatestBuild .Deadline .Time . Add (time .Minute )
197197 close (tickCh )
198198 }()
199199
@@ -229,15 +229,15 @@ func TestExecutorAutostopExtend(t *testing.T) {
229229 require .NotZero (t , originalDeadline )
230230
231231 // Given: we extend the workspace deadline
232- newDeadline := originalDeadline .Add (30 * time .Minute )
232+ newDeadline := originalDeadline .Time . Add (30 * time .Minute )
233233 err := client .PutExtendWorkspace (ctx , workspace .ID , codersdk.PutExtendWorkspaceRequest {
234234 Deadline : newDeadline ,
235235 })
236236 require .NoError (t , err , "extend workspace deadline" )
237237
238238 // When: the autobuild executor ticks *after* the original deadline:
239239 go func () {
240- tickCh <- originalDeadline .Add (time .Minute )
240+ tickCh <- originalDeadline .Time . Add (time .Minute )
241241 }()
242242
243243 // Then: nothing should happen and the workspace should stay running
@@ -281,7 +281,7 @@ func TestExecutorAutostopAlreadyStopped(t *testing.T) {
281281
282282 // When: the autobuild executor ticks past the TTL
283283 go func () {
284- tickCh <- workspace .LatestBuild .Deadline .Add (time .Minute )
284+ tickCh <- workspace .LatestBuild .Deadline .Time . Add (time .Minute )
285285 close (tickCh )
286286 }()
287287
@@ -323,7 +323,7 @@ func TestExecutorAutostopNotEnabled(t *testing.T) {
323323
324324 // When: the autobuild executor ticks past the TTL
325325 go func () {
326- tickCh <- workspace .LatestBuild .Deadline .Add (time .Minute )
326+ tickCh <- workspace .LatestBuild .Deadline .Time . Add (time .Minute )
327327 close (tickCh )
328328 }()
329329
@@ -415,7 +415,7 @@ func TestExecutorWorkspaceAutostopBeforeDeadline(t *testing.T) {
415415
416416 // When: the autobuild executor ticks before the TTL
417417 go func () {
418- tickCh <- workspace .LatestBuild .Deadline .Add (- 1 * time .Minute )
418+ tickCh <- workspace .LatestBuild .Deadline .Time . Add (- 1 * time .Minute )
419419 close (tickCh )
420420 }()
421421
@@ -447,11 +447,11 @@ func TestExecutorWorkspaceAutostopNoWaitChangedMyMind(t *testing.T) {
447447
448448 // Then: the deadline should still be the original value
449449 updated := coderdtest .MustWorkspace (t , client , workspace .ID )
450- assert .WithinDuration (t , workspace .LatestBuild .Deadline , updated .LatestBuild .Deadline , time .Minute )
450+ assert .WithinDuration (t , workspace .LatestBuild .Deadline . Time , updated .LatestBuild .Deadline . Time , time .Minute )
451451
452452 // When: the autobuild executor ticks after the original deadline
453453 go func () {
454- tickCh <- workspace .LatestBuild .Deadline .Add (time .Minute )
454+ tickCh <- workspace .LatestBuild .Deadline .Time . Add (time .Minute )
455455 }()
456456
457457 // Then: the workspace should stop
@@ -478,7 +478,7 @@ func TestExecutorWorkspaceAutostopNoWaitChangedMyMind(t *testing.T) {
478478
479479 // When: the relentless onward march of time continues
480480 go func () {
481- tickCh <- workspace .LatestBuild .Deadline .Add (newTTL + time .Minute )
481+ tickCh <- workspace .LatestBuild .Deadline .Time . Add (newTTL + time .Minute )
482482 close (tickCh )
483483 }()
484484
0 commit comments