diff --git a/ee/agent/timemachine/timemachine_darwin_test.go b/ee/agent/timemachine/timemachine_darwin_test.go index a5f2f0011..aa1ca4375 100644 --- a/ee/agent/timemachine/timemachine_darwin_test.go +++ b/ee/agent/timemachine/timemachine_darwin_test.go @@ -5,7 +5,6 @@ package timemachine import ( "context" - "fmt" "os" "os/user" "path/filepath" @@ -15,13 +14,16 @@ import ( "github.com/kolide/launcher/ee/agent/types/mocks" "github.com/kolide/launcher/ee/allowedcmd" - "github.com/kolide/launcher/pkg/backoff" "github.com/stretchr/testify/require" ) func TestAddExclusions(t *testing.T) { t.Parallel() + if os.Getenv("GITHUB_ACTIONS") == "true" { + t.Skip("Skipping test on GitHub Actions because it's flaky there") + } + u, err := user.Current() require.NoError(t, err) @@ -91,30 +93,18 @@ func TestAddExclusions(t *testing.T) { // ensure the files are included / excluded as expected for fileName, shouldBeExcluded := range shouldBeExcluded { - // Allow for a couple retries for the file to show up as excluded appropriately -- - // we've seen this be a little flaky in CI - err := backoff.WaitFor(func() error { - cmd, err := allowedcmd.Tmutil(context.TODO(), "isexcluded", filepath.Join(testDir, fileName)) - if err != nil { - return fmt.Errorf("creating tmutil command: %w", err) - } - - out, err := cmd.CombinedOutput() - if err != nil { - return fmt.Errorf("running tmutil isexcluded: %w", err) - } - - if shouldBeExcluded && !strings.Contains(string(out), "[Excluded]") { - return fmt.Errorf("output `%s` does not contain [Excluded], but file should be excluded", string(out)) - } - - if !shouldBeExcluded && !strings.Contains(string(out), "[Included]") { - return fmt.Errorf("output `%s` does not contain [Included], but file should be included", string(out)) - } - - return nil - }, 1*time.Second, 200*time.Millisecond) - - require.NoError(t, err, "file not handled as expected") + cmd, err := allowedcmd.Tmutil(context.TODO(), "isexcluded", filepath.Join(testDir, fileName)) + require.NoError(t, err) + + out, err := cmd.CombinedOutput() + require.NoError(t, err) + + if shouldBeExcluded { + require.Contains(t, string(out), "[Excluded]") + continue + } + + // should be included + require.Contains(t, string(out), "[Included]") } }