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

test: fail fast in expectTxSuccess and expectTxFail #1014

Closed

Conversation

jchappelow
Copy link
Member

@jchappelow jchappelow commented Sep 23, 2024

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 and expectTxFail helper functions in the test module to use require.EventuallyWithT that in theory allows a fail-fast mode. This would be very helpful when:

  • in expectTxFail we find the transaction mined and executed with code 0 (success) since there's no longer a need to keep checking
  • in expectTxSuccess 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#1396

We can easily work around this with our own "eventually" helper function, and I may do that.

@jchappelow
Copy link
Member Author

Taking out of draft just to run it through CI

@jchappelow jchappelow marked this pull request as ready for review October 1, 2024 23:20
@jchappelow
Copy link
Member Author

This PR was 90% for debugging. Plus it requires an unreleased testify and some other cruft just to support fail-fast and making us aware of the "transaction not found" issue that will shortly be a moot point. Closing.

@jchappelow jchappelow closed this Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant