mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-08 23:18:15 -05:00
Fix initialization race (#12374)
* block all the sync startup code on init signal * don't need chainStarted if everything blocks * set empty clock by default to work around panics * remove unused clock, zero-value for init-sync --------- Co-authored-by: Kasey Kirkham <kasey@users.noreply.github.com> Co-authored-by: Nishant Das <nishdas93@gmail.com>
This commit is contained in:
@@ -552,7 +552,6 @@ func TestBlocksFetcher_RequestBlocksRateLimitingLocks(t *testing.T) {
|
||||
gt := time.Now()
|
||||
vr := [32]byte{}
|
||||
fetcher.chain = &mock.ChainService{Genesis: gt, ValidatorsRoot: vr}
|
||||
fetcher.clock = startup.NewClock(gt, vr)
|
||||
hook := logTest.NewGlobal()
|
||||
wg := new(sync.WaitGroup)
|
||||
wg.Add(1)
|
||||
@@ -621,7 +620,6 @@ func TestBlocksFetcher_WaitForBandwidth(t *testing.T) {
|
||||
gt := time.Now()
|
||||
vr := [32]byte{}
|
||||
fetcher.chain = &mock.ChainService{Genesis: gt, ValidatorsRoot: vr}
|
||||
fetcher.clock = startup.NewClock(gt, vr)
|
||||
start := time.Now()
|
||||
assert.NoError(t, fetcher.waitForBandwidth(p2.PeerID(), 10))
|
||||
dur := time.Since(start)
|
||||
|
||||
Reference in New Issue
Block a user