xiaodu55 e3f21ce105
test: fix two Windows-host failures (subprocess encoding, budget-boundary epsilon) (#6627)
* test: fix two Windows-host failures (subprocess encoding, budget-boundary epsilon)

- test_env_file: pin PYTHONIOENCODING=utf-8 in the stripped child env;
  without it the child writes stderr in the host's ANSI codepage while
  the UTF-8-mode parent decodes it, the reader thread dies on the first
  non-ASCII byte, and stderr comes back None;
- test_jina_retries: give the budget-cap assertion a 1e-9 tolerance —
  deadline = now + budget rounds, so the cap lands a few ulps above the
  exact 0.05 (observed 0.05000000000291038).

Fixes #6626

* test: pin both sides of the capture and use an uptime-proof budget tolerance

- test_env_file: the parent's capture decodes with the host locale when
  pytest runs without the Makefile's UTF-8 pins, so the child-side pin
  alone mirrored the crash rather than eliminating it. Pin the capture
  explicitly (encoding=utf-8, errors=replace, per the
  test_local_sandbox_encoding.py precedent) and carry both suite pins in
  the child env (PYTHONUTF8=1 + PYTHONIOENCODING=utf-8).
- test_jina_retries: the float error scales with loop-time magnitude
  (host uptime), not with 0.05; a 1e-9 absolute slack leaves a ~389-day-
  uptime flake window. Use a relative tolerance instead.

---------

Co-authored-by: xiaodu55 <xiaodu55@users.noreply.github.com>
2026-10-10 20:48:39 +08:00
..