Pull requests / #3018

#3018 tests: test_setup_golden pins the core count the golden output depends on

open · @Buddychek · 0 comments · View on GitHub

Setup & installModels & quants

Description

## Title
tests: test_setup_golden pins the core count the golden output depends on

Issue: Resolves #

## Summary

`setup.py` derives the CPU vision encoder's thread count from `os.cpu_count()`, and `tools/test_setup_golden.py` compares setup's output against a golden text. The golden was produced on the baseline PC, so on a machine with a different core count the comparison moved with the hardware - the test failed for reasons that had nothing to do with the change under review. The core count is now mocked, as RAM and page file already are.

## What changed

- `tools/test_setup_golden.py` - `import os`, and `mock.patch.object(os, "cpu_count", lambda: 12)` added to the existing patch block (the baseline PC's cores).

## Extra Notes

**Measured on this PC (no GPU, no downloads - setup's own tests need neither):**
- `tools/test_setup_golden.py`: 4/4 OK.
- Fails on a machine whose core count differs from 12 before the mock, passes after.

**Scope:** the mock matches the pattern the test already uses for `ram_gb` and `page_file_gb`; no golden text is edited, so the expected output stays the baseline PC's.

No engine, server, or setup code is touched; the default path is byte-identical.

Related on this site

Quick links to related pages.