-
Notifications
You must be signed in to change notification settings - Fork 9
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
feat(jstzd): use AsyncDropper in JstzdServer #656
Conversation
030aacd
to
7b9dea8
Compare
Codecov ReportAttention: Patch coverage is
Continue to review full report in Codecov by Sentry.
🚨 Try these New Features:
|
8ccbd02
to
85eebb4
Compare
407a72e
to
616a392
Compare
85eebb4
to
7f885a2
Compare
616a392
to
fec3507
Compare
7f885a2
to
2cc9340
Compare
a805821
to
75e620b
Compare
2cc9340
to
f890e1c
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.
Isn't the problem because JstzServer
, although it implements AsyncDrop
, isn't instantiated with AsyncDropper<JstzServer>
?
Since AsyncDropper
requires impl Default
, ServerState.jstzd_config
field might have to wrapped in Option<>
which is rather inconvenient :(
If there is a jstzd panics for some reason, we definitely want the octez resources to be cleaned up. Is there a better way to to hook self.stop()
when the server starts up?
f890e1c
to
281235b
Compare
Yes. I thought implementing
That's true, but it's not that inconvenient since the server does not really access
At this moment, there aren't really that many places in |
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 thanks
75e620b
to
3eaef9d
Compare
281235b
to
bf6b52b
Compare
7674e6e
to
4690225
Compare
bf6b52b
to
94f7586
Compare
494360e
to
29efe77
Compare
94f7586
to
416eae3
Compare
Context
Closes JSTZ-121.
JSTZ-121
Description
Wrap the test in a future so that we can still call
stop
at the end of the test to clean up everything before the program exits should the test fail and panic. Otherwise, the test program does not actually close after the panic and the baker and octez-node processes remain running even after the test program terminates.In a tokio task,
panic
is captured and returned asErr
, so handling failed assertions like this is much simpler than trying to do something likecatch_unwind
.Manually testing the PR
The test should still work as is.