<commit_before>package pool

import (
	"os"
	"testing"
)

func must(err error, t *testing.T) {
	if err != nil {
		t.Fatal(err)
	}
}

func TestMain(m *testing.M) {
	os.Exit(m.Run())
}

func TestPool(t *testing.T) {
	testDrives := 100000

	f := func() (interface{}, error) {
		return 1, nil
	}

	for i := 0; i < testDrives; i++ {
		workerPool, err := NewWorkerPool(8)
		if err != nil {
			panic(err)
		}

		const iterationCount = 100
		var processed int

		resultHandler := func(result interface{}) {
			processed += result.(int)
		}

		errorHandler := func(err error) {
			t.Fatal(err)
		}

		workerPool.AddHandlers(resultHandler, errorHandler)

		for i := 0; i < iterationCount; i++ {
			workerPool.AddFuncWithResult(f)
			workerPool.AddJob(Job{
				Function: func(args ...interface{}) (interface{}, error) {
					return nil, nil
				},
				Arguments: []interface{}{1,2,3,4},
			})
		}
<commit_msg>removes unwanted function call from test<commit_after>package pool

import (
	"os"
	"testing"
)

func must(err error, t *testing.T) {
	if err != nil {
		t.Fatal(err)
	}
}

func TestMain(m *testing.M) {
	os.Exit(m.Run())
}

func TestPool(t *testing.T) {
	testDrives := 100000

	f := func() (interface{}, error) {
		return 1, nil
	}

	for i := 0; i < testDrives; i++ {
		workerPool, err := NewWorkerPool(8)
		if err != nil {
			panic(err)
		}

		const iterationCount = 100
		var processed int

		resultHandler := func(result interface{}) {
			processed += result.(int)
		}

		errorHandler := func(err error) {
			t.Fatal(err)
		}

		workerPool.AddHandlers(resultHandler, errorHandler)

		for i := 0; i < iterationCount; i++ {
			workerPool.AddFuncWithResult(f)
		}

{'fraction_non_alphanumeric': 0.1547260686333534, 'fraction_numerical': 0.018061408789885613, 'mean_word_length': 3.294573643410853, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5848011', 'n_tokens_mistral': 718, 'n_tokens_neox': 607, 'n_words': 150}