From 8969806d54b9fcfe79865238b49246c2caedde2f Mon Sep 17 00:00:00 2001 From: Max Marrone Date: Fri, 20 Sep 2024 11:37:50 -0400 Subject: [PATCH] Print debugging. --- robot-server/Makefile | 2 +- .../integration/http_api/persistence/test_reset.py | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/robot-server/Makefile b/robot-server/Makefile index 7d501d87f2d..bb98e4f3e20 100755 --- a/robot-server/Makefile +++ b/robot-server/Makefile @@ -34,7 +34,7 @@ version_file = $(call python_get_git_version,robot-server,$(project_rs_default), # specified test tests ?= tests/integration/http_api/persistence/test_reset.py cov_opts ?= --cov=$(SRC_PATH) --cov-report term-missing:skip-covered --cov-report xml:coverage.xml -test_opts ?= +test_opts ?= -s black_opts := --extend-exclude tests/integration/persistence_snapshots/ diff --git a/robot-server/tests/integration/http_api/persistence/test_reset.py b/robot-server/tests/integration/http_api/persistence/test_reset.py index 8b4ad48ad19..d9022177d0e 100644 --- a/robot-server/tests/integration/http_api/persistence/test_reset.py +++ b/robot-server/tests/integration/http_api/persistence/test_reset.py @@ -69,7 +69,7 @@ async def _wait_until_initialization_failed(robot_client: RobotClient) -> None: False ), f"Expected server to report failed initialization, but got: {response}" else: - # Server hasn't has unexpectedly reported success. + # The server has unexpectedly reported success. assert ( False ), f"Expected server to report failed initialization, but got: {response}" @@ -83,14 +83,19 @@ async def test_upload_protocols_and_reset_persistence_dir() -> None: But after restarting the server, those resources should be gone. """ + print("MAX DEBUG: Test begins") port = "15555" async with RobotClient.make( base_url=f"http://localhost:{port}", version="*" ) as robot_client: + print("MAX DEBUG: Made robot client") assert await robot_client.dead(), "Dev Robot is running and must not be." + print("MAX DEBUG: Asserted dead") with DevServer(port=port) as server: server.start() + print("MAX DEBUG: Started server") await robot_client.wait_until_ready() + print("MAX DEBUG: Waited until ready") with get_py_protocol(secrets.token_urlsafe(16)) as file: await robot_client.post_protocol([Path(file.name)]) @@ -115,7 +120,11 @@ async def test_upload_protocols_and_reset_persistence_dir() -> None: persistence_directory=server.persistence_directory, ) + print("MAX DEBUG: Test ends") server.stop() + print("MAX DEBUG: Called server.stop()") + + print("MAX DEBUG: Exited server context manager") async def test_reset_is_available_even_with_corrupt_persistence_directory() -> None: