Skip to content

Commit

Permalink
Print debugging.
Browse files Browse the repository at this point in the history
  • Loading branch information
SyntaxColoring committed Sep 20, 2024
1 parent 2dd0737 commit 8969806
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion robot-server/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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/

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand All @@ -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)])
Expand All @@ -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:
Expand Down

0 comments on commit 8969806

Please sign in to comment.