From 85780de13979d95cbb6b93e993e8a355f94aa5c0 Mon Sep 17 00:00:00 2001 From: Rebecca Mahany-Horton Date: Thu, 25 Jul 2024 12:11:30 -0400 Subject: [PATCH] Fix typo, call shutdown instead of interrupt to validate return --- pkg/osquery/runtime/runtime_helpers_windows.go | 2 +- pkg/osquery/runtime/runtime_test.go | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/pkg/osquery/runtime/runtime_helpers_windows.go b/pkg/osquery/runtime/runtime_helpers_windows.go index cfbe90799..5c5dda948 100644 --- a/pkg/osquery/runtime/runtime_helpers_windows.go +++ b/pkg/osquery/runtime/runtime_helpers_windows.go @@ -60,7 +60,7 @@ func SocketPath(rootDir string) string { // launcher and osquery. We would like to be able to run multiple // launchers. // - // We could use something based on the laumcher root, but given the + // We could use something based on the launcher root, but given the // context this runs in a ulid seems simpler. return fmt.Sprintf(`\\.\pipe\kolide-osquery-%s`, ulid.New()) } diff --git a/pkg/osquery/runtime/runtime_test.go b/pkg/osquery/runtime/runtime_test.go index 8ed916d04..b21b9a111 100644 --- a/pkg/osquery/runtime/runtime_test.go +++ b/pkg/osquery/runtime/runtime_test.go @@ -4,7 +4,6 @@ package runtime import ( "context" - "errors" "fmt" "log/slog" "os" @@ -358,7 +357,7 @@ func TestWithOsqueryFlags(t *testing.T) { waitHealthy(t, runner, &logBytes) assert.Equal(t, []string{"verbose=false"}, runner.instance.opts.osqueryFlags) - runner.Interrupt(errors.New("test error")) + require.NoError(t, runner.Shutdown()) } func TestFlagsChanged(t *testing.T) { @@ -455,7 +454,7 @@ func TestFlagsChanged(t *testing.T) { k.AssertExpectations(t) - runner.Interrupt(errors.New("test error")) + require.NoError(t, runner.Shutdown()) } // waitHealthy expects the instance to be healthy within 30 seconds, or else