Skip to content

Commit 7f31c04

Browse files
committed
fix(fitness): resolve CodeQL and Copilot feedback comments
- Remove unused asyncio import from rp_fitness.py - Remove unused Any import from rp_system_fitness.py - Remove unused imports from test files (os from test_fitness.py, os and subprocess from test_system_fitness.py, _run_gpu_test_fallback from test_gpu_fitness.py) - Add explanatory comments to empty except blocks in test_gpu_fitness_integration.py fixture cleanup - Test assertion already uses == 6 (previously addressed)
1 parent dcabce4 commit 7f31c04

6 files changed

Lines changed: 4 additions & 6 deletions

File tree

runpod/serverless/modules/rp_fitness.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
Fitness checks do NOT run in local development mode or testing mode.
99
"""
1010

11-
import asyncio
1211
import inspect
1312
import sys
1413
import traceback

runpod/serverless/modules/rp_system_fitness.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
import shutil
1717
import subprocess
1818
import time
19-
from typing import Any, Dict, Optional
19+
from typing import Dict, Optional
2020

2121
from .rp_fitness import register_fitness_check
2222
from .rp_logger import RunPodLogger

tests/test_serverless/test_modules/test_fitness.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
"""
88

99
import asyncio
10-
import os
1110
import pytest
1211
from unittest.mock import patch, MagicMock
1312

tests/test_serverless/test_modules/test_gpu_fitness.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
_parse_gpu_test_output,
1717
_get_gpu_test_binary_path,
1818
_run_gpu_test_binary,
19-
_run_gpu_test_fallback,
2019
_check_gpu_health,
2120
auto_register_gpu_check,
2221
)

tests/test_serverless/test_modules/test_gpu_fitness_integration.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ def mock_gpu_test_binary():
5555
try:
5656
os.unlink(binary_path)
5757
except OSError:
58+
# Best-effort cleanup: ignore if file already deleted or inaccessible
5859
pass
5960

6061

@@ -77,6 +78,7 @@ def mock_gpu_test_binary_failure():
7778
try:
7879
os.unlink(binary_path)
7980
except OSError:
81+
# Best-effort cleanup: ignore if file already deleted or inaccessible
8082
pass
8183

8284

@@ -105,6 +107,7 @@ def mock_gpu_test_binary_multi_gpu():
105107
try:
106108
os.unlink(binary_path)
107109
except OSError:
110+
# Best-effort cleanup: ignore if file already deleted or inaccessible
108111
pass
109112

110113

tests/test_serverless/test_modules/test_system_fitness.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
"""
77

88
import asyncio
9-
import os
10-
import subprocess
119
from unittest.mock import patch, MagicMock, AsyncMock
1210

1311
import pytest

0 commit comments

Comments
 (0)