MCPcopy
hub / github.com/moby/moby / pollCheck

Function pollCheck

integration-cli/docker_utils_test.go:368–387  ·  view source on GitHub ↗
(t *testing.T, f checkF, compare func(x any) assert.BoolOrComparison)

Source from the content-addressed store, hash-verified

366)
367
368func pollCheck(t *testing.T, f checkF, compare func(x any) assert.BoolOrComparison) poll.Check {
369 return func(poll.LogT) poll.Result {
370 t.Helper()
371 v, comment := f(t)
372 r := compare(v)
373 switch r := r.(type) {
374 case bool:
375 if r {
376 return poll.Success()
377 }
378 case is.Comparison:
379 if r().Success() {
380 return poll.Success()
381 }
382 default:
383 panic(fmt.Errorf("pollCheck: type %T not implemented", r))
384 }
385 return poll.Continue("%v", comment)
386 }
387}
388
389func reducedCheck(r reducer, funcs ...checkF) checkF {
390 return func(t *testing.T) (any, string) {

Calls 3

ErrorfMethod · 0.80
HelperMethod · 0.65
compareFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…