`noCancel` in `test_gossip_validation` (#5907)

To avoid spurious warnings, mark futures that are not cancelled by test
as such when waiting for them. Variable rename is for max line length.
This commit is contained in:
Etan Kissling 2024-02-18 01:40:15 +01:00 committed by GitHub
parent e7d2ee7cb6
commit bf882887bd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 5 deletions

View File

@ -5,6 +5,7 @@
# * Apache v2 license (license terms in the root directory or at https://www.apache.org/licenses/LICENSE-2.0).
# at your option. This file may not be copied, modified, or distributed except according to those terms.
{.push raises: [].}
{.used.}
import
@ -332,7 +333,7 @@ suite "Gossip validation - Altair":
(validator, _, msg) = dag.getSyncCommitteeMessage(
slot, subcommitteeIdx, indexInSubcommittee,
signatureSlot = Opt.some(signatureSlot))
msgVerdict = waitFor dag.validateSyncCommitteeMessage(
msgVerdict = waitFor noCancel dag.validateSyncCommitteeMessage(
quarantine, batchCrypto, syncCommitteePool,
msg, subcommitteeIdx, slot.start_beacon_time(),
checkSignature = true)
@ -372,15 +373,15 @@ suite "Gossip validation - Altair":
contrib.message.contribution)
syncCommitteePool[].addContribution(
contrib[], bid, contrib.message.contribution.signature.load.get)
let signRes = waitFor validator.getContributionAndProofSignature(
let res = waitFor noCancel validator.getContributionAndProofSignature(
getStateField(dag.headState, fork),
getStateField(dag.headState, genesis_validators_root),
contrib[].message)
doAssert(signRes.isOk())
contrib[].signature = signRes.get()
doAssert(res.isOk())
contrib[].signature = res.get()
contrib
syncCommitteePool[] = SyncCommitteeMsgPool.init(rng, cfg)
let contribVerdict = waitFor dag.validateContribution(
let contribVerdict = waitFor noCancel dag.validateContribution(
quarantine, batchCrypto, syncCommitteePool,
contrib[], slot.start_beacon_time(),
checkSignature = true)