Skip to content

Commit

Permalink
system_test.go - Fix flaky TestProcesses (#182)
Browse files Browse the repository at this point in the history
If a process terminates while go-sysinfo is collecting info about it
then ENOENT (no such file or directory) can occur. Ignore that while
testing a live system.

Fixes #179
  • Loading branch information
andrewkroh committed May 31, 2023
1 parent 261db4f commit d4436c2
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions system_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,7 @@ func TestProcesses(t *testing.T) {
case errors.Is(err, syscall.ESRCH),
errors.Is(err, syscall.EPERM),
errors.Is(err, syscall.EINVAL),
errors.Is(err, syscall.ENOENT),
errors.Is(err, fs.ErrPermission):
continue
case err != nil:
Expand Down

0 comments on commit d4436c2

Please sign in to comment.