Notebooks: Improve Jupyter server start time (#13838)

* let jupyter server find port

* add undefined to return type

* remove time log

* add test for port number

* check that match[1] exists
This commit is contained in:
Lucy Zhang
2020-12-21 08:03:26 -08:00
committed by GitHub
parent 786d526e9c
commit 57446faa1e
2 changed files with 13 additions and 29 deletions

View File

@@ -22,6 +22,7 @@ const successMessage = `[I 14:00:38.811 NotebookApp] The Jupyter Notebook is run
[I 14:00:38.812 NotebookApp] http://localhost:8891/?token=...
[I 14:00:38.812 NotebookApp] Use Control-C to stop this server and shut down all kernels (twice to skip confirmation).
`;
const expectedPort = '8891';
describe('Jupyter server instance', function (): void {
let expectedPath = 'mydir/notebook.ipynb';
@@ -89,6 +90,7 @@ describe('Jupyter server instance', function (): void {
let hostAndPort = serverInstance.uri.authority.split(':');
// verify port was set as expected
should(hostAndPort[1]).length(4);
should(hostAndPort[1]).equal(expectedPort);
// And I expect it to be started
should(serverInstance.isStarted).be.true();