You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Introduced in ee703e2 (a [wip] ci: commit). As a result go test ./node/app/component/ reports ok while running zero tests — including the gomock lifecycle tests, event_flow_test.go, the fuzz tests, and all of hierarchy_test.go.
Why it can't simply be re-enabled yet
Switching to os.Exit(m.Run()) and running under -race / repeated counts exposes:
TestEvents is flaky — c.EventBus("t") returns a shared/global bus whose subscriptions are not torn down between tests, so bus.Post("test") returns 3/5/7… instead of 2 as leaked handlers from earlier tests accumulate (component_test.go:652).
Goroutine leak → deadlock — under -race -count=20 the suite times out with ~464 leaked goroutines: ~397 component actor goroutines (component.go:320/:465) blocked on chan receive (never shut down), plus workerpool/event workers blocked on chan send. The execpool saturates and the run hangs.
Items 2 and 3 share a root cause: a test-isolation / lifecycle-teardown gap — components and their event subscriptions/goroutines are not cleaned up between tests (and/or a shared root bus persists global state across tests).
Suggested direction
Give each test isolated component-domain/bus state, and/or ensure domain Close() stops all actor goroutines and clears subscriptions, with t.Cleanup in the tests.
Once the suite is race-clean and leak-free under repeated -race runs, replace os.Exit(0) with os.Exit(m.Run()).
Context
Found while reviewing #21455 (unskip disabled tests). That PR leaves the three gomock lifecycle tests skipped and does not touch TestMain; this issue tracks turning the package back on properly.
Summary
The entire
node/app/componenttest package never runs:TestMaincallsos.Exit(0)withoutm.Run().Introduced in ee703e2 (a
[wip] ci:commit). As a resultgo test ./node/app/component/reportsokwhile running zero tests — including the gomock lifecycle tests,event_flow_test.go, the fuzz tests, and all ofhierarchy_test.go.Why it can't simply be re-enabled yet
Switching to
os.Exit(m.Run())and running under-race/ repeated counts exposes:eventBus.prevQueueSize— ✅ fixed in node/app/event: fix data race on eventBus.prevQueueSize #21551.TestEventsis flaky —c.EventBus("t")returns a shared/global bus whose subscriptions are not torn down between tests, sobus.Post("test")returns 3/5/7… instead of 2 as leaked handlers from earlier tests accumulate (component_test.go:652).-race -count=20the suite times out with ~464 leaked goroutines: ~397 component actor goroutines (component.go:320/:465) blocked onchan receive(never shut down), plus workerpool/event workers blocked onchan send. The execpool saturates and the run hangs.Items 2 and 3 share a root cause: a test-isolation / lifecycle-teardown gap — components and their event subscriptions/goroutines are not cleaned up between tests (and/or a shared root bus persists global state across tests).
Suggested direction
Close()stops all actor goroutines and clears subscriptions, witht.Cleanupin the tests.-raceruns, replaceos.Exit(0)withos.Exit(m.Run()).Context
Found while reviewing #21455 (unskip disabled tests). That PR leaves the three gomock lifecycle tests skipped and does not touch
TestMain; this issue tracks turning the package back on properly.cc @AskAlexSharov (introduced the
os.Exit(0)in ee703e2)