Removed wg from worker start. Fixed various races.

This commit is contained in:
Jay
2026-04-20 17:54:03 -04:00
parent aaf8571b9f
commit 2c7b22b3d9
8 changed files with 72 additions and 43 deletions
+28 -7
View File
@@ -62,7 +62,10 @@ func TestWorkerStart(t *testing.T) {
var wg sync.WaitGroup
wg.Add(1)
go w.Start(pool, &wg)
go func() {
w.Start(pool)
wg.Done()
}()
honeybeetest.Eventually(t, func() bool {
select {
@@ -85,7 +88,10 @@ func TestWorkerStart(t *testing.T) {
var wg sync.WaitGroup
wg.Add(1)
go w.Start(pool, &wg)
go func() {
w.Start(pool)
wg.Done()
}()
honeybeetest.Eventually(t, func() bool {
select {
@@ -135,7 +141,10 @@ func TestWorkerStart(t *testing.T) {
var wg sync.WaitGroup
wg.Add(1)
go w.Start(pool, &wg)
go func() {
w.Start(pool)
wg.Done()
}()
honeybeetest.Eventually(t, func() bool {
select {
@@ -172,7 +181,10 @@ func TestWorkerStart(t *testing.T) {
var wg sync.WaitGroup
wg.Add(1)
go w.Start(pool, &wg)
go func() {
w.Start(pool)
wg.Done()
}()
honeybeetest.Eventually(t, func() bool {
select {
@@ -215,7 +227,10 @@ func TestWorkerStart(t *testing.T) {
var wg sync.WaitGroup
wg.Add(1)
go w.Start(pool, &wg)
go func() {
w.Start(pool)
wg.Done()
}()
honeybeetest.Eventually(t, func() bool {
select {
@@ -260,7 +275,10 @@ func TestWorkerStart(t *testing.T) {
var wg sync.WaitGroup
wg.Add(1)
go w.Start(pool, &wg)
go func() {
w.Start(pool)
wg.Done()
}()
honeybeetest.Eventually(t, func() bool {
select {
@@ -302,7 +320,10 @@ func TestWorkerStart(t *testing.T) {
var wg sync.WaitGroup
wg.Add(1)
go w.Start(pool, &wg)
go func() {
w.Start(pool)
wg.Done()
}()
honeybeetest.Eventually(t, func() bool {
select {