Skip to content

Commit

Permalink
fix error checks
Browse files Browse the repository at this point in the history
  • Loading branch information
fearful-symmetry committed Jan 27, 2025
1 parent 2516972 commit 07f8eca
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ func loadDB(t *testing.T, count uint32, procHandler procfs.MockReader, prov prvd
evt := constructEvt(i, "execve")
procHandler.AddEntry(i, procfs.ProcessInfo{PIDs: types.PIDInfo{Tgid: i, Ppid: 1234}})

prov.Sync(evt, i)
err := prov.Sync(evt, i)
require.NoError(t, err)

// verify that we got the process
found, err := prov.db.GetProcess(i)
Expand All @@ -58,7 +59,8 @@ func loadDB(t *testing.T, count uint32, procHandler procfs.MockReader, prov prvd

// now insert the exit
exitEvt := constructEvt(i, "exit_group")
prov.Sync(exitEvt, i)
err = prov.Sync(exitEvt, i)
require.NoError(t, err)

}
}
Expand All @@ -74,7 +76,7 @@ func TestProviderLoadMetrics(t *testing.T) {
defer cancel()
testProvider, err := NewProvider(ctx, logp.L(), procDB, testProc, "process.pid")
require.NoError(t, err)
rawPrvdr := testProvider.(prvdr)
rawPrvdr, _ := testProvider.(prvdr)

events := 100_000
loadDB(t, uint32(events), *testProc, rawPrvdr)
Expand Down

0 comments on commit 07f8eca

Please sign in to comment.