Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce ping requirements for a successful ping #88

Merged
merged 2 commits into from
Jul 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,6 @@ services:

TIMEZONE: ${TIMEZONE}
LOGGING_LEVEL: ${API_LOGGING_LEVEL}
volumes:
- ${GOOGLE_APPLICATION_CREDENTIALS}:/google/gcp_credentials.json
logging:
options:
max-size: '10m'
Expand Down
2 changes: 1 addition & 1 deletion services/addons/images/rsu_status_check/rsu_pinger.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def ping_rsu_ips(rsu_list):
for rsu in rsu_list:
# id: rsu_id
# key: process pinging the RSU's ipv4_address
p[rsu[0]] = Popen(["ping", "-n", "-w5", "-c3", rsu[1]], stdout=DEVNULL)
p[rsu[0]] = Popen(["ping", "-n", "-w20", "-c1", rsu[1]], stdout=DEVNULL)

ping_data = {}
while p:
Expand Down
8 changes: 4 additions & 4 deletions services/addons/tests/rsu_status_check/test_rsu_pinger.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ def test_ping_rsu_ips_online(mock_Popen):
expected_result = {1: "1", 2: "1"}
mock_Popen.assert_has_calls(
[
call(["ping", "-n", "-w5", "-c3", "1.1.1.1"], stdout=DEVNULL),
call(["ping", "-n", "-w5", "-c3", "2.2.2.2"], stdout=DEVNULL),
call(["ping", "-n", "-w20", "-c1", "1.1.1.1"], stdout=DEVNULL),
call(["ping", "-n", "-w20", "-c1", "2.2.2.2"], stdout=DEVNULL),
]
)
assert mock_p.poll.call_count == len(rsu_list) # 2
Expand All @@ -59,8 +59,8 @@ def test_ping_rsu_ips_offline(mock_Popen):
expected_result = {1: "0", 2: "0"}
mock_Popen.assert_has_calls(
[
call(["ping", "-n", "-w5", "-c3", "1.1.1.1"], stdout=DEVNULL),
call(["ping", "-n", "-w5", "-c3", "2.2.2.2"], stdout=DEVNULL),
call(["ping", "-n", "-w20", "-c1", "1.1.1.1"], stdout=DEVNULL),
call(["ping", "-n", "-w20", "-c1", "2.2.2.2"], stdout=DEVNULL),
]
)
assert mock_p.poll.call_count == len(rsu_list) # 2
Expand Down
Loading