File tree Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -311,7 +311,6 @@ func TestHandlerDropsGossipDuringBootstrapping(t *testing.T) {
311
311
func TestHandlerDispatchInternal (t * testing.T ) {
312
312
require := require .New (t )
313
313
314
- calledNotify := make (chan struct {}, 1 )
315
314
ctx := snow .DefaultConsensusContextTest ()
316
315
msgFromVMChan := make (chan common.Message )
317
316
vdrs := validators .NewSet ()
@@ -352,8 +351,10 @@ func TestHandlerDispatchInternal(t *testing.T) {
352
351
engine .ContextF = func () * snow.ConsensusContext {
353
352
return ctx
354
353
}
354
+
355
+ wg := & sync.WaitGroup {}
355
356
engine .NotifyF = func (context.Context , common.Message ) error {
356
- calledNotify <- struct {}{}
357
+ wg . Done ()
357
358
return nil
358
359
}
359
360
@@ -373,14 +374,10 @@ func TestHandlerDispatchInternal(t *testing.T) {
373
374
return nil
374
375
}
375
376
377
+ wg .Add (1 )
376
378
handler .Start (context .Background (), false )
377
379
msgFromVMChan <- 0
378
-
379
- select {
380
- case <- time .After (20 * time .Millisecond ):
381
- require .FailNow ("should have called notify" )
382
- case <- calledNotify :
383
- }
380
+ wg .Wait ()
384
381
}
385
382
386
383
func TestHandlerSubnetConnector (t * testing.T ) {
You can’t perform that action at this time.
0 commit comments