From b79e4d0f7ce670f43876cd1d0526c79fd5e7c869 Mon Sep 17 00:00:00 2001 From: Jared Harper Date: Wed, 31 Jul 2024 15:10:20 -0700 Subject: [PATCH] Add a touch of delay for Windows --- internal/uams/uams_test.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/internal/uams/uams_test.go b/internal/uams/uams_test.go index 2cfa41a9..36818fd3 100644 --- a/internal/uams/uams_test.go +++ b/internal/uams/uams_test.go @@ -22,6 +22,7 @@ import ( "net/http" "os" "path/filepath" + "runtime" "testing" "time" ) @@ -38,7 +39,15 @@ func TestUpdateClientId(t *testing.T) { uid, err := uuid.NewRandom() require.NoError(t, err) a := time.Now() + // windows doesn't seem to notice that a few nanoseconds have passed, so we + // introduce a touch of delay + if runtime.GOOS == "windows" { + time.Sleep(time.Millisecond) + } updateClientId(uid, "file") + if runtime.GOOS == "windows" { + time.Sleep(time.Millisecond) + } b := time.Now() require.Equal(t, uid, currState.clientId) require.Equal(t, "file", currState.via)