Skip to content

Commit b0ab9f9

Browse files
committed
ci,e2e: improve reest tests to make them faster
1 parent 2ad6494 commit b0ab9f9

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

.gitlab/ci/e2e/.env

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
SRSGNB_REGISTRY_URI=registry.gitlab.com/softwareradiosystems/srsgnb
22
RETINA_REGISTRY_PREFIX=registry.gitlab.com/softwareradiosystems/ci/retina
3-
RETINA_VERSION=0.48.13
3+
RETINA_VERSION=0.48.14
44
UBUNTU_VERSION=24.04
55
AMARISOFT_VERSION=2023-09-08
66
SRSUE_VERSION=23.11

tests/e2e/tests/reestablishment.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
Ping + Reestablishment Tests
1111
"""
1212
import logging
13-
import time
1413
from contextlib import suppress
1514
from typing import Optional, Sequence, Union
1615

@@ -179,15 +178,14 @@ def _ping_and_reestablishment_multi_ues(
179178
warning_as_errors=warning_as_errors,
180179
):
181180
# Launch reestablished UEs
182-
ping_task_array_reest = ping_start(reest_ue_attach_info_dict, fivegc, traffic_duration)
181+
ping_task_array_reest = ping_start(reest_ue_attach_info_dict, fivegc, traffic_duration, time_step=0)
183182
# Launch other UEs
184-
ping_task_array_other = ping_start(other_ue_attach_info_dict, fivegc, traffic_duration)
183+
ping_task_array_other = ping_start(other_ue_attach_info_dict, fivegc, traffic_duration, time_step=0)
185184

186185
# Trigger reestablishments
187186
for ue_stub in reest_ue_attach_info_dict:
188187
for _ in range(int(traffic_duration / reestablishment_interval)):
189188
ue_reestablishment(ue_stub, reestablishment_interval)
190-
time.sleep(reestablishment_interval)
191189

192190
# Wait and ignore reestablished UEs
193191
with suppress(Failed):
@@ -248,7 +246,6 @@ def _iperf_and_reestablishment_multi_ues(
248246
for ue_stub in reest_ue_attach_info_dict:
249247
for _ in range(int(traffic_duration / reestablishment_interval)):
250248
ue_reestablishment(ue_stub, reestablishment_interval)
251-
time.sleep(reestablishment_interval)
252249

253250
# Wait for reestablished UEs
254251
for ue_attached_info, task, iperf_request in iperf_dict:

tests/e2e/tests/steps/stub.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from concurrent.futures import as_completed, ThreadPoolExecutor
1414
from contextlib import contextmanager, suppress
1515
from dataclasses import dataclass
16-
from time import sleep
16+
from time import sleep, time
1717
from typing import Dict, Generator, List, Optional, Sequence, Tuple
1818

1919
import grpc
@@ -244,7 +244,7 @@ def ping(ue_attach_info_dict: Dict[UEStub, UEAttachedInfo], fivegc: FiveGCStub,
244244

245245

246246
def ping_start(
247-
ue_attach_info_dict: Dict[UEStub, UEAttachedInfo], fivegc: FiveGCStub, ping_count, time_step: int = 1
247+
ue_attach_info_dict: Dict[UEStub, UEAttachedInfo], fivegc: FiveGCStub, ping_count, time_step: float = 1
248248
) -> List[grpc.Future]:
249249
"""
250250
Ping command between an UE and a 5GC
@@ -501,11 +501,14 @@ def ue_reestablishment(
501501
"""
502502
Reestablishment one UE from already running gnb and 5gc
503503
"""
504+
t_before = time()
504505
result: ReestablishmentInfo = ue_stub.Reestablishment(UInt32Value(value=reestablishment_interval))
505506
log_fn = logging.info if result.status else logging.error
506507
log_fn("Reestablishment UE [%s]:\n%s", id(ue_stub), MessageToString(result, indent=2))
507508
if not result.status:
508509
pytest.fail("Reestablishment failed")
510+
with suppress(ValueError):
511+
sleep(reestablishment_interval - (time() - t_before))
509512

510513

511514
def ue_move(ue_stub: UEStub, x_coordinate: float, y_coordinate: float = 0, z_coordinate: float = 0):

0 commit comments

Comments
 (0)