Expose shutDownSequence for better end-to-end testing#81
Expose shutDownSequence for better end-to-end testing#81jeffrey-xiao wants to merge 3 commits intoairbnb:masterfrom
Conversation
| } | ||
|
|
||
| function readyToClose(getClose) { | ||
| getClose(shutDownSequence); |
There was a problem hiding this comment.
I don't think we want to delegate the responsibility of closing down the server to a callback. We should close and then fire off a callback when it's done.
There was a problem hiding this comment.
Thanks for the feedback!
Would be better to expose close or shutDownSequence in worker to hypernova?
One of the problems I had writing tests when exposing those was that sometimes I was trying to close the http server when it hasn't been initialised yet.
Also isn't a callback when the server is shutdown necessary when you can create a plugin for the shutdown lifecycle event?
There was a problem hiding this comment.
@goatslacker the intent here is to be able to close down the hypernova server (and transitively the express & http server) from the consuming application on demand.
This is to set us up to have better end to end testing - currently we can only spin up one instance of hypernova per process (i.e. per test run). (more context linked in the body of the PR)
Is there a better way than a callback in the hypernova object to expose this functionality?
For context, bullet point 2 in this comment: #66 (comment)