MCPcopy Index your code
hub / github.com/tailscale/tailscale / TestExecQueue

Function TestExecQueue

util/execqueue/execqueue_test.go:12–22  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

10)
11
12func TestExecQueue(t *testing.T) {
13 ctx := context.Background()
14 var n atomic.Int32
15 q := &ExecQueue{}
16 defer q.Shutdown()
17 q.Add(func() { n.Add(1) })
18 q.Wait(ctx)
19 if got := n.Load(); got != 1 {
20 t.Errorf("n=%d; want 1", got)
21 }
22}
23
24// Test that RunSync doesn't hold q.mu and block Shutdown
25// as we saw in tailscale/tailscale#18502

Callers

nothing calls this directly

Calls 6

ShutdownMethod · 0.95
AddMethod · 0.95
WaitMethod · 0.95
AddMethod · 0.65
LoadMethod · 0.65
ErrorfMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…