Skip to content

Commit

Permalink
Add .Maybe() to some unimportant assertions in runtime tests (#1797)
Browse files Browse the repository at this point in the history
  • Loading branch information
RebeccaMahany authored Jul 25, 2024
1 parent 55765bc commit d26319c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pkg/osquery/runtime/runtime_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ func TestWithOsqueryFlags(t *testing.T) {
k.On("LatestOsquerydPath", mock.Anything).Return(testOsqueryBinaryDirectory)
store, err := storageci.NewStore(t, multislogger.NewNopLogger(), storage.KatcConfigStore.String())
require.NoError(t, err)
k.On("KatcConfigStore").Return(store)
k.On("KatcConfigStore").Return(store).Maybe() // attempt to make this test less flaky

runner := New(
k,
Expand Down Expand Up @@ -373,7 +373,7 @@ func TestFlagsChanged(t *testing.T) {
k.On("LatestOsquerydPath", mock.Anything).Return(testOsqueryBinaryDirectory)
store, err := storageci.NewStore(t, multislogger.NewNopLogger(), storage.KatcConfigStore.String())
require.NoError(t, err)
k.On("KatcConfigStore").Return(store)
k.On("KatcConfigStore").Return(store).Maybe() // attempt to make this test less flaky

// Start the runner
runner := New(
Expand Down Expand Up @@ -469,7 +469,7 @@ func TestSimplePath(t *testing.T) {
k.On("LatestOsquerydPath", mock.Anything).Return(testOsqueryBinaryDirectory)
store, err := storageci.NewStore(t, multislogger.NewNopLogger(), storage.KatcConfigStore.String())
require.NoError(t, err)
k.On("KatcConfigStore").Return(store)
k.On("KatcConfigStore").Return(store).Maybe() // attempt to make this test less flaky

runner := New(
k,
Expand Down Expand Up @@ -500,7 +500,7 @@ func TestMultipleShutdowns(t *testing.T) {
k.On("LatestOsquerydPath", mock.Anything).Return(testOsqueryBinaryDirectory)
store, err := storageci.NewStore(t, multislogger.NewNopLogger(), storage.KatcConfigStore.String())
require.NoError(t, err)
k.On("KatcConfigStore").Return(store)
k.On("KatcConfigStore").Return(store).Maybe() // attempt to make this test less flaky

runner := New(
k,
Expand Down Expand Up @@ -530,7 +530,7 @@ func TestOsqueryDies(t *testing.T) {
k.On("LatestOsquerydPath", mock.Anything).Return(testOsqueryBinaryDirectory)
store, err := storageci.NewStore(t, multislogger.NewNopLogger(), storage.KatcConfigStore.String())
require.NoError(t, err)
k.On("KatcConfigStore").Return(store)
k.On("KatcConfigStore").Return(store).Maybe() // attempt to make this test less flaky

runner := New(
k,
Expand Down

0 comments on commit d26319c

Please sign in to comment.