Skip to content
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

Choose random host port in tests #1623

Merged
merged 2 commits into from
Feb 14, 2022

Conversation

mathbunnyru
Copy link
Member

Related: #1622

Copy link
Collaborator

@consideRatio consideRatio left a comment

Choose a reason for hiding this comment

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

LGTM!

Note for other reviewers and as a verification of my understanding by making it explicit: when we pass ports={"8888/tcp": None} to run_detached, it means that the container port 8888/tcp should be associated with the port None (random) in the host port.

self.container = self.docker_client.containers.run(
self.image_name,
**all_kwargs,
)

    running_container = container.run_detached(
        command=["start-notebook.sh", "--NotebookApp.token=''"],
        ports={"8888/tcp": None},
    )

base-notebook/test/test_container_options.py Outdated Show resolved Hide resolved
base-notebook/test/test_container_options.py Outdated Show resolved Hide resolved
base-notebook/test/test_start_container.py Outdated Show resolved Hide resolved
conftest.py Show resolved Hide resolved
test/test_notebook.py Outdated Show resolved Hide resolved
Co-authored-by: Erik Sundell <erik.i.sundell@gmail.com>
@mathbunnyru
Copy link
Member Author

Thank you @consideRatio!

I want to confirm that after this change I am able to run make test/base-notebook in several tabs without any errors, which almost certainly means that we can run tests in parallel, both for the samge image or for different images as well.

@mathbunnyru
Copy link
Member Author

Tests pass, so merging this :)

@mathbunnyru mathbunnyru merged commit 2e39b99 into jupyter:master Feb 14, 2022
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