MCPcopy
hub / github.com/google/gvisor / waitForProcessCount

Function waitForProcessCount

runsc/container/container_test.go:182–197  ·  view source on GitHub ↗
(cont *Container, want int)

Source from the content-addressed store, hash-verified

180}
181
182func waitForProcessCount(cont *Container, want int) error {
183 cb := func() error {
184 pss, err := cont.Processes()
185 if err != nil {
186 err = fmt.Errorf("error getting process data from container: %w", err)
187 return &backoff.PermanentError{Err: err}
188 }
189 if got := len(pss); got != want {
190 log.Infof("Waiting for process count to reach %d. Current: %d", want, got)
191 return fmt.Errorf("wrong process count, got: %d, want: %d", got, want)
192 }
193 return nil
194 }
195 // Gives plenty of time as tests can run slow under --race.
196 return testutil.Poll(cb, pollTimeout)
197}
198
199func blockUntilWaitable(pid int) error {
200 _, _, err := specutils.RetryEintr(func() (uintptr, uintptr, error) {

Callers 7

TestMultiPIDNSKillFunction · 0.85
TestExecWaitFunction · 0.85
TestMultiContainerEventFunction · 0.85
TestKillPidFunction · 0.85
TestSignalProcessGroupFunction · 0.85

Calls 4

InfofFunction · 0.92
PollFunction · 0.92
ErrorfMethod · 0.65
ProcessesMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…