From 0ceaf103a54e91bd318b92c9310211df38050708 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20Walstr=C3=B6m?= Date: Fri, 21 Aug 2026 10:13:34 +0200 Subject: [PATCH 1/2] test: ptp: Add debug info to investigate flaky behavior MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Have been seen failure on hardware `PTP transparent clock (IEEE 802.1AS)` where it fails on hardware in CI: Test File: /home/styx/.ghmoon/kernelkit/infix/git/test/case/ptp/transparent_clock/ieee802dot1as.py Test Cmdl: ['--profile', 'ieee802-dot1as'] 2026-08-20 13:25:58 # Starting (2026-08-20 13:25:58) 2026-08-20 13:25:58 # host: monza 2026-08-20 13:25:58 # mgmt1: sw1p3 2026-08-20 13:25:58 # mgmt2: sw1p2 2026-08-20 13:25:58 # mgmt3: sw1p1 2026-08-20 13:25:58 # gm: styx3 2026-08-20 13:25:58 # data: e3 2026-08-20 13:25:58 # mgmt: e28 2026-08-20 13:25:58 # tc: styx2 2026-08-20 13:25:58 # uplink: e4 2026-08-20 13:25:58 # dnlink: e3 2026-08-20 13:25:58 # mgmt: e28 2026-08-20 13:25:58 # receiver: styx1 2026-08-20 13:25:58 # data: e4 2026-08-20 13:25:58 # mgmt: e28 2026-08-20 13:25:58 # 2026-08-20 13:25:58 # Waiting for DUTs to become reachable... 2026-08-20 13:25:58 # Probing styx3 on port sw1p3 for IPv6LL mgmt address ... 2026-08-20 13:25:58 # Testing using RESTCONF 2026-08-20 13:25:59 # YANG models downloaded. 2026-08-20 13:26:02 # Waiting for DUTs to become reachable... 2026-08-20 13:26:02 # Probing styx2 on port sw1p2 for IPv6LL mgmt address ... 2026-08-20 13:26:02 # Testing using RESTCONF 2026-08-20 13:26:02 # YANG models downloaded. 2026-08-20 13:26:06 # Waiting for DUTs to become reachable... 2026-08-20 13:26:07 # Probing styx1 on port sw1p1 for IPv6LL mgmt address ... 2026-08-20 13:26:07 # Testing using RESTCONF 2026-08-20 13:26:07 # YANG models downloaded. 2026-08-20 13:26:10 ok 1 - Set up topology and attach to DUTs 2026-08-20 13:26:12 ok 2 - Configure grandmaster (OC, priority1=1, p2p) 2026-08-20 13:26:14 ok 3 - Configure transparent clock (p2p-tc, ieee802-dot1as) 2026-08-20 13:26:15 ok 4 - Configure time receiver (OC, priority1=128, client-only) 2026-08-20 13:26:18 ok 5 - Wait for grandmaster port to become time-transmitter 2026-08-20 13:26:22 ok 6 - Wait for time receiver to reach time-receiver state 2026-08-20 13:26:23 ok 7 - Verify time receiver steps-removed equals 1 2026-08-20 13:31:31 not ok 8 - Wait for time receiver offset to converge 2026-08-20 13:31:31 # Exiting (2026-08-20 13:31:31) 2026-08-20 13:31:31 # Traceback (most recent call last): 2026-08-20 13:31:31 # File "/home/styx/.ghmoon/kernelkit/infix/git/test/case/ptp/transparent_clock/ieee802dot1as.py", line 173, in 2026-08-20 13:31:31 # until(lambda: ptp.has_converged(receiver, threshold_ns), attempts=180) 2026-08-20 13:31:31 # File "/home/styx/.ghmoon/kernelkit/infix/git/test/infamy/util.py", line 55, in until 2026-08-20 13:31:31 # raise Exception("Expected condition did not materialize") 2026-08-20 13:31:31 # Exception: Expected condition did not materialize 2026-08-20 13:31:31 # 1..8 test error, no plan Add more debug to be able to investigate it when it occur. Signed-off-by: Mattias Walström --- test/infamy/ptp.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/test/infamy/ptp.py b/test/infamy/ptp.py index a2b8826c0..020b0bed7 100644 --- a/test/infamy/ptp.py +++ b/test/infamy/ptp.py @@ -84,11 +84,19 @@ def is_own_gm(target, inst_idx=0): def has_converged(target, threshold_ns=100_000, inst_idx=0): - """True when |offset-from-time-transmitter| < threshold_ns.""" + """True when |offset-from-time-transmitter| < threshold_ns. + + Prints the offset while unconverged, so a failed until() wait + shows the offset trend in the test log. + """ off = offset_ns(target, inst_idx) if off is None: + print(f"{target.name}: no offset-from-time-transmitter") return False - return abs(off) < threshold_ns + if abs(off) < threshold_ns: + return True + print(f"{target.name}: offset {off} ns, threshold {threshold_ns} ns") + return False def port_state_dbg(target, port_idx=1, inst_idx=0): From 9ee42fc7516caca9151c883b1f1bbd81c48c4b5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mattias=20Walstr=C3=B6m?= Date: Fri, 21 Aug 2026 13:41:00 +0200 Subject: [PATCH 2/2] test: bump support collect timeout to 300s MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The collection scales with port count (three ethtool calls per interface, incl. SFP EEPROM reads) and log size, and 120s is not always enough on a 28-port switch at the end of a full test run. Signed-off-by: Mattias Walström --- test/case/misc/support_collect/test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/case/misc/support_collect/test.py b/test/case/misc/support_collect/test.py index 1ff1d630f..e1399288a 100755 --- a/test/case/misc/support_collect/test.py +++ b/test/case/misc/support_collect/test.py @@ -42,7 +42,7 @@ result = tgtssh.run("sudo support --work-dir /tmp collect --log-sec 2", stdout=f, stderr=subprocess.PIPE, - timeout=120) + timeout=300) if result.returncode != 0: stderr_output = result.stderr.decode('utf-8') if result.stderr else "" @@ -120,7 +120,7 @@ result = tgtssh.run(f"sudo support --work-dir /tmp collect --log-sec 2 --password {test_password}", stdout=f, stderr=subprocess.PIPE, - timeout=120) + timeout=300) if result.returncode != 0: stderr_output = result.stderr.decode('utf-8') if result.stderr else ""