You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: worker_pool_test.go
    path of file: ./repos/rudder-server/utils/workerpool
    
    the code of the file until where you have to start completion: package workerpool

import (
	"context"
	"strconv"
	"sync"
	"testing"
	"time"

	"github.com/stretchr/testify/require"

	"github.com/rudderlabs/rudder-go-kit/logger"
)

func TestWorkerPool(t *testing.T) {
	var wor
    
func TestWorkerPool(t *testing.T) {
	var workersMu sync.Mutex
	var workers []*mockWorker

	ctx, cancel := context.WithCancel(context.Background())
	poolCtx, poolCancel := context.WithCancel(context.Background())
	defer poolCancel()

	// create a worker pool
	wp := New(poolCtx,
		func(partition string) Worker {
			workersMu.Lock()
			defer workersMu.Unlock()
			w := &mockWorker{
				partition: partition,
				idleAfter: 100 * time.Millisecond,
			}
			workers = append(workers, w)
			return w
		},
		logger.NOP)

	// start pinging for work for 100 partitions
	var wg sync.WaitGroup
	for i := 0; i < 100; i++ {
		partition := "p-" + strconv.Itoa(i)
		wg.Add(1)
		go func() {
			defer wg.Done()
			for {
				select {
				case <-ctx.Done():
					return
				case <-time.After(10 * time.Millisecond):
					wp.PingWorker(partition)
				}
			}
		}()
	}

	// stop pinging after 5 seconds
	time.Sleep(5 * time.Second)
	cancel()
	wg.Wait()

	// wait for all workers to finish
	wp.Shutdown()
	require.Len(t, workers, 100)
	for _, w := range workers {
		require.True(t, w.stopped)
	}
}