-
Notifications
You must be signed in to change notification settings - Fork 513
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
services/horizon: Purging log.Fatal, to make horizon CLI easier to test. #3766
services/horizon: Purging log.Fatal, to make horizon CLI easier to test. #3766
Conversation
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.
Bit of a Catch-22 here: can't write CLI tests without this refactor, can't test this refactor without CLI tests! Everything seems pretty straightforward aside from the WaitGroup
changes, though. My vote is to get this in really early into a sprint so that we can all interact with it a bunch throughout.
I am in favor of this. My only concern: could this have any negative operational implications? (e.g. the monitoring system not catching bad restarts anymore because the failure wasn't logged as expected) |
Yeah, we'll need to be super careful not to change error output messages too much with this. Good call. |
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.
LGTM
81ce7e7
to
e9ecc08
Compare
- Purging fatals from flags
fc5f184
to
6ec2579
Compare
6ec2579
to
d297418
Compare
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.
This will be great for param testing 😍. Get someone else's ✔️ though heh.
…st. (#3766) * Purging os.Exit and log.Fatal from horizon/cmd - Purging fatals from flags * Passing back flag fail errors to see if that impacts integration tests * Return the right error from tick setup * wip -- integration tests * Fix introduced whitespace in error messages * Better usage error handling * Add comment warning about error behaviour of UpdateStellarCoreInfo
PR Checklist
PR Structure
otherwise).
services/friendbot
, orall
ordoc
if the changes are broad or impact manypackages.
Thoroughness
.md
files, etc... affected by this change). Take a look in the
docs
folder for a given service,like this one.
Release planning
needed with deprecations, added features, breaking changes, and DB schema changes.
semver, or if it's mainly a patch change. The PR is targeted at the next
release branch if it's not a patch change.
What
Remove
log.Fatal
andos.Exit
calls from Horizon.log.Fatal
andos.Exit
should only be called infunc main()
, andfunc init()
.error
, which propagates up tofunc main()
Why
As discussed in #3741 (comment), using
log.Fatal
andos.Exit
make integration testing Horizon harder. They force you to launch it as a subprocess and faff around with managing that. Removing these should make it simpler.Reducing friction for CLI-type tests would have helped catch #3762 type bugs sooner/easier.
Known limitations
[WIP]
at this point, as I want to get people's opinions, and if there are any gotchas to watch out for here before spending more time on this. If we're happy with the approach we should merge #3741 as-is, then use this to simplify it, and add a few more cli tests.The one big outstanding thing here re: testing are the places we use
os.Getenv
. But.. One thing at a time.