Skip to content

Commit 57b4e05

Browse files
authored
Merge pull request #3616 from tsachiherman/tsachi/fixTestParticipationAccountsExpirationNonFuture
## Summary This test had a bug, where it was sending a transaction to one node2, waiting for the transaction to be included in a block on node1, and then pulling the account data from node2. Since the test failed to wait for node2 to be at the same round as node1, there is no guarantee that the account data fetched from node2 is the same as the account data that was just updated in the block. Separately from that, the `fixture.WaitForTxnConfirmation` call was not tested for its return value. ## Test Plan Use Circle-CI.
2 parents 53b157b + 377910d commit 57b4e05

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

test/e2e-go/features/participation/participationExpiration_test.go

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -110,14 +110,24 @@ func testExpirationAccounts(t *testing.T, fixture *fixtures.RestClientFixture, f
110110
a.NoError(err)
111111
seededRound := sNodeStatus.LastRound
112112

113-
fixture.WaitForTxnConfirmation(seededRound+maxRoundsToWaitForTxnConfirm, sAccount, onlineTxID)
114-
sNodeStatus, _ = sClient.Status()
113+
txnConfirmed := fixture.WaitForTxnConfirmation(seededRound+maxRoundsToWaitForTxnConfirm, sAccount, onlineTxID)
114+
a.True(txnConfirmed)
115+
115116
newAccountStatus, err = pClient.AccountInformation(sAccount)
116117
a.NoError(err)
117118
a.Equal(basics.Online.String(), newAccountStatus.Status)
118-
sAccountData, err := sClient.AccountData(sAccount)
119+
120+
// get the round number of the primary node
121+
pNodeStatus, err := pClient.Status()
122+
a.NoError(err)
123+
124+
// ensure the secondary node reaches that number
125+
_, err = sClient.WaitForRound(pNodeStatus.LastRound)
119126
a.NoError(err)
120127

128+
// get the account data ( which now is syncronized across the network )
129+
sAccountData, err := sClient.AccountData(sAccount)
130+
a.NoError(err)
121131
lastValidRound := sAccountData.VoteLastValid
122132

123133
a.Equal(basics.Round(partKeyLastValid), lastValidRound)
@@ -139,9 +149,10 @@ func testExpirationAccounts(t *testing.T, fixture *fixtures.RestClientFixture, f
139149
a.NoError(err)
140150
a.Equal(blk.CurrentProtocol, protocolCheck)
141151

142-
fixture.SendMoneyAndWait(initialRound, amountToSendInitial, transactionFee, richAccount, sAccount, "")
152+
sendMoneyTxn := fixture.SendMoneyAndWait(initialRound, amountToSendInitial, transactionFee, richAccount, sAccount, "")
143153

144-
err = fixture.WaitForRoundWithTimeout(uint64(initialRound) + 3)
154+
txnConfirmed = fixture.WaitForTxnConfirmation(initialRound+maxRoundsToWaitForTxnConfirm, sAccount, sendMoneyTxn.TxID)
155+
a.True(txnConfirmed)
145156

146157
newAccountStatus, err = pClient.AccountInformation(sAccount)
147158
a.NoError(err)

0 commit comments

Comments
 (0)