util: socketset: Add missing return

If our machine has that pipe busy, don't panic the test. (We do want it
to fail though!)

We're also more careful to check nil object just as a convenience to
help programmers.
This commit is contained in:
James Shubin
2023-09-19 06:49:13 -04:00
parent 6c0775ba59
commit 1b12db92ab
2 changed files with 13 additions and 0 deletions

View File

@@ -114,6 +114,7 @@ func TestShutdown(t *testing.T) {
ss, err := NewSocketSet(0, "pipe.sock", 0)
if err != nil {
t.Errorf("could not create SocketSet: %+v", err)
return
}
// waitgroup for netlink receive goroutine
wg := &sync.WaitGroup{}