Fix unit tests and comments

Signed-off-by: z1cheng <imchench@gmail.com>
This commit is contained in:
z1cheng 2023-06-29 14:11:51 +00:00 committed by k8s-infra-cherrypick-robot
parent 4b6d0c0738
commit 1d8e7f4695
7 changed files with 17 additions and 40 deletions

View file

@ -48,10 +48,7 @@ func TestProcessCollector(t *testing.T) {
done := make(chan struct{})
go func() {
err = cmd.Wait()
if err != nil {
t.Errorf("unexpected error waiting for dummy process: %v", err)
}
cmd.Wait() //nolint:errcheck
status := cmd.ProcessState.Sys().(syscall.WaitStatus)
if status.Signaled() {
t.Logf("Signal: %v", status.Signal())
@ -72,11 +69,8 @@ func TestProcessCollector(t *testing.T) {
defer func() {
cm.Stop()
err = cmd.Process.Kill()
cmd.Process.Kill() //nolint:errcheck
<-done
if err != nil {
t.Errorf("unexpected error killing dummy process: %v", err)
}
close(done)
}()