fix test_sync_manager
This commit is contained in:
parent
9325423a6b
commit
0e02eb4ce7
|
@ -582,7 +582,7 @@ proc syncStep[A, B](man: SyncManager[A, B], index: int, peer: A)
|
|||
if groupedDataColumns.isErr():
|
||||
peer.updateScore(PeerScoreNoValues)
|
||||
man.queue.push(req)
|
||||
# info "Received data columns is inconsistent",
|
||||
# warn "Received data columns is inconsistent",
|
||||
# data_columns_map = getShortMap(req, dataColumnData), request = req, msg=groupedDataColumns.error()
|
||||
return
|
||||
if (let checkRes = groupedDataColumns.get.checkDataColumns(); checkRes.isErr):
|
||||
|
|
|
@ -354,7 +354,7 @@ suite "SyncManager test suite":
|
|||
if request.isEmpty():
|
||||
break
|
||||
await queue.push(request, getSlice(chain, start, request),
|
||||
Opt.none(seq[BlobSidecars]))
|
||||
Opt.none(seq[BlobSidecars]), Opt.none(seq[DataColumnSidecars]))
|
||||
await validatorFut.cancelAndWait()
|
||||
|
||||
waitFor runSmokeTest()
|
||||
|
@ -429,7 +429,7 @@ suite "SyncManager test suite":
|
|||
var r13 = queue.pop(finishSlot, p3)
|
||||
|
||||
var f13 = queue.push(r13, chain.getSlice(startSlot, r13),
|
||||
Opt.none(seq[BlobSidecars]))
|
||||
Opt.none(seq[BlobSidecars]), Opt.none(seq[DataColumnSidecars]))
|
||||
await sleepAsync(100.milliseconds)
|
||||
check:
|
||||
f13.finished == false
|
||||
|
@ -438,7 +438,7 @@ suite "SyncManager test suite":
|
|||
of SyncQueueKind.Backward: counter == int(finishSlot)
|
||||
|
||||
var f11 = queue.push(r11, chain.getSlice(startSlot, r11),
|
||||
Opt.none(seq[BlobSidecars]))
|
||||
Opt.none(seq[BlobSidecars]), Opt.none(seq[DataColumnSidecars]))
|
||||
await sleepAsync(100.milliseconds)
|
||||
check:
|
||||
case kkind
|
||||
|
@ -448,7 +448,7 @@ suite "SyncManager test suite":
|
|||
f13.finished == false
|
||||
|
||||
var f12 = queue.push(r12, chain.getSlice(startSlot, r12),
|
||||
Opt.none(seq[BlobSidecars]))
|
||||
Opt.none(seq[BlobSidecars]), Opt.none(seq[DataColumnSidecars]))
|
||||
await allFutures(f11, f12, f13)
|
||||
check:
|
||||
f12.finished == true and f12.failed == false
|
||||
|
@ -551,7 +551,7 @@ suite "SyncManager test suite":
|
|||
check response[0][].slot >= getFowardSafeSlotCb()
|
||||
else:
|
||||
check response[^1][].slot <= getBackwardSafeSlotCb()
|
||||
await queue.push(request, response, Opt.none(seq[BlobSidecars]))
|
||||
await queue.push(request, response, Opt.none(seq[BlobSidecars]), Opt.none(seq[DataColumnSidecars]))
|
||||
await validatorFut.cancelAndWait()
|
||||
|
||||
waitFor runTest()
|
||||
|
@ -634,7 +634,7 @@ suite "SyncManager test suite":
|
|||
|
||||
# Handle request 1. Should be re-enqueued as it simulates `Invalid`.
|
||||
let response1 = getSlice(chain, start, request1)
|
||||
await queue.push(request1, response1, Opt.none(seq[BlobSidecars]))
|
||||
await queue.push(request1, response1, Opt.none(seq[BlobSidecars]), Opt.none(seq[DataColumnSidecars]))
|
||||
check debtLen(queue) == request2.count + request1.count
|
||||
|
||||
# Request 1 should be discarded as it is no longer relevant.
|
||||
|
@ -646,7 +646,7 @@ suite "SyncManager test suite":
|
|||
|
||||
# Handle request 3. Should be re-enqueued as it simulates `Invalid`.
|
||||
let response3 = getSlice(chain, start, request3)
|
||||
await queue.push(request3, response3, Opt.none(seq[BlobSidecars]))
|
||||
await queue.push(request3, response3, Opt.none(seq[BlobSidecars]), Opt.none(seq[DataColumnSidecars]))
|
||||
check debtLen(queue) == request3.count
|
||||
|
||||
# Request 2 should be re-issued.
|
||||
|
@ -660,7 +660,7 @@ suite "SyncManager test suite":
|
|||
|
||||
# Handle request 4. Should be re-enqueued as it simulates `Invalid`.
|
||||
let response4 = getSlice(chain, start, request4)
|
||||
await queue.push(request4, response4, Opt.none(seq[BlobSidecars]))
|
||||
await queue.push(request4, response4, Opt.none(seq[BlobSidecars]), Opt.none(seq[DataColumnSidecars]))
|
||||
check debtLen(queue) == request4.count
|
||||
|
||||
# Advance `safeSlot` out of band.
|
||||
|
@ -777,14 +777,14 @@ suite "SyncManager test suite":
|
|||
var r14 = queue.pop(finishSlot, p4)
|
||||
|
||||
var f14 = queue.push(r14, chain.getSlice(startSlot, r14),
|
||||
Opt.none(seq[BlobSidecars]))
|
||||
Opt.none(seq[BlobSidecars]), Opt.none(seq[DataColumnSidecars]))
|
||||
await sleepAsync(100.milliseconds)
|
||||
check:
|
||||
f14.finished == false
|
||||
counter == int(startSlot)
|
||||
|
||||
var f12 = queue.push(r12, chain.getSlice(startSlot, r12),
|
||||
Opt.none(seq[BlobSidecars]))
|
||||
Opt.none(seq[BlobSidecars]), Opt.none(seq[DataColumnSidecars]))
|
||||
await sleepAsync(100.milliseconds)
|
||||
check:
|
||||
counter == int(startSlot)
|
||||
|
@ -792,7 +792,7 @@ suite "SyncManager test suite":
|
|||
f14.finished == false
|
||||
|
||||
var f11 = queue.push(r11, chain.getSlice(startSlot, r11),
|
||||
Opt.none(seq[BlobSidecars]))
|
||||
Opt.none(seq[BlobSidecars]), Opt.none(seq[DataColumnSidecars]))
|
||||
await allFutures(f11, f12)
|
||||
check:
|
||||
counter == int(startSlot + chunkSize + chunkSize)
|
||||
|
@ -804,7 +804,7 @@ suite "SyncManager test suite":
|
|||
withBlck(missingSlice[0][]):
|
||||
forkyBlck.message.proposer_index = 0xDEADBEAF'u64
|
||||
var f13 = queue.push(r13, missingSlice,
|
||||
Opt.none(seq[BlobSidecars]))
|
||||
Opt.none(seq[BlobSidecars]), Opt.none(seq[DataColumnSidecars]))
|
||||
await allFutures(f13, f14)
|
||||
check:
|
||||
f11.finished == true and f11.failed == false
|
||||
|
@ -826,17 +826,17 @@ suite "SyncManager test suite":
|
|||
check r18.isEmpty() == true
|
||||
|
||||
var f17 = queue.push(r17, chain.getSlice(startSlot, r17),
|
||||
Opt.none(seq[BlobSidecars]))
|
||||
Opt.none(seq[BlobSidecars]), Opt.none(seq[DataColumnSidecars]))
|
||||
await sleepAsync(100.milliseconds)
|
||||
check f17.finished == false
|
||||
|
||||
var f16 = queue.push(r16, chain.getSlice(startSlot, r16),
|
||||
Opt.none(seq[BlobSidecars]))
|
||||
Opt.none(seq[BlobSidecars]), Opt.none(seq[DataColumnSidecars]))
|
||||
await sleepAsync(100.milliseconds)
|
||||
check f16.finished == false
|
||||
|
||||
var f15 = queue.push(r15, chain.getSlice(startSlot, r15),
|
||||
Opt.none(seq[BlobSidecars]))
|
||||
Opt.none(seq[BlobSidecars]), Opt.none(seq[DataColumnSidecars]))
|
||||
await allFutures(f15, f16, f17)
|
||||
check:
|
||||
f15.finished == true and f15.failed == false
|
||||
|
@ -883,7 +883,7 @@ suite "SyncManager test suite":
|
|||
|
||||
# Push a single request that will fail with all blocks being unviable
|
||||
var f11 = queue.push(r11, chain.getSlice(startSlot, r11),
|
||||
Opt.none(seq[BlobSidecars]))
|
||||
Opt.none(seq[BlobSidecars]), Opt.none(seq[DataColumnSidecars]))
|
||||
discard await f11.withTimeout(100.milliseconds)
|
||||
|
||||
check:
|
||||
|
@ -949,14 +949,14 @@ suite "SyncManager test suite":
|
|||
var r14 = queue.pop(finishSlot, p4)
|
||||
|
||||
var f14 = queue.push(r14, chain.getSlice(startSlot, r14),
|
||||
Opt.none(seq[BlobSidecars]))
|
||||
Opt.none(seq[BlobSidecars]), Opt.none(seq[DataColumnSidecars]))
|
||||
await sleepAsync(100.milliseconds)
|
||||
check:
|
||||
f14.finished == false
|
||||
counter == int(finishSlot)
|
||||
|
||||
var f12 = queue.push(r12, chain.getSlice(startSlot, r12),
|
||||
Opt.none(seq[BlobSidecars]))
|
||||
Opt.none(seq[BlobSidecars]), Opt.none(seq[DataColumnSidecars]))
|
||||
await sleepAsync(100.milliseconds)
|
||||
check:
|
||||
counter == int(finishSlot)
|
||||
|
@ -964,7 +964,7 @@ suite "SyncManager test suite":
|
|||
f14.finished == false
|
||||
|
||||
var f11 = queue.push(r11, chain.getSlice(startSlot, r11),
|
||||
Opt.none(seq[BlobSidecars]))
|
||||
Opt.none(seq[BlobSidecars]), Opt.none(seq[DataColumnSidecars]))
|
||||
await allFutures(f11, f12)
|
||||
check:
|
||||
counter == int(finishSlot - chunkSize - chunkSize)
|
||||
|
@ -975,7 +975,7 @@ suite "SyncManager test suite":
|
|||
var missingSlice = chain.getSlice(startSlot, r13)
|
||||
withBlck(missingSlice[0][]):
|
||||
forkyBlck.message.proposer_index = 0xDEADBEAF'u64
|
||||
var f13 = queue.push(r13, missingSlice, Opt.none(seq[BlobSidecars]))
|
||||
var f13 = queue.push(r13, missingSlice, Opt.none(seq[BlobSidecars]), Opt.none(seq[DataColumnSidecars]))
|
||||
await allFutures(f13, f14)
|
||||
check:
|
||||
f11.finished == true and f11.failed == false
|
||||
|
@ -993,12 +993,12 @@ suite "SyncManager test suite":
|
|||
check r17.isEmpty() == true
|
||||
|
||||
var f16 = queue.push(r16, chain.getSlice(startSlot, r16),
|
||||
Opt.none(seq[BlobSidecars]))
|
||||
Opt.none(seq[BlobSidecars]), Opt.none(seq[DataColumnSidecars]))
|
||||
await sleepAsync(100.milliseconds)
|
||||
check f16.finished == false
|
||||
|
||||
var f15 = queue.push(r15, chain.getSlice(startSlot, r15),
|
||||
Opt.none(seq[BlobSidecars]))
|
||||
Opt.none(seq[BlobSidecars]), Opt.none(seq[DataColumnSidecars]))
|
||||
await allFutures(f15, f16)
|
||||
check:
|
||||
f15.finished == true and f15.failed == false
|
||||
|
|
Loading…
Reference in New Issue