Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit02fc173

Browse files
authored
fix: fix flake due to two time.Now() calls (#19450)
fixescoder/internal#559This test is looking to see that after calling `coder schedule extend<workspace> 10h`, the scheduled stop time of the workspace is updatedappropriately (or at least that the information printed to the terminalindicates that).By using two `time.Now()` calls for the current time and the expectedtime, there was the possibility that the second call just barely crossedover the hour mark. This is shown in the error message when the testwould flake: `wanted "2025-04-07T22:"; got " 2025-04-07T23:00:00+05:30\r\n"` (the 00:00 letting us know we just barely crossed the hour).Using the same time object to construct the expected time should fix theissue.
1 parent9ad124d commit02fc173

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

‎cli/schedule_test.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ func TestScheduleOverride(t *testing.T) {
353353
ownerClient,_,_,ws:=setupTestSchedule(t,sched)
354354
now:=time.Now()
355355
// To avoid the likelihood of time-related flakes, only matching up to the hour.
356-
expectedDeadline:=time.Now().In(loc).Add(10*time.Hour).Format("2006-01-02T15:")
356+
expectedDeadline:=now.In(loc).Add(10*time.Hour).Format("2006-01-02T15:")
357357

358358
// When: we override the stop schedule
359359
inv,root:=clitest.New(t,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp