MCPcopy
hub / github.com/moby/moby / TestPluginAddHandler

Function TestPluginAddHandler

pkg/plugins/plugin_test.go:28–40  ·  view source on GitHub ↗

regression test for deadlock in handlers

(t *testing.T)

Source from the content-addressed store, hash-verified

26
27// regression test for deadlock in handlers
28func TestPluginAddHandler(t *testing.T) {
29 t.Parallel()
30 // make a plugin which is pre-activated
31 p := &Plugin{activateWait: sync.NewCond(&sync.Mutex{})}
32 p.Manifest = &Manifest{Implements: []string{"bananas"}}
33 storage.Lock()
34 storage.plugins["qwerty"] = p
35 storage.Unlock()
36
37 testActive(t, p)
38 Handle("bananas", func(_ string, _ *Client) {})
39 testActive(t, p)
40}
41
42func TestPluginWaitBadPlugin(t *testing.T) {
43 p := &Plugin{activateWait: sync.NewCond(&sync.Mutex{})}

Callers

nothing calls this directly

Calls 4

testActiveFunction · 0.85
UnlockMethod · 0.80
HandleFunction · 0.70
LockMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…