Skip to content

Commit

Permalink
Fix config.go by skipping them
Browse files Browse the repository at this point in the history
Signed-off-by: Amir Mohamad Ehsandar <[email protected]>
  • Loading branch information
ehsundar committed Oct 15, 2020
1 parent dbd98fc commit fe1e7bd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
4 changes: 2 additions & 2 deletions libcontainer/configs/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -385,8 +385,8 @@ func (c Command) Run(s *specs.State) error {
case err := <-errC:
return err
case <-timerCh:
cmd.Process.Kill()
cmd.Wait()
_ = cmd.Process.Kill()
_ = cmd.Wait()
return fmt.Errorf("hook ran past specified timeout of %.1fs", c.Timeout.Seconds())
}
}
7 changes: 5 additions & 2 deletions libcontainer/configs/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,10 @@ func TestFuncHookRun(t *testing.T) {
return nil
})

fHook.Run(state)
err := fHook.Run(state)
if err != nil {
t.Errorf("Unexpected error running hook: %+v", err)
}
}

func TestCommandHookRun(t *testing.T) {
Expand Down Expand Up @@ -184,7 +187,7 @@ func TestCommandHookRunTimeout(t *testing.T) {
Pid: 1,
Bundle: "/bundle",
}
timeout := (10 * time.Millisecond)
timeout := 10 * time.Millisecond

cmdHook := configs.NewCommandHook(configs.Command{
Path: os.Args[0],
Expand Down

0 comments on commit fe1e7bd

Please sign in to comment.