From 3a52b5be72b43fb9ab4b45d45dbbe904eca5d186 Mon Sep 17 00:00:00 2001 From: Min RK Date: Fri, 27 Oct 2023 12:21:19 +0200 Subject: [PATCH] test: ensure test server is added to proxy before talking to it this should fix some flaky test failures in test_singleuser not sure why it doesn't _always_ fail --- jupyterhub/tests/test_singleuser.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/jupyterhub/tests/test_singleuser.py b/jupyterhub/tests/test_singleuser.py index d0584bde..fb1df18e 100644 --- a/jupyterhub/tests/test_singleuser.py +++ b/jupyterhub/tests/test_singleuser.py @@ -363,6 +363,7 @@ def test_singleuser_app_class(JUPYTERHUB_SINGLEUSER_APP): async def test_nbclassic_control_panel(app, user, full_spawn): # login, start the server await user.spawn() + await app.proxy.add_user(user) cookies = await app.login_user(user.name) next_url = url_path_join(user.url, "tree/") url = '/?' + urlencode({'next': next_url}) @@ -384,6 +385,7 @@ async def test_nbclassic_control_panel(app, user, full_spawn): ) async def test_token_url_cookie(app, user, full_spawn): await user.spawn() + await app.proxy.add_user(user) token = user.new_api_token(scopes=["access:servers!user"]) url = url_path_join(public_url(app, user), user.spawner.default_url or "/tree/")