Skip to content
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: 1 addition & 1 deletion runpod/serverless/modules/rp_ping.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,6 @@ async def _send_ping(self):
log.debug(f"Heartbeat Sent | URL: {PING_URL} | Status: {result.status_code}")
log.debug(f"Heartbeat | Interval: {PING_INTERVAL}ms | Params: {ping_params}")

except Exception as err: # pylint: disable=broad-except
except aiohttp.ClientError as err:
log.error(f"Heartbeat Failed URL: {PING_URL} Params: {ping_params}")
log.error(f"Heartbeat Fail Error: {err}")
4 changes: 3 additions & 1 deletion tests/test_serverless/test_modules/test_ping.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

from unittest import IsolatedAsyncioTestCase
from unittest.mock import patch, Mock

import aiohttp
from runpod.serverless.modules import rp_ping

class TestPing(IsolatedAsyncioTestCase):
Expand Down Expand Up @@ -54,7 +56,7 @@ async def test_start_ping(self):
self.assertEqual(rp_ping.PING_URL, "https://test.com/ping")

# Exception case
mock_get.side_effect = Exception("Test exception")
mock_get.side_effect = aiohttp.ClientError("Test Error")

with patch("runpod.serverless.modules.rp_ping.log.error") as mock_log_error:
await new_ping._send_ping() # pylint: disable=protected-access
Expand Down