From de43c6a16360dac02f3ba276184ddab61110a153 Mon Sep 17 00:00:00 2001 From: slutati1536 <69785882+slutati1536@users.noreply.github.com> Date: Tue, 20 Jul 2021 19:28:10 +0300 Subject: [PATCH] Added retry to sonic-mgmt docker container (#7997) Why I did it the motivation for this PR is to add retry_call to several test cases in the community, for example, the following cases: test_show_platform_fanstatus_mocked test_show_platform_temperature_mocked are executing a command once and comparing the output to the expected mock data, sometimes differences between the mock and the actual are causing the tests to fail. retry will make these tests more stable. retry will also be more efficient than sleep which will cause the tests to run longer because sometimes it is not necessary to sleep all that time, retry will only run a function only until it passed. How I did it added retry to the docker file How to verify it I run the tests with retry on the docker after installing the retry package Signed-off-by: Sharon Lutati --- dockers/docker-sonic-mgmt/Dockerfile.j2 | 1 + 1 file changed, 1 insertion(+) diff --git a/dockers/docker-sonic-mgmt/Dockerfile.j2 b/dockers/docker-sonic-mgmt/Dockerfile.j2 index 5f880dda7d..23007ffb9a 100644 --- a/dockers/docker-sonic-mgmt/Dockerfile.j2 +++ b/dockers/docker-sonic-mgmt/Dockerfile.j2 @@ -70,6 +70,7 @@ RUN pip install cffi==1.10.0 \ tabulate \ textfsm \ virtualenv \ + retry \ && git clone https://github.com/p4lang/scapy-vxlan.git \ && cd scapy-vxlan \ && python setup.py install \