test: fail fast in expectTxSuccess and expectTxFail #1014
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
NOTE: Taking out of draft just to run it through CI. Don't merge.
This is part of investigating the common "transaction not found" responses that we often receive briefly after broadcast (we should only ever get "not confirmed" or an execution result).
This updates the
expectTxSuccess
andexpectTxFail
helper functions in the test module to userequire.EventuallyWithT
that in theory allows a fail-fast mode. This would be very helpful when:expectTxFail
we find the transaction mined and executed with code 0 (success) since there's no longer a need to keep checkingexpectTxSuccess
when the error is something other than "not confirmed" (or for now, "not found")However, there's a major issue with
EventuallyWithT
that prevents it from returning cleanly. The fix needs to be released: stretchr/testify#1396We can easily work around this with our own "eventually" helper function, and I may do that.