From 658f440b233a1240027ec0b04b997709c330ad98 Mon Sep 17 00:00:00 2001 From: Steven Masley Date: Fri, 17 Jun 2022 15:06:30 -0500 Subject: [PATCH] fix: Fix test flake based on same update time --- coderd/templates_test.go | 3 +++ 1 file changed, 3 insertions(+) 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)