MCPcopy Index your code
hub / github.com/riverqueue/river / newPilotWithPlugin

Function newPilotWithPlugin

plugin_test.go:143–170  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

141}
142
143func newPilotWithPlugin(t *testing.T) *TestPilotWithPlugin {
144 t.Helper()
145
146 newService := func(name string) startstop.Service {
147 return startstop.StartStopFunc(func(ctx context.Context, shouldStart bool, started, stopped func()) error {
148 if !shouldStart {
149 return nil
150 }
151
152 go func() {
153 started()
154 defer stopped() // this defer should come first so it's last out
155
156 t.Logf("Test service started: %s", name)
157
158 <-ctx.Done()
159 }()
160
161 return nil
162 })
163 }
164
165 return &TestPilotWithPlugin{
166 StandardPilot: riverpilot.StandardPilot{},
167 maintenanceService: newService("maintenance service"),
168 service: newService("other service"),
169 }
170}
171
172func (d *TestPilotWithPlugin) PluginMaintenanceServices() []startstop.Service {
173 return []startstop.Service{d.maintenanceService}

Callers 1

TestClientPilotPluginFunction · 0.85

Calls 4

StartStopFuncFunction · 0.92
DoneMethod · 0.80
HelperMethod · 0.65
LogfMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…