Hi, When setting `[pytest].xdist_enabled = false` ...
# general
h
Hi, When setting
[pytest].xdist_enabled = false
in
pants.toml
, I get:
Copy code
Engine traceback:
  in `test` goal

UnicodeDecodeError: 'utf-8' codec can't decode byte 0x84 in position 1437: invalid start byte
Tried with both 2.16.0rc1 and 2.16.0rc3. Didn't reproduce locally, did reproduce in CI. A major difference is that locally I've tried with a small number of tests. Any idea?
Works fine with
xdist_enabled = true
. Locally I use a macbook, CI is a fat (lots of cores) EC2 instance running Debian.
h
That is very weird. What's the full output (with -ldebug and --print-stacktrace) ?
h
Checking...
Copy code
15:53:04.53 [ERROR] 1 Exception encountered:

Engine traceback:
  in select
    ..
  in pants.core.goals.test.run_tests
    `test` goal

Traceback (most recent call last):
  File "/opt/pantsbuild/.cache/nce/ae553d873185fa750061b1a3d4226442fb99fb55d4403b0227ec972406554da3/bindings/venvs/2.16.0rc1/lib/python3.9/site-packages/pants/engine/internals/selectors.py", line 623, in native_engine_generator_send
    res = rule.send(arg) if err is None else rule.throw(throw or err)
  File "/opt/pantsbuild/.cache/nce/ae553d873185fa750061b1a3d4226442fb99fb55d4403b0227ec972406554da3/bindings/venvs/2.16.0rc1/lib/python3.9/site-packages/pants/core/goals/test.py", line 832, in run_tests
    results = await MultiGet(
  File "/opt/pantsbuild/.cache/nce/ae553d873185fa750061b1a3d4226442fb99fb55d4403b0227ec972406554da3/bindings/venvs/2.16.0rc1/lib/python3.9/site-packages/pants/engine/internals/selectors.py", line 358, in MultiGet
    return await _MultiGet(tuple(__arg0))
  File "/opt/pantsbuild/.cache/nce/ae553d873185fa750061b1a3d4226442fb99fb55d4403b0227ec972406554da3/bindings/venvs/2.16.0rc1/lib/python3.9/site-packages/pants/engine/internals/selectors.py", line 165, in __await__
    result = yield self.gets
  File "/opt/pantsbuild/.cache/nce/ae553d873185fa750061b1a3d4226442fb99fb55d4403b0227ec972406554da3/bindings/venvs/2.16.0rc1/lib/python3.9/site-packages/pants/engine/internals/selectors.py", line 623, in native_engine_generator_send
    res = rule.send(arg) if err is None else rule.throw(throw or err)
  File "/opt/pantsbuild/.cache/nce/ae553d873185fa750061b1a3d4226442fb99fb55d4403b0227ec972406554da3/bindings/venvs/2.16.0rc1/lib/python3.9/site-packages/pants/backend/python/goals/pytest_runner.py", line 507, in run_python_tests
    return TestResult.from_batched_fallible_process_result(
  File "/opt/pantsbuild/.cache/nce/ae553d873185fa750061b1a3d4226442fb99fb55d4403b0227ec972406554da3/bindings/venvs/2.16.0rc1/lib/python3.9/site-packages/pants/core/goals/test.py", line 172, in from_batched_fallible_process_result
    stdout=process_result.stdout.decode(),
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x84 in position 1437: invalid start byte
I assume it means that my tests print something which is not
UTF-8
, but I have no idea what that is and there are thousands (probably more) of test.
I'm up for some debugging that might lead to a PR if I'm being guided.
Actually, I'll just try something on my own. Will update.
h
Exactly, I guess we're assuming user test output is UTF8
which may not be a good assumption
h
Well, I just remembered that I don't know how to reproduce it locally...
f
yeah we shouldn't assume
ProcessResult.stdout
is in any particular format
h
@high-magician-46188 can you file a bug?
h
🙏 1