Merge ~adam-collard/maas-ci/+git/system-tests:sleep-before-image-import-loop into ~maas-committers/maas-ci/+git/system-tests:master

Proposed by Adam Collard
Status: Merged
Approved by: Diego Mascialino
Approved revision: 4a4203dfe37841ea5480630117a2fbe68070f589
Merge reported by: Adam Collard
Merged at revision: 4a4203dfe37841ea5480630117a2fbe68070f589
Proposed branch: ~adam-collard/maas-ci/+git/system-tests:sleep-before-image-import-loop
Merge into: ~maas-committers/maas-ci/+git/system-tests:master
Diff against target: 26 lines (+6/-3)
1 file modified
systemtests/state.py (+6/-3)
Reviewer Review Type Date Requested Status
Diego Mascialino (community) Approve
Review via email: mp+406759@code.launchpad.net

Commit message

[import_images] Sleep for 5 minutes per architecture

By sleeping in advance of checking every 10s, we give MAAS a chance to
import the images, and not waste time checking if they're imported.

If speed of import changes, this can be tweaked.

To post a comment you must log in.
Revision history for this message
Diego Mascialino (dmascialino) :
review: Approve

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 353b8bb..3e73ac2 100644
3--- a/systemtests/state.py
4+++ b/systemtests/state.py
5@@ -18,8 +18,7 @@ def authenticated_admin(maas_region, maas_api_client):
6
7
8 @pytest.fixture(scope="session")
9-def import_images_and_wait_until_synced(authenticated_admin, configured_maas, config):
10-
11+def import_images_and_wait_until_synced(authenticated_admin, configured_maas, config, testlog):
12 architectures = set()
13 for machine, power_config in config["machines"]["hardware"].items():
14 architectures.add(power_config.get("architecture", "amd64"))
15@@ -27,7 +26,11 @@ def import_images_and_wait_until_synced(authenticated_admin, configured_maas, co
16 authenticated_admin.update_architectures_in_boot_source_selections(architectures)
17 # This waits for an event to be created for the import
18 authenticated_admin.import_boot_resources()
19-
20+ # It takes a long time for images to be downloaded, give 5 minutes
21+ # per architecture
22+ sleep_time = 60 * 5 * len(architectures)
23+ testlog.info(f"Sleeping for {sleep_time}s for image import")
24+ time.sleep(sleep_time)
25 while authenticated_admin.is_importing_boot_resources():
26 time.sleep(10)
27

Subscribers

People subscribed via source and target branches

to all changes: