Skip to content

Commit 548cd1a

Browse files
yaqiangzvikshaw-Nokia
authored andcommitted
[dhcp_relay] Add delay in checking dhcp_relay status (sonic-net#14739)
What is the motivation for this PR? In some scenario, checking process status would happen before dhcp_relay starting. This PR is to fix it. How did you do it? Add delay and modify check logic How did you verify/test it? PR test
1 parent a87284e commit 548cd1a

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

tests/dhcp_relay/dhcp_relay_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def restart_dhcp_service(duthost):
3939
def _is_dhcp_relay_ready():
4040
output = duthost.shell('docker exec dhcp_relay supervisorctl status | grep dhcp | awk \'{print $2}\'',
4141
module_ignore_errors=True)
42-
return (not output['rc'] and output['stderr'] == '' and
42+
return (not output['rc'] and output['stderr'] == '' and len(output['stdout_lines']) != 0 and
4343
all(element == 'RUNNING' for element in output['stdout_lines']))
4444

45-
pytest_assert(wait_until(60, 1, 0, _is_dhcp_relay_ready), "dhcp_relay is not ready after restarting")
45+
pytest_assert(wait_until(60, 1, 10, _is_dhcp_relay_ready), "dhcp_relay is not ready after restarting")

0 commit comments

Comments
 (0)