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

tests: stabilize TestAssetCreateWaitRestartDelete #4400

Merged
merged 1 commit into from
Aug 12, 2022

Conversation

algorandskiy
Copy link
Contributor

  • Ensure manager account is funded before running any operations with it
  • Shave 2 minutes from TestAssetCreateWaitBalLookbackDelete
    by introducing faster rounds on a custom proto that is already in place

* Ensure manager account is funded before running any operations with it
* Shave 2 minutes from TestAssetCreateWaitBalLookbackDelete
  by introducing faster rounds on a custom proto that is already in place
Copy link
Contributor

@algonautshant algonautshant left a comment

Choose a reason for hiding this comment

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

Looks good.
The fix is simple and efficient.
I have another suggestion, but it is just a suggestion and it also fine as is.

// WaitForAccountFunded waits until either the passed account gets non-empty balance
// or until the passed roundTimeout passes
// or until waiting for a round to pass times out
func (f *RestClientFixture) WaitForAccountFunded(roundTimeout uint64, accountAddress string) (err error) {
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 it is better to move this inside the test file.
The utility of this function in another situation is very limited, because it is not necessary to have the accountAddress in the f.AlgodClient wallet in other situations.

Alternatively, there is a simpler (perhaps less efficient) but more general function: to check for the pending transactions and wait until all pending transactions are flushed.

Also, a bit more intrusive check (but more efficient) would be to get the txid from SendPaymentFromUnencryptedWallet, and pass it here, and wait for that transaction to be accepted.

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 though about returning list of txnids from setupActors but it looked messy. Ended up with this approach.

@codecov
Copy link

codecov bot commented Aug 12, 2022

Codecov Report

Merging #4400 (270673d) into master (7c70e38) will increase coverage by 0.01%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master    #4400      +/-   ##
==========================================
+ Coverage   55.56%   55.58%   +0.01%     
==========================================
  Files         400      400              
  Lines       50797    50797              
==========================================
+ Hits        28226    28236      +10     
+ Misses      20173    20158      -15     
- Partials     2398     2403       +5     
Impacted Files Coverage Δ
catchup/peerSelector.go 98.95% <0.00%> (-1.05%) ⬇️
ledger/tracker.go 73.93% <0.00%> (-0.86%) ⬇️
ledger/acctupdates.go 69.92% <0.00%> (-0.61%) ⬇️
ledger/acctonline.go 78.47% <0.00%> (-0.53%) ⬇️
catchup/service.go 68.14% <0.00%> (-0.50%) ⬇️
network/wsNetwork.go 64.89% <0.00%> (+0.19%) ⬆️
agreement/proposalManager.go 98.03% <0.00%> (+1.96%) ⬆️
agreement/cryptoVerifier.go 69.71% <0.00%> (+2.11%) ⬆️
node/node.go 25.63% <0.00%> (+2.37%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

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.

2 participants