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

fix failing e2e test #899

Merged
merged 4 commits into from
Feb 25, 2022
Merged
Show file tree
Hide file tree
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
9 changes: 7 additions & 2 deletions cmd/e2equeries/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,12 @@ func main() {
rowchan, _ := db.Transactions(context.Background(), rekeyTxnQuery)
for txnrow := range rowchan {
maybeFail(txnrow.Error, "err rekey txn %v\n", txnrow.Error)
rekeyedAuthAddrs = append(rekeyedAuthAddrs, txnrow.Txn.Txn.RekeyTo)

t := txnrow.Txn
if txnrow.RootTxn != nil {
t = txnrow.RootTxn
}
rekeyedAuthAddrs = append(rekeyedAuthAddrs, t.Txn.RekeyTo)
}

// some rekeys get rekeyed back; some rekeyed accounts get deleted, just want to find at least one
Expand All @@ -63,7 +68,7 @@ func main() {
}
if !foundRekey {
// this will report the error in a handy way
printAccountQuery(db, idb.AccountQueryOptions{EqualToAuthAddr: rekeyedAuthAddrs[0][:], Limit: 1})
printAccountQuery(db, idb.AccountQueryOptions{EqualToAuthAddr: rekeyedAuthAddrs[0][:], Limit: 0})
Copy link
Contributor

Choose a reason for hiding this comment

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

What error is this supposed to be reporting?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think I see it. This triggers the "came up short" error?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes

}

// find an asset with > 1 account
Expand Down
2 changes: 1 addition & 1 deletion misc/buildtestdata.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,4 @@ mkdir -p "${E2EDATA}"
RSTAMP=$(TZ=UTC python -c 'import time; print("{:08x}".format(0xffffffff - int(time.time() - time.mktime((2020,1,1,0,0,0,-1,-1,-1)))))')

echo "COPY AND PASTE THIS TO UPLOAD:"
echo aws s3 cp --acl public-read "${E2EDATA}/net_done.tar.bz2" s3://algorand-testdata/indexer/e2e3/"${RSTAMP}"/net_done.tar.bz2
echo aws s3 cp --acl public-read "${E2EDATA}/net_done.tar.bz2" s3://algorand-testdata/indexer/e2e4/"${RSTAMP}"/net_done.tar.bz2
2 changes: 1 addition & 1 deletion misc/e2elive.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def main():
s3 = boto3.client('s3', config=Config(signature_version=UNSIGNED))
tarname = 'net_done.tar.bz2'
tarpath = os.path.join(tempdir, tarname)
firstFromS3Prefix(s3, bucket, 'indexer/e2e3', tarname, outpath=tarpath)
firstFromS3Prefix(s3, bucket, 'indexer/e2e4', tarname, outpath=tarpath)
shiqizng marked this conversation as resolved.
Show resolved Hide resolved
source_is_tar = True
sourcenet = tarpath
tempnet = os.path.join(tempdir, 'net')
Expand Down
10 changes: 6 additions & 4 deletions util/test/testutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,14 @@ func PrintTxnQuery(db idb.IndexerDb, q idb.TransactionFilter) {
for txnrow := range rowchan {
util.MaybeFail(txnrow.Error, "err %v\n", txnrow.Error)
stxn := txnrow.Txn
tjs := util.JSONOneLine(stxn.Txn)
info("%d:%d %s sr=%d rr=%d ca=%d cr=%d t=%s\n", txnrow.Round, txnrow.Intra, tjs, stxn.SenderRewards, stxn.ReceiverRewards, stxn.ClosingAmount, stxn.CloseRewards, txnrow.RoundTime.String())
count++
if stxn != nil {
tjs := util.JSONOneLine(stxn.Txn)
info("%d:%d %s sr=%d rr=%d ca=%d cr=%d t=%s\n", txnrow.Round, txnrow.Intra, tjs, stxn.SenderRewards, stxn.ReceiverRewards, stxn.ClosingAmount, stxn.CloseRewards, txnrow.RoundTime.String())
count++
}
}
info("%d txns\n", count)
if q.Limit != 0 && q.Limit != count {
if q.Limit != 0 && count < 2 || count > 100 {
fmt.Fprintf(os.Stderr, "txn q CAME UP SHORT, limit=%d actual=%d, q=%#v\n", q.Limit, count, q)
myStackTrace()
exitValue = 1
Expand Down