Skip to content

Allow None vram_total_gb in test_gpu.py snapshot test#26

Merged
cryptopoly merged 1 commit intomainfrom
fix/test-gpu-none-tolerance
May 1, 2026
Merged

Allow None vram_total_gb in test_gpu.py snapshot test#26
cryptopoly merged 1 commit intomainfrom
fix/test-gpu-none-tolerance

Conversation

@cryptopoly
Copy link
Copy Markdown
Owner

Trivial CI test fix. PR #22 changed _snapshot_nvidia to return vram_total_gb=None when neither torch.cuda nor nvidia-smi can answer (the no-system-RAM-fallback contract), but the pre-existing test_snapshot_vram_values_are_numeric still required (int, float). Linux CI runners hit the None branch and fail.

Fix landed twice on side branches (3b147a9 in PR #24, 59cd81c in PR #25) but both pushes happened after the parent PR had already merged, so they orphaned. Landing it directly here.

Loosens the type check to (int, float, type(None)) and renames the test to ..._numeric_or_none.

.venv/bin/python -m pytest tests/test_gpu.py -q
.................s                                                       [100%]

PR #22 (Fix Windows CUDA detection) replaced the system-RAM-as-VRAM
fallback in _snapshot_nvidia with a no-GPU response that returns
{'vram_total_gb': None, 'vram_used_gb': None}. The pre-existing
test_snapshot_vram_values_are_numeric still required (int, float),
which breaks on the Linux CI runner where neither torch.cuda nor
nvidia-smi is available.

This fix originally landed in branch fix/test-host-platform-mock
(commit 3b147a9) but was pushed after PR #24 had already merged. It
was added to PR #25 too late again — same pattern. Land it directly
this time before any other CI run picks up the broken contract.

Loosen the type check to (int, float, type(None)) so the no-GPU path
is accepted, and rename the test to ..._numeric_or_none to make the
intent loud at the call site.
@cryptopoly cryptopoly merged commit 9fae81e into main May 1, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant