Skip to content

Commit e7cfb3e

Browse files
authored
Fix test_sysuptime failure (#16528)
* The change strips comma (if present) from py_gnmicli proc/uptime output before converting to float What is the motivation for this PR? Fix broken test How did you do it? Fix format parsing before type conversion How did you verify/test it? Tested on 7050cx3
1 parent 21dbd80 commit e7cfb3e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tests/telemetry/test_telemetry.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ def test_sysuptime(duthosts, enum_rand_one_per_hwsku_hostname, ptfhost, gnxi_pat
230230
for line_info in system_uptime_info:
231231
if "total" in line_info:
232232
try:
233-
system_uptime_1st = float(line_info.split(":")[1].strip())
233+
system_uptime_1st = float(line_info.split(":")[1].strip().rstrip(','))
234234
found_system_uptime_field = True
235235
except ValueError as err:
236236
pytest.fail(

0 commit comments

Comments
 (0)