Skip to content

Commit

Permalink
Add a touch of delay for Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
swi-jared committed Jul 31, 2024
1 parent 1e17c9c commit b79e4d0
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions internal/uams/uams_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import (
"net/http"
"os"
"path/filepath"
"runtime"
"testing"
"time"
)
Expand All @@ -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)
Expand Down

0 comments on commit b79e4d0

Please sign in to comment.