@@ -193,7 +193,7 @@ func TestExecutorAutostopOK(t *testing.T) {
193
193
194
194
// When: the autobuild executor ticks *after* the deadline:
195
195
go func () {
196
- tickCh <- workspace .LatestBuild .Deadline .Add (time .Minute )
196
+ tickCh <- workspace .LatestBuild .Deadline .Time . Add (time .Minute )
197
197
close (tickCh )
198
198
}()
199
199
@@ -229,15 +229,15 @@ func TestExecutorAutostopExtend(t *testing.T) {
229
229
require .NotZero (t , originalDeadline )
230
230
231
231
// Given: we extend the workspace deadline
232
- newDeadline := originalDeadline .Add (30 * time .Minute )
232
+ newDeadline := originalDeadline .Time . Add (30 * time .Minute )
233
233
err := client .PutExtendWorkspace (ctx , workspace .ID , codersdk.PutExtendWorkspaceRequest {
234
234
Deadline : newDeadline ,
235
235
})
236
236
require .NoError (t , err , "extend workspace deadline" )
237
237
238
238
// When: the autobuild executor ticks *after* the original deadline:
239
239
go func () {
240
- tickCh <- originalDeadline .Add (time .Minute )
240
+ tickCh <- originalDeadline .Time . Add (time .Minute )
241
241
}()
242
242
243
243
// Then: nothing should happen and the workspace should stay running
@@ -281,7 +281,7 @@ func TestExecutorAutostopAlreadyStopped(t *testing.T) {
281
281
282
282
// When: the autobuild executor ticks past the TTL
283
283
go func () {
284
- tickCh <- workspace .LatestBuild .Deadline .Add (time .Minute )
284
+ tickCh <- workspace .LatestBuild .Deadline .Time . Add (time .Minute )
285
285
close (tickCh )
286
286
}()
287
287
@@ -323,7 +323,7 @@ func TestExecutorAutostopNotEnabled(t *testing.T) {
323
323
324
324
// When: the autobuild executor ticks past the TTL
325
325
go func () {
326
- tickCh <- workspace .LatestBuild .Deadline .Add (time .Minute )
326
+ tickCh <- workspace .LatestBuild .Deadline .Time . Add (time .Minute )
327
327
close (tickCh )
328
328
}()
329
329
@@ -415,7 +415,7 @@ func TestExecutorWorkspaceAutostopBeforeDeadline(t *testing.T) {
415
415
416
416
// When: the autobuild executor ticks before the TTL
417
417
go func () {
418
- tickCh <- workspace .LatestBuild .Deadline .Add (- 1 * time .Minute )
418
+ tickCh <- workspace .LatestBuild .Deadline .Time . Add (- 1 * time .Minute )
419
419
close (tickCh )
420
420
}()
421
421
@@ -447,11 +447,11 @@ func TestExecutorWorkspaceAutostopNoWaitChangedMyMind(t *testing.T) {
447
447
448
448
// Then: the deadline should still be the original value
449
449
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 )
451
451
452
452
// When: the autobuild executor ticks after the original deadline
453
453
go func () {
454
- tickCh <- workspace .LatestBuild .Deadline .Add (time .Minute )
454
+ tickCh <- workspace .LatestBuild .Deadline .Time . Add (time .Minute )
455
455
}()
456
456
457
457
// Then: the workspace should stop
@@ -478,7 +478,7 @@ func TestExecutorWorkspaceAutostopNoWaitChangedMyMind(t *testing.T) {
478
478
479
479
// When: the relentless onward march of time continues
480
480
go func () {
481
- tickCh <- workspace .LatestBuild .Deadline .Add (newTTL + time .Minute )
481
+ tickCh <- workspace .LatestBuild .Deadline .Time . Add (newTTL + time .Minute )
482
482
close (tickCh )
483
483
}()
484
484
0 commit comments