diff --git a/coderd/templates_test.go b/coderd/templates_test.go index bc8b7dae7292c..0e50463c89dd4 100644 --- a/coderd/templates_test.go +++ b/coderd/templates_test.go @@ -166,6 +166,9 @@ func TestPatchTemplateMeta(t *testing.T) { MaxTTLMillis: 12 * time.Hour.Milliseconds(), MinAutostartIntervalMillis: time.Minute.Milliseconds(), } + // It is unfortunate we need to sleep, but the test can fail if the + // updatedAt is too close together. + time.Sleep(time.Millisecond * 5) updated, err := client.UpdateTemplateMeta(ctx, template.ID, req) require.NoError(t, err) assert.Greater(t, updated.UpdatedAt, template.UpdatedAt)