File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -162,15 +162,15 @@ func TestShutdown_StopsJob(t *testing.T) {
162162// TestShutdown_WaitsForCompletion - Shutdown() waits for goroutine to finish
163163func TestShutdown_WaitsForCompletion (t * testing.T ) {
164164 var wg sync.WaitGroup
165- goroutineFinished := false
165+ var goroutineFinished atomic. Bool
166166
167167 svc := new (MockHeartbeatService )
168168
169169 job := NewWithConfig (HeartbeatJobConfig {
170170 Trigger : func (ctx context.Context , fn func () error ) {
171171 <- ctx .Done ()
172172 time .Sleep (20 * time .Millisecond )
173- goroutineFinished = true
173+ goroutineFinished . Store ( true )
174174 },
175175 })
176176
@@ -184,5 +184,5 @@ func TestShutdown_WaitsForCompletion(t *testing.T) {
184184 }()
185185
186186 wg .Wait ()
187- assert .True (t , goroutineFinished )
187+ assert .True (t , goroutineFinished . Load () )
188188}
You can’t perform that action at this time.
0 commit comments