test: wait for completed re-poll finality

Co-authored-by: Hanzo Dev <[email protected]>
This commit is contained in:
2026-08-21 18:18:00 -07:00
co-authored by Hanzo Dev
parent 908e624b92
commit 5c5cf340cc
+5 -7
View File
@@ -365,15 +365,13 @@ func TestVoteRepollPreventsStall(t *testing.T) {
}
// The re-poll loop (interval RoundTO=5ms) must issue a SECOND RequestVotes,
// which delivers the peer votes → quorum → real α-of-K cert → VM.Accept. Wait
// on VM.Accept (the actual finalization), not just consensus.IsAccepted, since
// the VM commit follows the count flip by a hair.
if !waitFor(2*time.Second, func() bool { return blk.AcceptCalled() >= 1 }) {
// which delivers the peer votes → quorum → real α-of-K cert → VM.Accept. The
// engine publishes IsAccepted only after VM.Accept returns successfully, so
// wait for that completed commit rather than observing the mock from inside
// its Accept call.
if !waitFor(2*time.Second, func() bool { return proposer.IsAccepted(blk.id) }) {
t.Fatal("WEDGE: re-poll did not recover the stalled block — no second RequestVotes was issued")
}
if !proposer.IsAccepted(blk.id) {
t.Fatal("block must be marked accepted after re-poll recovery")
}
// Recovery MUST have come from a re-poll (second+ RequestVotes), proving the
// fix is what unstuck it — not the dropped first poll.
if rp.pollCount() < 2 {