Skip to content

Commit

Permalink
Add timeout to Webots dynamic test
Browse files Browse the repository at this point in the history
  • Loading branch information
lola831 authored Dec 20, 2024
1 parent 185fe3c commit 89dd220
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion tests/simulators/webots/test_webots.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,16 @@ def cleanup_results():
def test_dynamics_scenarios(launchWebots):
WEBOTS_ROOT = launchWebots
cleanup_results()

timeout_seconds = 300

command = f"bash {WEBOTS_ROOT}/webots --no-rendering --minimize --batch {WEBOTS_WORLD_FILE_PATH}"
subprocess.run(command, shell=True)

try:
subprocess.run(command, shell=True, timeout=timeout_seconds)
except subprocess.TimeoutExpired:
pytest.fail(f"Webots test exceeded the timeout of {timeout_seconds} seconds and failed.")

data = receive_results()
assert data != None
start_z = float(data.split(",")[1].strip(" )]"))
Expand Down

0 comments on commit 89dd220

Please sign in to comment.