MCPcopy Create free account
hub / github.com/ethstorage/es-node / TestMultiSync

Function TestMultiSync

ethstorage/p2p/protocol/sync_test.go:879–897  ·  view source on GitHub ↗

TestMultiSync test sync process with local node support two shards and sync shard data from two remote peers, it should be sync done.

(t *testing.T)

Source from the content-addressed store, hash-verified

877// TestMultiSync test sync process with local node support two shards and sync shard data from two remote peers,
878// it should be sync done.
879func TestMultiSync(t *testing.T) {
880 var (
881 kvSize = defaultChunkSize
882 kvEntries = uint64(16)
883 lastKvIndex = uint64(32)
884 )
885 remotePeers := []*remotePeer{
886 {
887 shards: []uint64{0},
888 excludedList: make(map[uint64]struct{}),
889 },
890 {
891 shards: []uint64{1},
892 excludedList: make(map[uint64]struct{}),
893 },
894 }
895
896 testSync(t, defaultChunkSize, kvSize, kvEntries, []uint64{0, 1}, lastKvIndex, defaultEncodeType, 4, remotePeers, true)
897}
898
899// TestSyncWithFewerResult test sync process with shard which is not full (lastKvIndex < kvSize), it should be sync done.
900func TestSyncWithFewerResult(t *testing.T) {

Callers

nothing calls this directly

Calls 1

testSyncFunction · 0.85

Tested by

no test coverage detected