Skip to content

Commit b44e035

Browse files
e2e: allow serial DPS registrations to complete (#1261)
## Summary - raise the DPS E2E suite timeout from 30 to 60 seconds - give X.509 group enrollment tests a 120-second timeout for three serial registrations - apply the group override consistently to sync/async and MQTT/MQTT-over-WebSockets cases ## Why [DPS E2E build 163238](https://dev.azure.com/azure-iot-sdks/f9b79625-2860-4d92-a4ee-57b03fabfd10/_build/results?buildId=163238) timed out in the async X.509 group enrollment MQTT-over-WebSockets case. The suite-level 30-second pytest timeout covered the entire test even though it performs three sequential network registrations. The same outer timeout also matched the SDK registration stage's 30-second timeout, allowing pytest to interrupt single-registration tests before the SDK could surface its more useful operation error. A 60-second default preserves bounded hang detection while allowing SDK errors to surface. The 120-second marker is limited to group tests that make three serial registration attempts. ## Validation - Python 3.10 collected all 24 DPS E2E cases - verified 16 individual cases use the 60-second suite default - verified all 8 sync/async X.509 group cases use the 120-second override - Black and Ruff passed --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent a5d5590 commit b44e035

3 files changed

Lines changed: 17 additions & 3 deletions

File tree

‎tests/e2e/provisioning_e2e/pytest.ini‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[pytest]
2-
timeout=30
2+
timeout=60
33
testdox_format=plaintext
44
asyncio_mode=auto
55
addopts=

‎tests/e2e/provisioning_e2e/tests/test_async_certificate_enrollments.py‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
delete_directories_certs_created_from_pipeline,
2929
)
3030

31-
3231
logging.basicConfig(level=logging.DEBUG)
3332

3433

@@ -53,6 +52,12 @@
5352
"group_intermediate": [3, 4, 5],
5453
"group_ca": [6, 7, 8],
5554
}
55+
# Allow 40 seconds per serial registration and derive each group limit from its device list.
56+
REGISTRATION_TIMEOUT_PER_DEVICE = 40
57+
58+
59+
def group_registration_timeout(group_type):
60+
return REGISTRATION_TIMEOUT_PER_DEVICE * len(type_to_device_indices[group_type])
5661

5762

5863
@pytest.fixture(scope="module", autouse=True)
@@ -133,6 +138,7 @@ async def test_device_register_with_no_device_id_for_a_x509_individual_enrollmen
133138
"A group of devices get provisioned to the linked IoTHub with device_ids equal to the individual registration_ids inside a group enrollment that has been created with intermediate X509 authentication"
134139
)
135140
@pytest.mark.parametrize("protocol", ["mqtt", "mqttws"])
141+
@pytest.mark.timeout(group_registration_timeout("group_intermediate"))
136142
async def test_group_of_devices_register_with_no_device_id_for_a_x509_intermediate_authentication_group_enrollment(
137143
protocol,
138144
):
@@ -196,6 +202,7 @@ async def test_group_of_devices_register_with_no_device_id_for_a_x509_intermedia
196202
"A group of devices get provisioned to the linked IoTHub with device_ids equal to the individual registration_ids inside a group enrollment that has been created with an already uploaded ca cert X509 authentication"
197203
)
198204
@pytest.mark.parametrize("protocol", ["mqtt", "mqttws"])
205+
@pytest.mark.timeout(group_registration_timeout("group_ca"))
199206
async def test_group_of_devices_register_with_no_device_id_for_a_x509_ca_authentication_group_enrollment(
200207
protocol,
201208
):

‎tests/e2e/provisioning_e2e/tests/test_sync_certificate_enrollments.py‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@
2727
delete_directories_certs_created_from_pipeline,
2828
)
2929

30-
3130
logging.basicConfig(level=logging.DEBUG)
3231

3332

@@ -52,6 +51,12 @@
5251
"group_intermediate": [3, 4, 5],
5352
"group_ca": [6, 7, 8],
5453
}
54+
# Allow 40 seconds per serial registration and derive each group limit from its device list.
55+
REGISTRATION_TIMEOUT_PER_DEVICE = 40
56+
57+
58+
def group_registration_timeout(group_type):
59+
return REGISTRATION_TIMEOUT_PER_DEVICE * len(type_to_device_indices[group_type])
5560

5661

5762
@pytest.fixture(scope="module", autouse=True)
@@ -132,6 +137,7 @@ def test_device_register_with_no_device_id_for_a_x509_individual_enrollment(prot
132137
"A group of devices get provisioned to the linked IoTHub with device_ids equal to the individual registration_ids inside a group enrollment that has been created with intermediate X509 authentication"
133138
)
134139
@pytest.mark.parametrize("protocol", ["mqtt", "mqttws"])
140+
@pytest.mark.timeout(group_registration_timeout("group_intermediate"))
135141
def test_group_of_devices_register_with_no_device_id_for_a_x509_intermediate_authentication_group_enrollment(
136142
protocol,
137143
):
@@ -196,6 +202,7 @@ def test_group_of_devices_register_with_no_device_id_for_a_x509_intermediate_aut
196202
"A group of devices get provisioned to the linked IoTHub with device_ids equal to the individual registration_ids inside a group enrollment that has been created with an already uploaded ca cert X509 authentication"
197203
)
198204
@pytest.mark.parametrize("protocol", ["mqtt", "mqttws"])
205+
@pytest.mark.timeout(group_registration_timeout("group_ca"))
199206
def test_group_of_devices_register_with_no_device_id_for_a_x509_ca_authentication_group_enrollment(
200207
protocol,
201208
):

0 commit comments

Comments
 (0)