From f8d0beae1581f10c64bcdb4e21c5bf74e93fb5c7 Mon Sep 17 00:00:00 2001 From: James Pickett Date: Fri, 9 Feb 2024 13:40:07 -0800 Subject: [PATCH] add small wait before performing time machine exclusion test assertions (#1595) --- ee/agent/timemachine/timemachine_darwin_test.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ee/agent/timemachine/timemachine_darwin_test.go b/ee/agent/timemachine/timemachine_darwin_test.go index 90913559f..1aaf761a6 100644 --- a/ee/agent/timemachine/timemachine_darwin_test.go +++ b/ee/agent/timemachine/timemachine_darwin_test.go @@ -10,6 +10,7 @@ import ( "path/filepath" "strings" "testing" + "time" "github.com/kolide/launcher/ee/agent/types/mocks" "github.com/kolide/launcher/ee/allowedcmd" @@ -81,6 +82,11 @@ func TestAddExclusions(t *testing.T) { AddExclusions(context.TODO(), knapsack) + // we've seen some flake in CI here where the exclusions have not been + // updated by the time we perform assertions, so sleep for a bit to give + // OS some time to catch up + time.Sleep(1 * time.Second) + // ensure the files are included / excluded as expected for fileName, shouldBeExcluded := range shouldBeExcluded { cmd, err := allowedcmd.Tmutil(context.TODO(), "isexcluded", filepath.Join(testDir, fileName))