MCPcopy Create free account
hub / github.com/TheThingsNetwork/lorawan-stack / TestWorkerPool

Function TestWorkerPool

pkg/workerpool/workerpool_test.go:104–124  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

102)
103
104func TestWorkerPool(t *testing.T) {
105 for _, workerIdleTimeout := range []time.Duration{slowTimeout, fastTimeout} {
106 for _, queueSize := range []int{-1, 0, 1} {
107 for _, minWorkers := range []int{-1, 0, 1} {
108 for _, maxWorkers := range []int{0, 1} {
109 name := fmt.Sprintf(
110 "minWorkers/%v/maxWorkers/%v/queueSize/%v/idleTimeout/%v",
111 minWorkers,
112 maxWorkers,
113 queueSize,
114 workerIdleTimeout,
115 )
116 t.Run(name, func(t *testing.T) {
117 t.Parallel()
118 testWorkerPool(t, minWorkers, maxWorkers, queueSize, workerIdleTimeout)
119 })
120 }
121 }
122 }
123 }
124}
125
126func testWorkerPool(t *testing.T, minWorkers int, maxWorkers int, queueSize int, workerIdleTimeout time.Duration) {
127 a, ctx := test.New(t)

Callers

nothing calls this directly

Calls 2

testWorkerPoolFunction · 0.85
RunMethod · 0.65

Tested by

no test coverage detected