diff --git a/webhook_server/libs/test_oracle.py b/webhook_server/libs/test_oracle.py index 23a8b9048..a7d4729b2 100644 --- a/webhook_server/libs/test_oracle.py +++ b/webhook_server/libs/test_oracle.py @@ -58,7 +58,10 @@ async def call_test_oracle( msg = f"Test Oracle server at {server_url} is not responding{status_info}, skipping test analysis" github_webhook.logger.warning(f"{log_prefix} {msg}") try: - await asyncio.to_thread(pull_request.create_issue_comment, msg) + await asyncio.to_thread( + pull_request.create_issue_comment, + f"Test Oracle server is not responding{status_info}, skipping test analysis", + ) except Exception: github_webhook.logger.exception(f"{log_prefix} Failed to post health check comment") return diff --git a/webhook_server/tests/test_test_oracle.py b/webhook_server/tests/test_test_oracle.py index be1306685..014863205 100644 --- a/webhook_server/tests/test_test_oracle.py +++ b/webhook_server/tests/test_test_oracle.py @@ -88,8 +88,7 @@ async def test_health_check_non_200_posts_comment(self, mock_github_webhook: Moc mock_to_thread.assert_called_once() call_args = mock_to_thread.call_args assert call_args[0][0] == mock_pull_request.create_issue_comment - assert "not responding" in call_args[0][1] - assert "(status 503)" in call_args[0][1] + assert call_args[0][1] == "Test Oracle server is not responding (status 503), skipping test analysis" @pytest.mark.asyncio async def test_successful_analyze_call(self, mock_github_webhook: Mock, mock_pull_request: Mock) -> None: