MCPcopy
hub / github.com/containerd/containerd / RestartContainerd

Function RestartContainerd

integration/main_test.go:843–859  ·  view source on GitHub ↗
(t *testing.T, signal syscall.Signal)

Source from the content-addressed store, hash-verified

841}
842
843func RestartContainerd(t *testing.T, signal syscall.Signal) {
844 require.NoError(t, KillProcess(*containerdBin, signal))
845
846 // Use assert so that the 3rd wait always runs, this makes sure
847 // containerd is running before this function returns.
848 assert.NoError(t, Eventually(func() (bool, error) {
849 pid, err := PidOf(*containerdBin)
850 if err != nil {
851 return false, err
852 }
853 return pid == 0, nil
854 }, time.Second, 30*time.Second), "wait for containerd to be killed")
855
856 require.NoError(t, Eventually(func() (bool, error) {
857 return ConnectDaemons() == nil, nil
858 }, time.Second, 30*time.Second), "wait for containerd to be restarted")
859}
860
861// EnsureImageExists pulls the given image, ensures that no error was encountered
862// while pulling it.

Calls 4

KillProcessFunction · 0.85
EventuallyFunction · 0.85
PidOfFunction · 0.85
ConnectDaemonsFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…