Skip to content

Commit 7deebaa

Browse files
wsycqyzAharonMalkin
authored andcommitted
Fix test failure in test_cont_link_flap.py (sonic-net#8128)
Fixes test failure in test_cont_link_flap.py caused by sonic-net#7968 What is the motivation for this PR? Test failed with error: File "/azp/_work/6/s/tests/platform_tests/link_flap/test_cont_link_flap.py", line 145, in test_cont_link_flap incr_redis_memory = float(end_time_redis_memory) - float(start_time_redis_memory) ValueError: could not convert string to float: '\1' How did you do it? Correct reg express. How did you verify/test it? Manually run test case: test_cont_link_flap.py
1 parent e8fc225 commit 7deebaa

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

tests/platform_tests/link_flap/test_cont_link_flap.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def test_cont_link_flap(self, request, duthosts, nbrhosts, enum_rand_one_per_hws
5454

5555
# Record Redis Memory at start
5656
start_time_redis_memory = duthost.shell(
57-
r"redis-cli info memory | grep used_memory_human | sed -e 's/.*:\(.*\)M/\\1/'")["stdout"]
57+
r"redis-cli info memory | grep used_memory_human | sed -e 's/.*:\(.*\)M/\1/'")["stdout"]
5858
logging.info("Redis Memory: %s M", start_time_redis_memory)
5959

6060
# Record ipv4 route counts at start
@@ -137,7 +137,7 @@ def test_cont_link_flap(self, request, duthosts, nbrhosts, enum_rand_one_per_hws
137137

138138
# Record Redis Memory at end
139139
end_time_redis_memory = duthost.shell(
140-
r"redis-cli info memory | grep used_memory_human | sed -e 's/.*:\(.*\)M/\\1/'")["stdout"]
140+
r"redis-cli info memory | grep used_memory_human | sed -e 's/.*:\(.*\)M/\1/'")["stdout"]
141141
logging.info("Redis Memory at start: %s M", start_time_redis_memory)
142142
logging.info("Redis Memory at end: %s M", end_time_redis_memory)
143143

tests/platform_tests/link_flap/test_link_flap.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def test_link_flap(request, duthosts, rand_one_dut_hostname, tbinfo, fanouthosts
3737

3838
# Record Redis Memory at start
3939
start_time_redis_memory = duthost.shell(
40-
r"redis-cli info memory | grep used_memory_human | sed -e 's/.*:\(.*\)M/\\1/'")["stdout"]
40+
r"redis-cli info memory | grep used_memory_human | sed -e 's/.*:\(.*\)M/\1/'")["stdout"]
4141
logger.info("Redis Memory: %s M", start_time_redis_memory)
4242

4343
# Make Sure Orch CPU < orch_cpu_threshold before starting test.
@@ -76,7 +76,7 @@ def test_link_flap(request, duthosts, rand_one_dut_hostname, tbinfo, fanouthosts
7676

7777
# Record Redis Memory at end
7878
end_time_redis_memory = duthost.shell(
79-
r"redis-cli info memory | grep used_memory_human | sed -e 's/.*:\(.*\)M/\\1/'")["stdout"]
79+
r"redis-cli info memory | grep used_memory_human | sed -e 's/.*:\(.*\)M/\1/'")["stdout"]
8080
logger.info("Redis Memory at start: %s M", start_time_redis_memory)
8181
logger.info("Redis Memory at end: %s M", end_time_redis_memory)
8282

0 commit comments

Comments
 (0)