@@ -624,7 +624,7 @@ func TestWorkspaceUpdateTTL(t *testing.T) {
624
624
name : "update ttl" ,
625
625
ttlMillis : ptr .Ref (12 * time .Hour .Milliseconds ()),
626
626
expectedError : "" ,
627
- expectedDeadline : ptr .Ref (time .Now ().Add (12 * time .Hour )),
627
+ expectedDeadline : ptr .Ref (time .Now ().Add (12 * time .Hour + time . Minute )),
628
628
},
629
629
{
630
630
name : "below minimum ttl" ,
@@ -635,13 +635,13 @@ func TestWorkspaceUpdateTTL(t *testing.T) {
635
635
name : "minimum ttl" ,
636
636
ttlMillis : ptr .Ref (time .Minute .Milliseconds ()),
637
637
expectedError : "" ,
638
- expectedDeadline : ptr .Ref (time .Now ().Add (time .Minute )),
638
+ expectedDeadline : ptr .Ref (time .Now ().Add (2 * time .Minute )),
639
639
},
640
640
{
641
641
name : "maximum ttl" ,
642
642
ttlMillis : ptr .Ref ((24 * 7 * time .Hour ).Milliseconds ()),
643
643
expectedError : "" ,
644
- expectedDeadline : ptr .Ref (time .Now ().Add (24 * 7 * time .Hour )),
644
+ expectedDeadline : ptr .Ref (time .Now ().Add (24 * 7 * time .Hour + time . Minute )),
645
645
},
646
646
{
647
647
name : "above maximum ttl" ,
@@ -676,6 +676,7 @@ func TestWorkspaceUpdateTTL(t *testing.T) {
676
676
cwr .AutostartSchedule = nil
677
677
cwr .TTLMillis = nil
678
678
})
679
+ _ = coderdtest .AwaitWorkspaceBuildJob (t , client , workspace .LatestBuild .ID )
679
680
)
680
681
681
682
err := client .UpdateWorkspaceTTL (ctx , workspace .ID , codersdk.UpdateWorkspaceTTLRequest {
0 commit comments