Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit edd1083

Browse files
authored
fix: Fix test flake based on same update time (#2484)
1 parent 4616499 commit edd1083

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

coderd/templates_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,9 @@ func TestPatchTemplateMeta(t *testing.T) {
166166
MaxTTLMillis: 12 * time.Hour.Milliseconds(),
167167
MinAutostartIntervalMillis: time.Minute.Milliseconds(),
168168
}
169+
// It is unfortunate we need to sleep, but the test can fail if the
170+
// updatedAt is too close together.
171+
time.Sleep(time.Millisecond * 5)
169172
updated, err := client.UpdateTemplateMeta(ctx, template.ID, req)
170173
require.NoError(t, err)
171174
assert.Greater(t, updated.UpdatedAt, template.UpdatedAt)

0 commit comments

Comments
 (0)