Skip to content
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
27 changes: 23 additions & 4 deletions test/framework/fixtures/restClientFixture.go
Original file line number Diff line number Diff line change
Expand Up @@ -276,22 +276,41 @@ func (f *RestClientFixture) WaitForAllTxnsToConfirm(roundTimeout uint64, txidsAn
for txid, addr := range txidsAndAddresses {
_, err := f.WaitForConfirmedTxn(roundTimeout, addr, txid)
if err != nil {
f.t.Logf("txn failed to confirm: ", addr, txid)
f.t.Logf("txn failed to confirm: addr=%s, txid=%s", addr, txid)
pendingTxns, err := f.LibGoalClient.GetParsedPendingTransactions(0)
if err == nil {
pendingTxids := make([]string, 0, pendingTxns.TotalTransactions)
for _, txn := range pendingTxns.TopTransactions {
pendingTxids = append(pendingTxids, txn.Txn.ID().String())
}
f.t.Logf("pending txids: ", pendingTxids)
f.t.Logf("pending txids: %v", pendingTxids)
} else {
f.t.Logf("unable to log pending txns, ", err)
f.t.Logf("unable to log pending txns: %v", err)
}
allTxids := make([]string, 0, len(txidsAndAddresses))
for txID := range txidsAndAddresses {
allTxids = append(allTxids, txID)
}
f.t.Logf("all txids: ", allTxids)
f.t.Logf("all txids: %s", allTxids)

dataDirs := f.network.NodeDataDirs()
for _, nodedir := range dataDirs {
client, err := libgoal.MakeClientWithBinDir(f.binDir, nodedir, nodedir, libgoal.FullClient)
if err != nil {
f.t.Logf("failed to make a node client for %s: %v", nodedir, err)
continue
}
pendingTxns, err := client.GetParsedPendingTransactions(0)
if err != nil {
f.t.Logf("failed to get pending txns for %s: %v", nodedir, err)
continue
}
pendingTxids := make([]string, 0, pendingTxns.TotalTransactions)
for _, txn := range pendingTxns.TopTransactions {
pendingTxids = append(pendingTxids, txn.Txn.ID().String())
}
f.t.Logf("pending txids at node %s: %v", nodedir, pendingTxids)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This information might not always be relevant, also there could be so many of them depending on the test situation.

Is there a cap on the total number? Maybe limit it to some number so it won't print a huge number in some unlucky situation.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

our tests do not submit lots of txn, and in case of failure only few are expected to be still pending.

}
return false
}
}
Expand Down