#96 Flaky test due to re-used object and/or incomplete initialization
Closed: Fixed by bignose. Opened by jtate.

When I was running tests, I was getting arbitrary failures in class DaemonContext_open_TestCase, def test_detaches_process_context. I tracked it down, and it seems that in certain conditions, instance.detach_process is actually False, so the test fails.

If you apply this path, the flakiness goes away:

diff --git a/test/test_daemon.py b/test/test_daemon.py
index c43b631..fff1834 100644
--- a/test/test_daemon.py
+++ b/test/test_daemon.py
@@ -518,6 +518,7 @@ class DaemonContext_open_TestCase(DaemonContext_BaseTestCase):
     def test_detaches_process_context(self):
         """ Should request detach of process context. """
         instance = self.test_instance
+        instance.detach_process = True
         instance.open()
         self.mock_module_daemon.detach_process_context.assert_called_with()

Thank you for this bug report.

The issue is now corrected and merged to 'main' branch as of commit 3309eb18.

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

Metadata