Merge ~adam-collard/maas-ci/+git/system-tests:retry-login into ~maas-committers/maas-ci/+git/system-tests:master

Proposed by Adam Collard
Status: Merged
Approved by: Alberto Donato
Approved revision: 7370e51c12812381393b46e0452081564c024ca7
Merge reported by: MAAS Lander
Merged at revision: not available
Proposed branch: ~adam-collard/maas-ci/+git/system-tests:retry-login
Merge into: ~maas-committers/maas-ci/+git/system-tests:master
Diff against target: 27 lines (+8/-1)
1 file modified
systemtests/state.py (+8/-1)
Reviewer Review Type Date Requested Status
Diego Mascialino (community) Approve
MAAS Lander Needs Fixing
Review via email: mp+427040@code.launchpad.net

Commit message

Retry login

To post a comment you must log in.
Revision history for this message
MAAS Lander (maas-lander) wrote :

UNIT TESTS
-b retry-login lp:~adam-collard/maas-ci/+git/system-tests into -b master lp:~maas-committers/maas-ci/+git/system-tests

STATUS: FAILED
LOG: http://maas-ci.internal:8080/job/system-tests-tester/235/consoleText
COMMIT: 7370e51c12812381393b46e0452081564c024ca7

review: Needs Fixing
Revision history for this message
Diego Mascialino (dmascialino) :
review: Approve
Revision history for this message
MAAS Lander (maas-lander) wrote :
Revision history for this message
MAAS Lander (maas-lander) wrote :
Revision history for this message
MAAS Lander (maas-lander) wrote :

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/systemtests/state.py b/systemtests/state.py
2index 022604a..5c55070 100644
3--- a/systemtests/state.py
4+++ b/systemtests/state.py
5@@ -6,6 +6,7 @@ from logging import getLogger
6 from typing import TYPE_CHECKING, Any, Iterator, Set, cast
7
8 import pytest
9+from retry import retry
10
11 from .region import get_rack_controllers
12 from .utils import waits_for_event_after
13@@ -26,7 +27,13 @@ def authenticated_admin(
14 unauthenticated_maas_api_client: UnauthenticatedMAASAPIClient,
15 ) -> AuthenticatedAPIClient:
16 token = maas_credentials["api_key"]
17- _, api_client = unauthenticated_maas_api_client.log_in("maas_under_test", token)
18+
19+ @retry(tries=5, delay=2, logger=LOG)
20+ def _retry_log_in(session_name: str, token: str) -> AuthenticatedAPIClient:
21+ _, api_client = unauthenticated_maas_api_client.log_in(session_name, token)
22+ return api_client
23+
24+ api_client = _retry_log_in("maas_under_test", token)
25 version_information = api_client.read_version_information()
26 LOG.info(
27 "MAAS Version: {version}, subversion: {subversion}".format(

Subscribers

People subscribed via source and target branches

to all changes: