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

Add waits/retries to algod importer #1178

Merged
merged 3 commits into from
Aug 15, 2022

Conversation

Eric-Warehime
Copy link
Contributor

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.

@Eric-Warehime Eric-Warehime added Not-Yet-Enabled Feature is not yet enabled at this time Skip-Release-Notes Reserved for PRs which do not need to be included in Release Notes labels Aug 14, 2022
@codecov
Copy link

codecov bot commented Aug 14, 2022

Codecov Report

❗ No coverage uploaded for pull request base (conduit@45d5c4b). Click here to learn what that means.
The diff coverage is n/a.

@@            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"
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: ordering

// 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 {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: passingCalls==0?

@Eric-Warehime Eric-Warehime merged commit a0b6ecc into algorand:conduit Aug 15, 2022
@Eric-Warehime Eric-Warehime deleted the algod-importer-follow branch August 15, 2022 15:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Not-Yet-Enabled Feature is not yet enabled at this time Skip-Release-Notes Reserved for PRs which do not need to be included in Release Notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants