1

in a github action yml file it's defined this step to run django tests:

python manage.py test --failfast --parallel 2

looks like --parallel 2 breaks it:

multiprocessing.pool.RemoteTraceback: 
"""
Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.10.6/x64/lib/python3.10/multiprocessing/pool.py", line 125, in worker
    result = (True, func(*args, **kwds))
  File "/opt/hostedtoolcache/Python/3.10.6/x64/lib/python3.10/site-packages/django/test/runner.py", line 449, in _run_subsuite
    result = runner.run(subsuite)
  File "/opt/hostedtoolcache/Python/3.10.6/x64/lib/python3.10/site-packages/django/test/runner.py", line 366, in run
    test(result)
  File "/opt/hostedtoolcache/Python/3.10.6/x64/lib/python3.10/unittest/suite.py", line 84, in __call__
    return self.run(*args, **kwds)
  File "/opt/hostedtoolcache/Python/3.10.6/x64/lib/python3.10/unittest/suite.py", line 122, in run
    test(result)
  File "/opt/hostedtoolcache/Python/3.10.6/x64/lib/python3.10/site-packages/django/test/testcases.py", line 381, in __call__
    self._setup_and_call(result)
  File "/opt/hostedtoolcache/Python/3.10.6/x64/lib/python3.10/site-packages/django/test/testcases.py", line 416, in _setup_and_call
    super().__call__(result)
  File "/opt/hostedtoolcache/Python/3.10.6/x64/lib/python3.10/unittest/case.py", line 650, in __call__
    return self.run(*args, **kwds)
  File "/opt/hostedtoolcache/Python/3.10.6/x64/lib/python3.10/unittest/case.py", line 599, in run
    self._feedErrorsToResult(result, outcome.errors)
  File "/opt/hostedtoolcache/Python/3.10.6/x64/lib/python3.10/unittest/case.py", line 516, in _feedErrorsToResult
    result.addFailure(test, exc_info)
  File "/opt/hostedtoolcache/Python/3.10.6/x64/lib/python3.10/site-packages/django/test/runner.py", line 296, in addFailure
    self.check_picklable(test, err)
  File "/opt/hostedtoolcache/Python/3.10.6/x64/lib/python3.10/site-packages/django/test/runner.py", line 216, in check_picklable
    self._confirm_picklable(err)
  File "/opt/hostedtoolcache/Python/3.10.6/x64/lib/python3.10/site-packages/django/test/runner.py", line 186, in _confirm_picklable
    pickle.loads(pickle.dumps(obj))
TypeError: cannot pickle 'traceback' object
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/runner/work/fiscozen/fiscozen/fiscozen_django/manage.py", line 24, in <module>
    execute_from_command_line(sys.argv)
  File "/opt/hostedtoolcache/Python/3.10.6/x64/lib/python3.10/site-packages/django/core/management/__init__.py", line 442, in execute_from_command_line
    utility.execute()
  File "/opt/hostedtoolcache/Python/3.10.6/x64/lib/python3.10/site-packages/django/core/management/__init__.py", line 436, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/opt/hostedtoolcache/Python/3.10.6/x64/lib/python3.10/site-packages/django/core/management/commands/test.py", line 24, in run_from_argv
    super().run_from_argv(argv)
  File "/opt/hostedtoolcache/Python/3.10.6/x64/lib/python3.10/site-packages/django/core/management/base.py", line 412, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/opt/hostedtoolcache/Python/3.10.6/x64/lib/python3.10/site-packages/django/core/management/base.py", line 458, in execute
    output = self.handle(*args, **options)
  File "/opt/hostedtoolcache/Python/3.10.6/x64/lib/python3.10/site-packages/django/core/management/commands/test.py", line 68, in handle
    failures = test_runner.run_tests(test_labels)
  File "/opt/hostedtoolcache/Python/3.10.6/x64/lib/python3.10/site-packages/django/test/runner.py", line 1061, in run_tests
    result = self.run_suite(suite)
  File "/opt/hostedtoolcache/Python/3.10.6/x64/lib/python3.10/site-packages/django/test/runner.py", line 983, in run_suite
    return runner.run(suite)
  File "/opt/hostedtoolcache/Python/3.10.6/x64/lib/python3.10/unittest/runner.py", line 184, in run
    test(result)
  File "/opt/hostedtoolcache/Python/3.10.6/x64/lib/python3.10/unittest/suite.py", line 84, in __call__
    return self.run(*args, **kwds)
  File "/opt/hostedtoolcache/Python/3.10.6/x64/lib/python3.10/site-packages/django/test/runner.py", line 534, in run
    subsuite_index, events = test_results.next(timeout=0.1)
  File "/opt/hostedtoolcache/Python/3.10.6/x64/lib/python3.10/multiprocessing/pool.py", line 873, in next
    raise value
TypeError: cannot pickle 'traceback' object
Error: Process completed with exit code 1.

anybody experienced it?

3
  • 2
    this looks familiar, I believe I had to pip install tblib to get the actual traceback but I'm not 100% sure Commented May 12, 2023 at 23:10
  • Does this answer your question? Why can't I pickle an error's Traceback in Python? Commented May 13, 2023 at 6:37
  • 1
    @Azeem yes it does Commented Jun 30, 2023 at 16:13

1 Answer 1

0

According to this 10 year old ticket to work with parallel flag you can:

  1. Ideally install tblib as a dev dependency so that exceptions/tracebacks can be pickled

  2. If you cannot install dependencies for some reason you can re-run just the failing test without the --parallel option to see the error.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.