Conversation
…exer goroutine ethereum#22346 The 10 second timeout of testChainIndexBackend.Process called t.Fatal from the chain indexer's own updateLoop goroutine. FailNow ends that goroutine, which stops the indexer for good and can leave Close() blocked on its quit channel, turning a test that was about to finish into a hang. Report the unexpected call with t.Error and return an error instead, so the updateLoop stays alive and stops by itself. ported from geth c454717
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🟢 Approval recommended
The focused test-only change matches upstream and preserves indexer cleanup behavior.
Pull request overview
Ports upstream go-ethereum ethereum#22346 to prevent a test indexer goroutine from terminating unexpectedly and hanging cleanup.
Changes:
- Replaces
t.Fatalwitht.Error. - Returns an error to stop the current indexing attempt safely.
File summaries
| File | Description |
|---|---|
core/chain_indexer_test.go |
Safely reports unexpected test backend processing calls. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 0
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Port upstream go-ethereum ethereum#22346 (
c454717fa6): the 10 second timeout oftestChainIndexBackend.Processcalledt.Fatalfrom the chain indexer's ownupdateLoopgoroutine.FailNowends the goroutine that calls it, so the indexer's update loop died for good, andClose()could then block forever on its quit channel, turning a test that was about to finish into a hang. Report the unexpected call witht.Errorand return an error instead, which is what upstream does: the error makesprocessSectionfail and the update loop stop by itself, without killing its goroutine.Test infrastructure only, no production code touched. This does not fix the
Canonical section count mismatchflake, which is fixed by #2582; best merged after that one, because until then amake quick-testrun of this branch can still hit that flake.Verification:
make all,make quick-testand one fullmake testat this commit.