Skip to content

Conversation

@Zsailer
Copy link
Member

@Zsailer Zsailer commented Nov 7, 2019

This PR separates the logic for initializing+starting the eventloop from the initializing+starting the main application. This is particularly helpful for writing unit tests.

This enables us to replace the HttpServer in ServerApp with test server like pytest-tornado's httpserver fixture. For an example of such tests, see Zsailer/jupyter_server_tests.

Copy link
Member

@vidartf vidartf left a comment

Choose a reason for hiding this comment

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

I'm not sure I have enough of a full-picture to say if this is a good idea or not (the PR is simply presented as a solution to a problem related to testing, but the problem itself is not clear to me). Assuming it makes sense, I've made some comments on the implementation below.

pc.start()

def init_httpserver(self):
"""initialize tornado httpserver"""
Copy link
Member

Choose a reason for hiding this comment

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

I would add a note here that init_webapp must be called before this in order to ensure that multiple config/setting variables get initialized and set up. It should also specify what the alternative is (e.g. if you pass new_httpserver=False, then how is self.http_server supposed to be set?).

@Zsailer
Copy link
Member Author

Zsailer commented Dec 6, 2019

Closing because this logic was merged in #152

@Zsailer Zsailer closed this Dec 6, 2019
@Zsailer Zsailer deleted the httpserver branch January 10, 2020 17:35
Zsailer added a commit to Zsailer/jupyter_server that referenced this pull request Nov 18, 2022
* add a launch_timeout trait to kernel provisioner

* Bump to 0.12.5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants