mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-11 04:00:05 +00:00
Fix More Racy Tests in Blockchain (#12957)
This commit is contained in:
parent
3394bbe359
commit
42c192d97d
@ -180,6 +180,7 @@ func TestService_ReceiveBlockUpdateHead(t *testing.T) {
|
|||||||
wg.Done()
|
wg.Done()
|
||||||
}()
|
}()
|
||||||
wg.Wait()
|
wg.Wait()
|
||||||
|
time.Sleep(100 * time.Millisecond)
|
||||||
if recvd := len(s.cfg.StateNotifier.(*blockchainTesting.MockStateNotifier).ReceivedEvents()); recvd < 1 {
|
if recvd := len(s.cfg.StateNotifier.(*blockchainTesting.MockStateNotifier).ReceivedEvents()); recvd < 1 {
|
||||||
t.Errorf("Received %d state notifications, expected at least 1", recvd)
|
t.Errorf("Received %d state notifications, expected at least 1", recvd)
|
||||||
}
|
}
|
||||||
@ -222,6 +223,7 @@ func TestService_ReceiveBlockBatch(t *testing.T) {
|
|||||||
block: genFullBlock(t, util.DefaultBlockGenConfig(), 1 /*slot*/),
|
block: genFullBlock(t, util.DefaultBlockGenConfig(), 1 /*slot*/),
|
||||||
},
|
},
|
||||||
check: func(t *testing.T, s *Service) {
|
check: func(t *testing.T, s *Service) {
|
||||||
|
time.Sleep(100 * time.Millisecond)
|
||||||
if recvd := len(s.cfg.StateNotifier.(*blockchainTesting.MockStateNotifier).ReceivedEvents()); recvd < 1 {
|
if recvd := len(s.cfg.StateNotifier.(*blockchainTesting.MockStateNotifier).ReceivedEvents()); recvd < 1 {
|
||||||
t.Errorf("Received %d state notifications, expected at least 1", recvd)
|
t.Errorf("Received %d state notifications, expected at least 1", recvd)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user