MCPcopy
hub / github.com/containerd/containerd / checkNodes

Function checkNodes

core/metadata/gc_test.go:736–751  ·  view source on GitHub ↗
(ctx context.Context, t *testing.T, db *bolt.DB, expected []gc.Node, fn func(context.Context, *bolt.Tx, func(context.Context, gc.Node) error) error)

Source from the content-addressed store, hash-verified

734}
735
736func checkNodes(ctx context.Context, t *testing.T, db *bolt.DB, expected []gc.Node, fn func(context.Context, *bolt.Tx, func(context.Context, gc.Node) error) error) {
737 t.Helper()
738 var actual []gc.Node
739 scanFn := func(ctx context.Context, n gc.Node) error {
740 actual = append(actual, n)
741 return nil
742 }
743
744 if err := db.View(func(tx *bolt.Tx) error {
745 return fn(ctx, tx, scanFn)
746 }); err != nil {
747 t.Fatal(err)
748 }
749
750 checkNodesEqual(t, actual, expected)
751}
752
753func checkNodesEqual(t *testing.T, n1, n2 []gc.Node) {
754 t.Helper()

Callers 2

TestGCRemoveFunction · 0.85
TestCollectibleResourcesFunction · 0.85

Calls 3

checkNodesEqualFunction · 0.85
FatalMethod · 0.80
ViewMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…