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: fix failure in TestAccountInformationV2 #3049

Merged

Conversation

tsachiherman
Copy link
Contributor

@tsachiherman tsachiherman commented Oct 13, 2021

Summary

The test had a conceptual buggy pattern. It was using

round, err = client.CurrentRound()
...
_, err = client.BroadcastTransaction(signedTxn)
...
_, err = client.WaitForRound(round + 3)

which is doomed to fail if the test process goes to sleep for a minute between the client.CurrentRound() call and the client.BroadcastTransaction call. The trivial solution is to reorder the calls so that

_, err = client.BroadcastTransaction(signedTxn)
...
round, err = client.CurrentRound()
...
_, err = client.WaitForRound(round + 3)

Test Plan

This is a test.

@codecov-commenter
Copy link

codecov-commenter commented Oct 13, 2021

Codecov Report

Merging #3049 (cae2743) into master (83bcaaa) will decrease coverage by 0.00%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3049      +/-   ##
==========================================
- Coverage   43.64%   43.64%   -0.01%     
==========================================
  Files         391      391              
  Lines       86779    86779              
==========================================
- Hits        37877    37872       -5     
- Misses      42872    42875       +3     
- Partials     6030     6032       +2     
Impacted Files Coverage Δ
catchup/peerSelector.go 98.95% <0.00%> (-1.05%) ⬇️
ledger/acctupdates.go 65.96% <0.00%> (-0.49%) ⬇️
network/wsNetwork.go 62.95% <0.00%> (ø)
data/transactions/verify/txn.go 44.29% <0.00%> (+0.87%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 83bcaaa...cae2743. Read the comment docs.

@tsachiherman
Copy link
Contributor Author

@algorandskiy thanks.

@tsachiherman tsachiherman merged commit 3572e1f into algorand:master Oct 13, 2021
@tsachiherman tsachiherman deleted the tsachi/fixTestAccountInformationV2 branch October 13, 2021 19:32
cce pushed a commit to cce/go-algorand that referenced this pull request Oct 28, 2021
## Summary

The test had a conceptual buggy pattern. It was using 
```golang
round, err = client.CurrentRound()
...
_, err = client.BroadcastTransaction(signedTxn)
...
_, err = client.WaitForRound(round + 3)
```
which is doomed to fail if the test process goes to sleep for a minute between the `client.CurrentRound()` call and the `client.BroadcastTransaction` call. The trivial solution is to reorder the calls so that 
```golang
_, err = client.BroadcastTransaction(signedTxn)
...
round, err = client.CurrentRound()
...
_, err = client.WaitForRound(round + 3)
```


## Test Plan

This is a test.
@egieseke egieseke mentioned this pull request Nov 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants