-
Notifications
You must be signed in to change notification settings - Fork 92
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
Add waits/retries to algod importer #1178
Add waits/retries to algod importer #1178
Conversation
Codecov Report
@@ Coverage Diff @@
## conduit #1178 +/- ##
==========================================
Coverage ? 59.03%
==========================================
Files ? 64
Lines ? 8883
Branches ? 0
==========================================
Hits ? 5244
Misses ? 3170
Partials ? 469 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
"path" | ||
"strconv" | ||
"strings" | ||
"github.com/algorand/indexer/util/test" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: ordering
fetcher/fetcher_test.go
Outdated
// returning an empty block `passingCalls` times before throwing 500s | ||
func(path string, w http.ResponseWriter) bool { | ||
if strings.Contains(path, "v2/blocks/") { | ||
if passingCalls <= 0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: passingCalls==0?
Summary
Indexer's fetcher uses the GetBlock API while catching up since it knows the blocks should exist, and adds a WaitForBlock call during follow.
I've added a wait call for each block fetch so that fetching blocks via the Algod Importer should function properly for both older blocks and new ones.
I've also refactored the mock algod server used in these tests and the fetcher tests to use a common package.
Also added files to the codecov ignore list since they are mocks/tests.
Test Plan
Added/updated unit tests.