Hi all, I’m experiencing difficulties trying to ru...
# general
f
Hi all, I’m experiencing difficulties trying to run tests on
master
. They come from a runtime error in pex. Here is a repro:
Copy code
./pants test tests/python/pants_test/backend/jvm/tasks/jvm_compile/zinc:zinc_compile_integration
Copy code
16:05:07 00:17       [run]
                     Traceback (most recent call last):
                       File "/Users/pchevalier/Documents/code/pants/.pants.d/test/pytest-prep/CPython-3.6.4/0de04c112d1f5c996126ea94d80b19cbaccfa5d0/.bootstrap/pex/pex.py", line 391, in execute
                         working_set = self._activate()
                       File "/Users/pchevalier/Documents/code/pants/.pants.d/test/pytest-prep/CPython-3.6.4/0de04c112d1f5c996126ea94d80b19cbaccfa5d0/.bootstrap/pex/pex.py", line 89, in _activate
                         for dist in env.activate():
                       File "/Users/pchevalier/Documents/code/pants/.pants.d/test/pytest-prep/CPython-3.6.4/0de04c112d1f5c996126ea94d80b19cbaccfa5d0/.bootstrap/pex/environment.py", line 232, in activate
                         self._working_set = self._activate()
                       File "/Users/pchevalier/Documents/code/pants/.pants.d/test/pytest-prep/CPython-3.6.4/0de04c112d1f5c996126ea94d80b19cbaccfa5d0/.bootstrap/pex/environment.py", line 393, in _activate
                         resolved = self._resolve(working_set, all_reqs)
                       File "/Users/pchevalier/Documents/code/pants/.pants.d/test/pytest-prep/CPython-3.6.4/0de04c112d1f5c996126ea94d80b19cbaccfa5d0/.bootstrap/pex/environment.py", line 275, in _resolve
                         distributions_by_key[distribution.as_requirement().key].append(distribution)
                     AttributeError: 'NoneType' object has no attribute 'as_requirement'
                   tests/python/pants_test/backend/jvm/tasks/jvm_compile/zinc:zinc_compile_integration.....   NOT RUN
FAILURE
Has anyone seen this/know what to do about it?
a
I see the same, and it goes away if I revert the pex2 upgrade
f
Note that it seems to be working on CI
For some reason
For the record, I also tried running with v2, but it timed out:
Copy code
./pants --no-v1 --v2 test tests/python/pants_test/backend/jvm/tasks/jvm_compile/zinc:zinc_compile_integration
Copy code
14:46:27 [INFO] Starting tests: tests/python/pants_test/backend/jvm/tasks/jvm_compile/zinc:zinc_compile_integration
15:03:46 [INFO] Tests failed: tests/python/pants_test/backend/jvm/tasks/jvm_compile/zinc:zinc_compile_integration
tests/python/pants_test/backend/jvm/tasks/jvm_compile/zinc:zinc_compile_integration stdout:
Exceeded timeout of 900s for local process execution, Run Pytest for tests/python/pants_test/backend/jvm/tasks/jvm_compile/zinc:zinc_compile_integration

tests/python/pants_test/backend/jvm/tasks/jvm_compile/zinc:zinc_compile_integration.....   FAILURE

Tests failed
h
Does it still fail without Pexrc? I haven’t encountered this
f
Yes
So if you run the command I gave on master, the tests run for you?
h
Well, so, I don’t have JDK 8 installed so I don’t expect it to pass for me. (I’ve tried installing JDK 8 with Jabba and couldn’t get it working) But, fwit, I’ll try the command
(Btw,
./v2
is an alias for
./pants --no-v1 --v2
!)
👍 1
f
I can also repro with
Copy code
./pants test tests/python/pants_test/backend/docgen/tasks:
for instance, which doesn’t depend on the jvm
👍 1
h
Btw,
./pants test tests/python/pants_test/backend/jvm/tasks/jvm_compile/zinc:zinc_compile_integration
worked fine minus 2 tests that needed JDK 8
f
So I’m not sure exactly what gave, but these steps fixed it for me:
Copy code
rm -rf ~/.cache/pants .pants.d
git clean -fdx
./pants clean-all
Note that at some point before the
git clean -fdx
, I hit another failure with this line:
ImportError: bad magic number in 'pex.vendor._vendored.setuptools': b'\x03\xf3\r\n'
so if you hit this,
git clean -fdx
and
./pants clean-all
may get you back to a working state.
💯 1
h
Ah, the bad magic number was an issue from an older version of Pex that Benjy fixed last week
👍 1