This commit is contained in:
Jared Wasinger 2024-03-26 17:40:21 -07:00
parent 6986095f81
commit 1a4887bd43
2 changed files with 2 additions and 9 deletions

View file

@ -1332,14 +1332,13 @@ func testBeaconForkedSyncProgress(t *testing.T, protocol uint, mode SyncMode) {
defer tester.terminate()
chainA := testChainForkLightA.shorten(len(testChainBase.blocks) + MaxHeaderFetch)
chainB := testChainForkHigher.shorten(len(testChainBase.blocks) + MaxHeaderFetch)
chainB := testChainForkLightB.shorten(len(testChainBase.blocks) + MaxHeaderFetch)
// Set a sync init hook to catch progress changes
starting := make(chan struct{})
progress := make(chan struct{})
tester.downloader.syncInitHook = func(origin, latest uint64) {
fmt.Println("sync init")
starting <- struct{}{}
<-progress
}
@ -1368,7 +1367,6 @@ func testBeaconForkedSyncProgress(t *testing.T, protocol uint, mode SyncMode) {
t.Fatalf("Failed to sync chain in three seconds")
}
fmt.Println("jump in")
log.SetDefault(log.NewLogger(log.NewTerminalHandlerWithLevel(os.Stdout, log.LevelInfo, false)))
// Set the head to a second fork (which forks after the origin of the last sync cycle
tester.newPeer("fork B", protocol, chainB.blocks[1:])

View file

@ -53,9 +53,6 @@ var testChainBase *testChain
// Different forks on top of the base chain:
var testChainForkLightA, testChainForkLightB, testChainForkHeavy *testChain
// Fork from base chain, fork occurs 10 blocks later than other forks
var testChainForkHigher *testChain
var pregenerated bool
func init() {
@ -72,11 +69,10 @@ func init() {
var wg sync.WaitGroup
// Generate the test chains to seed the peers with
wg.Add(4)
wg.Add(3)
go func() { testChainForkLightA = testChainBase.makeFork(forkLen, false, 1); wg.Done() }()
go func() { testChainForkLightB = testChainBase.makeFork(forkLen, false, 2); wg.Done() }()
go func() { testChainForkHeavy = testChainBase.makeFork(forkLen, true, 3); wg.Done() }()
go func() { testChainForkHigher = testChainBase.makeFork(forkLen-10, false, 3); wg.Done() }()
wg.Wait()
// Generate the test peers used by the tests to avoid overloading during testing.
@ -107,7 +103,6 @@ func init() {
testChainForkLightA.shorten(len(testChainBase.blocks) + MaxHeaderFetch),
testChainForkLightB.shorten(len(testChainBase.blocks) + MaxHeaderFetch),
testChainForkHeavy.shorten(len(testChainBase.blocks) + 79),
testChainForkHigher.shorten(len(testChainBase.blocks) + MaxHeaderFetch),
}
wg.Add(len(chains))
for _, chain := range chains {