Skip to content

Commit 76339e5

Browse files
lklimekclaude
andcommitted
test(e2e): re-confirm contest poll exists immediately before voting in TC-090
Add a second `wait_for_dpns_contest` call (step 2c) between the initial "contest created" precheck and the actual `VoteOnDPNSNames` dispatch. Belt-and-suspenders against poll cleanup between DPNS registration and voting — e.g. on testnets with short voting windows, or if an earlier vote already resolved the contest while the test was still setting up. The first precheck (step 2b) stays on a 30 s budget; the new step 2c uses a 5 s budget since it's a single query — enough to confirm the poll is still live without adding meaningful runtime to the happy path. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent d17cfae commit 76339e5

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

tests/backend-e2e/masternode_identity_tasks.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -499,6 +499,20 @@ async fn tc_090_vote_with_mn_voter() {
499499
)
500500
.await;
501501

502+
// Step 2c: Re-confirm the contest is still live immediately before voting.
503+
// Step 2b proves the poll was ever created; this second, short check
504+
// (single query, 5 s cap) catches poll cleanup between registration and
505+
// voting — e.g. on testnets with short voting windows, or if an earlier
506+
// vote already resolved the contest. Cheap belt-and-suspenders against
507+
// opaque vote timeouts.
508+
tracing::info!(name = %name, "re-confirming contest is live before voting");
509+
wait_for_dpns_contest(
510+
&ctx.app_context.sdk(),
511+
&name,
512+
std::time::Duration::from_secs(5),
513+
)
514+
.await;
515+
502516
// Step 3: Vote Lock on the contested name using the MN voter identity.
503517
tracing::info!(name = %name, "voting Lock with MN voter");
504518

0 commit comments

Comments
 (0)