Skip to content

Commit

Permalink
squashme: fix integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
olevski committed Mar 14, 2022
1 parent 3b162a4 commit 1f2ffe3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/integration/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,10 +327,12 @@ def _ci_jobs_completed_on_time(gitlab_project, timeout_mins=default_timeout_mins

@pytest.fixture
def delete_session(base_url, k8s_namespace, safe_username, default_timeout_mins):
def _delete_session(session, test_gitlab_project, test_headers):
def _delete_session(session, test_gitlab_project, test_headers, forced=False):
session_name = session["name"]
response = requests.delete(
f"{base_url}/servers/{session_name}", headers=test_headers
f"{base_url}/servers/{session_name}",
headers=test_headers,
params={"forced": "true" if forced else "false"},
)
if response.status_code < 300:
tstart = datetime.now()
Expand Down
4 changes: 4 additions & 0 deletions tests/integration/test_session_crash_errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ def test_wrong_image(
valid_payload,
extract_error_message,
launch_session,
delete_session,
gitlab_project,
):
valid_payload = {
Expand All @@ -81,3 +82,6 @@ def test_wrong_image(
"does not contain the required command" in error_message
or "ensure that your Dockerfile is correct" in error_message
)
# NOTE: This session is crashing and will not gracefully shutdown for 10 mins
# passing forced=True bypasses this behavious and sets the deletionGracePeriodSeconds to 0
delete_session(response.json(), gitlab_project, headers, forced=True)

0 comments on commit 1f2ffe3

Please sign in to comment.