janhoy opened a new pull request, #71:
URL: https://github.com/apache/solr-orbit/pull/71

   Unit tests fail on `main` (and on every open PR) with:
   
   ```
   FAILED 
tests/builder/launcher_test.py::ProcessLauncherTests::test_daemon_start_stop
     - AttributeError: 'MockPopen' object has no attribute 'args'
   ```
   
   `ProcessLauncher.stop()` calls `telemetry.add_metadata_for_node()` -> 
`sysstats.cpu_model()` -> `cpuinfo.get_cpu_info()`, which shells out to `dmesg 
-a` on Linux. The test patches `subprocess.Popen` with `MockPopen`, and 
`subprocess.run()` reads `process.args` when building the `CompletedProcess` it 
returns.
   
   This surfaced now because `pytest-benchmark` 5.2.3 pulls in `py-cpuinfo2`, 
which installs over the same `cpuinfo` package as `py-cpuinfo` and uses 
`subprocess.run()` where the older code used `Popen` directly.
   
   Fix: set `args` in `MockPopen` so it matches the `Popen` contract. `poll()` 
still returns `None`, so cpuinfo sees a non-zero return code and skips the 
output — the mock stays inert, as intended.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to