@@ -20,7 +20,7 @@ func TestGoroutineManager(t *testing.T) {
2020
2121 taskChan := make (chan struct {})
2222
23- require .NoError (t , m .Go (func (ctx context.Context ) {
23+ require .True (t , m .Go (func (ctx context.Context ) {
2424 <- taskChan
2525 }))
2626
@@ -38,7 +38,7 @@ func TestGoroutineManager(t *testing.T) {
3838 require .Greater (t , stopDelay , time .Second )
3939
4040 // Make sure new goroutines do not start after Stop.
41- require .ErrorIs (t , m .Go (func (ctx context.Context ) {}), ErrStopping )
41+ require .False (t , m .Go (func (ctx context.Context ) {}))
4242
4343 // When Stop() is called, the internal context expires and m.Done() is
4444 // closed. Test this.
@@ -57,7 +57,7 @@ func TestGoroutineManagerContextExpires(t *testing.T) {
5757
5858 m := NewGoroutineManager (ctx )
5959
60- require .NoError (t , m .Go (func (ctx context.Context ) {
60+ require .True (t , m .Go (func (ctx context.Context ) {
6161 <- ctx .Done ()
6262 }))
6363
@@ -80,7 +80,7 @@ func TestGoroutineManagerContextExpires(t *testing.T) {
8080 }
8181
8282 // Make sure new goroutines do not start after context expiry.
83- require .ErrorIs (t , m .Go (func (ctx context.Context ) {}), ErrStopping )
83+ require .False (t , m .Go (func (ctx context.Context ) {}))
8484
8585 // Stop will wait for all goroutines to stop.
8686 m .Stop ()
@@ -108,11 +108,11 @@ func TestGoroutineManagerStress(t *testing.T) {
108108 // implementation, this test crashes under `-race`.
109109 for i := 0 ; i < 100 ; i ++ {
110110 taskChan := make (chan struct {})
111- err := m .Go (func (ctx context.Context ) {
111+ ok := m .Go (func (ctx context.Context ) {
112112 close (taskChan )
113113 })
114114 // If goroutine was started, wait for its completion.
115- if err == nil {
115+ if ok {
116116 <- taskChan
117117 }
118118 }
@@ -134,10 +134,10 @@ func TestGoroutineManagerStopsStress(t *testing.T) {
134134 jobChan := make (chan struct {})
135135
136136 // Start a task and wait inside it until we start calling Stop() method.
137- err := m .Go (func (ctx context.Context ) {
137+ ok := m .Go (func (ctx context.Context ) {
138138 <- jobChan
139139 })
140- require .NoError (t , err )
140+ require .True (t , ok )
141141
142142 // Now launch many gorotines calling Stop() method in parallel.
143143 var wg sync.WaitGroup
0 commit comments