#28 Test failure - test_detaches_process_context
Closed: Insufficient data by bignose. Opened by dannym.


FAIL: test_detaches_process_context (test.test_daemon.DaemonContext_open_TestCase)
test.test_daemon.DaemonContext_open_TestCase.test_detaches_process_context


testtools.testresult.real._StringException: Traceback (most recent call last):
File "/tmp/guix-build-python-daemon-2.2.3.drv-0/python-daemon-2.2.3/test/test_daemon.py", line 491, in test_detaches_process_context
self.mock_module_daemon.detach_process_context.assert_called_with()
File "/gnu/store/jqr6s3a6shyz9k62xf3wglbwpzqdh68d-python-mock-2.0.0/lib/python3.7/site-packages/mock/mock.py", line 925, in assert_called_with
raise AssertionError('Expected call: %s\nNot called' % (expected,))
AssertionError: Expected call: detach_process_context()
Not called


Ran 356 tests in 1.377s

FAILED (failures=1, skipped=2)
Test failed:
error: Test failed:


This test failure occurs on the Guix distribution, inside a build container.

How can I debug it further?


dannym wrote:

Ran 356 tests in 1.377s
FAILED (failures=1, skipped=2)

How weird, just one test failure.

This test failure occurs on the Guix distribution, inside a build container.

Are you able to run the test suite on a machine running Guix natively, without the container abstraction? Comparing the result in that environment would help to narrow down the cause.

How can I debug it further?

As a brute force measure, you could get to a Python debugger command-line. Are you familiar with the Python debugger? https://docs.python.org/3/library/pdb.html Or the enhanced third-party debuggers, like IPdb https://pypi.org/project/ipdb/ or whichever one you like.

The build system for this library allows specifying a subset of test cases to run. Instead of the full test suite:

make test

you can specify (a comma-separated list of) test cases or classes or modules to run:

make test UNITTEST_NAMES=test.test_daemon.DaemonContext_open_TestCase

If you alter the test case function test_detaches_process_context, and insert this line:

import pdb ; pdb.set.trace()

(replace pdb with ipdb if you want to use that) then when the Python interpreter hits that line, the set_trace() call will drop you to a debugger prompt.

From there you can use the full power of the debugger to inspect what might be going wrong. Thanks for taking the challenge!

Metadata Update from @bignose:
- Issue tagged with: more-info

Thanks for the report. I am closing this in the absence of the needed information to proceed.

Please feel free to open a new issue that addresses the questions above.

Metadata Update from @bignose:
- Issue close_status updated to: Insufficient data
- Issue status updated to: Closed (was: Open)

Metadata