MCPcopy
hub / github.com/lxc/incus / TestGroup_Add

Function TestGroup_Add

internal/server/task/group_test.go:13–23  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

11)
12
13func TestGroup_Add(t *testing.T) {
14 group := &task.Group{}
15 ok := make(chan struct{})
16 f := func(context.Context) { close(ok) }
17 group.Add(f, task.Every(time.Second))
18 group.Start(context.Background())
19
20 assertRecv(t, ok)
21
22 assert.NoError(t, group.Stop(time.Second))
23}
24
25func TestGroup_StopUngracefully(t *testing.T) {
26 group := &task.Group{}

Callers

nothing calls this directly

Calls 5

AddMethod · 0.95
StartMethod · 0.95
StopMethod · 0.95
EveryFunction · 0.92
assertRecvFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…