Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

testing: modify TestAccountInformationV2 to wait for transaction #3098

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 21 additions & 12 deletions test/e2e-go/features/transactions/accountv2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ func TestAccountInformationV2(t *testing.T) {
proto.AgreementFilterTimeout = 400 * time.Millisecond
fixture.SetConsensus(config.ConsensusProtocols{protocol.ConsensusFuture: proto})

fixture.Setup(t, filepath.Join("nettemplates", "TwoNodes50EachFuture.json"))
fixture.Setup(t, filepath.Join("nettemplates", "TwoNodes50EachV26.json"))
defer fixture.Shutdown()

client := fixture.LibGoalClient
Expand All @@ -105,13 +105,15 @@ func TestAccountInformationV2(t *testing.T) {

fee := uint64(1000)

var txn transactions.Transaction

// Fund the manager, so it can issue transactions later on
_, err = client.SendPaymentFromUnencryptedWallet(creator, user, fee, 10000000000, nil)
txn, err = client.SendPaymentFromUnencryptedWallet(creator, user, fee, 10000000000, nil)
a.NoError(err)

round, err := client.CurrentRound()
a.NoError(err)
client.WaitForRound(round + 4)
fixture.WaitForConfirmedTxn(round+4, creator, txn.ID().String())

// There should be no apps to start with
ad, err := client.AccountData(creator)
Expand Down Expand Up @@ -285,16 +287,23 @@ int 1
a.NoError(err)
signedTxn, err = client.SignTransactionWithWallet(wh, nil, tx)
a.NoError(err)
_, err = client.BroadcastTransaction(signedTxn)
a.NoError(err)
round, err = client.CurrentRound()
a.NoError(err)
_, err = client.WaitForRound(round + 2)
a.NoError(err)
// Ensure the txn committed
resp, err = client.GetPendingTransactions(2)
txid, err = client.BroadcastTransaction(signedTxn)
a.NoError(err)
a.Equal(uint64(0), resp.TotalTxns)
for {
round, err = client.CurrentRound()
a.NoError(err)
_, err = client.WaitForRound(round + 1)
a.NoError(err)
// Ensure the txn committed
resp, err = client.GetPendingTransactions(2)
a.NoError(err)
if resp.TotalTxns == 1 {
a.Equal(resp.TruncatedTxns.Transactions[0].TxID, txid)
continue
}
a.Equal(uint64(0), resp.TotalTxns)
break
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

checkEvalDelta on line 318 will still impose certain expectations on the round / test timing.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I fixed it here to address the failure noted in circle-ci.. But if we'll see failures coming from the evalDelta then we should probably implement a similar fix there as well.


ad, err = client.AccountData(creator)
a.NoError(err)
Expand Down