#25497 closed Bug (worksforme)
Parallel test fails if tblib is not installed.
| Reported by: | user0007 | Owned by: | nobody |
|---|---|---|---|
| Component: | Testing framework | Version: | 1.9a1 |
| Severity: | Release blocker | Keywords: | |
| Cc: | Triage Stage: | Accepted | |
| Has patch: | no | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description (last modified by )
The error occurs when NoSuchElementException (selenium) exception is raised:
test_changing_password (apps.users.tests.test_admin.UserAdminLiveServer) failed:
NoSuchElementException()
Unfortunately, tracebacks cannot be pickled, making it impossible for the
parallel test runner to handle this exception cleanly.
In order to see the traceback, you should install tblib:
pip install tblib
(...)
subsuite_index, events = test_results.next(timeout=0.1)
File "/usr/lib/python2.7/multiprocessing/pool.py", line 659, in next
raise value
TypeError: can't pickle traceback objects
After installing tblib everything is ok:
(...) ---------------------------------------------------------------------- Ran 121 tests in 53.847s FAILED (errors=2, skipped=2)
Change History (6)
comment:1 by , 10 years ago
| Description: | modified (diff) |
|---|
follow-up: 3 comment:2 by , 10 years ago
comment:3 by , 10 years ago
Replying to knbk:
tblibwas added as a new dependency torequirements/base.txt. Simply rerunningpip install -r tests/requirements/py3.txt(orpy2.txt) solves any issues. Should the upgrade process be documented?
But it fails running custom tests, not django tests. Should I add tblib to my all projects requirements.txt?
comment:4 by , 10 years ago
| Severity: | Normal → Release blocker |
|---|---|
| Triage Stage: | Unreviewed → Accepted |
Requiring tblib is fine for Django itself, but clearly not for all user projects.
comment:5 by , 10 years ago
Would it make sense to just disable parallel tests if tblib is not installed?
comment:6 by , 10 years ago
| Resolution: | → worksforme |
|---|---|
| Status: | new → closed |
This ticket's description is misleading. Parallel test *fail to report failures correctly and suggest to install tblib* when it isn't installed.
This is the intended and documented behavior. It was discussed on the DevelopersMailingList prior to the feature being implemented and committed. As shown in your description, there's a detailed explanation message. I'm not sure what else I could do
You have three options, pick your favorite:
1) Don't run tests in parallel and get exactly the same behavior as in Django 1.8.
2) Have your tests crash hard if an exception occurs.
3) Install tblib.
Claude, in case this isn't clear, tblib is only required for getting correct failure reports when running tests in parallel.
Collin, I don't think it makes sense to ignore the --parallel option when tblib isn't installed. As long as tests complete without errors or failures, tblib isn't needed.
Of course as soon as you have a test failure you'll want to know why it fails. If you're absolutely unable to pip install tblib and absolutely need to run tests in parallel — I can't see why that would be the case, but for the sake of the argument let's assume at least one user will be in this situation — you can re-run just the failing test without the --parallel option.
If someone proposes a patch to improve the situation, we can reopen this discussion.
tblibwas added as a new dependency torequirements/base.txt. Simply rerunningpip install -r tests/requirements/py3.txt(orpy2.txt) solves any issues. Should the upgrade process be documented?