From 835806b48055bfdc3f4d6ae29c99cdee9b7ca978 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Armando=20Garc=C3=ADa=20Sancio?= Date: Mon, 13 Apr 2015 21:46:28 -0700 Subject: [PATCH] Fix marathon tests by waiting on the remove --- cli/tests/integrations/cli/test_marathon.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cli/tests/integrations/cli/test_marathon.py b/cli/tests/integrations/cli/test_marathon.py index 92659e7..983628e 100644 --- a/cli/tests/integrations/cli/test_marathon.py +++ b/cli/tests/integrations/cli/test_marathon.py @@ -632,6 +632,11 @@ def _remove_app(app_id): assert stdout == b'' assert stderr == b'' + # Let's make sure that we don't return until the deployment has finished + result = _list_deployments(None, app_id) + if len(result) != 0: + _watch_deployment(result[0]['id'], 60) + def _add_app(file_path): with open(file_path) as fd: @@ -711,7 +716,8 @@ def _list_deployments(expected_count, app_id=None): result = json.loads(stdout.decode('utf-8')) assert returncode == 0 - assert len(result) == expected_count + if expected_count is not None: + assert len(result) == expected_count assert stderr == b'' return result