From 0f1ebea3c7a944551ba6b37701474225180f5b33 Mon Sep 17 00:00:00 2001 From: Peter Parente Date: Tue, 28 Jul 2020 23:04:16 -0400 Subject: [PATCH] Fix missing container wait in test --- base-notebook/test/test_container_options.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/base-notebook/test/test_container_options.py b/base-notebook/test/test_container_options.py index a7565b4e..f93a12ad 100644 --- a/base-notebook/test/test_container_options.py +++ b/base-notebook/test/test_container_options.py @@ -76,6 +76,9 @@ def test_nb_user_change(container): command=['start.sh', 'bash', '-c', 'sleep infinity'] ) + # Give the chown time to complete. Use sleep, not wait, because the + # container sleeps forever. + time.sleep(10) LOGGER.info(f"Checking if the user is changed to {nb_user} by the start script ...") output = running_container.logs(stdout=True).decode("utf-8") assert f"Set username to: {nb_user}" in output, f"User is not changed to {nb_user}" @@ -123,6 +126,7 @@ def test_chown_home(container): ], command=['start.sh', 'bash', '-c', 'chown root:root /home/jovyan && ls -alsh /home'] ) + c.wait(timeout=120) assert "Changing ownership of /home/jovyan to 1000:100 with options '-R'" in c.logs(stdout=True).decode('utf-8')