[Bug 2143758] Re: apport 2.33.1-0ubuntu4 FTBFS - PicklingIssue in Tests

Thomas Ward 2143758 at bugs.launchpad.net
Mon Mar 9 21:08:56 UTC 2026


For expediency, I'm running build and autopkgtest runs from @aleasto and
@cnihelton.

The patch provided by cnihelton via Matrix didn't work, results in a
hard-fail on a NameError - "NameError: name 'runner' is not defined"

Testing aleasto's solution we get assertion errors:

=============================== warnings summary ===============================
tests/integration/test_ui_gtk.py::test_unusable_display
  /usr/lib/python3/dist-packages/gi/overrides/__init__.py:159: PyGIDeprecationWarning: GLib.unix_signal_add_full is deprecated; use GLibUnix.signal_add_full instead
    value = getattr(proxy, attr)

tests/integration/test_unkillable_shutdown.py::TestUnkillableShutdown::test_omit_all_processes_except_one
tests/integration/test_unkillable_shutdown.py::TestUnkillableShutdown::test_write_reports
  /usr/lib/python3.13/multiprocessing/popen_fork.py:67: DeprecationWarning: This process (pid=4244) is multi-threaded, use of fork() may lead to deadlocks in the child.
    self.pid = os.fork()

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html

------
------

This'll need either a more complete patch from cnihelton or a workaround
to capture the warnings of using `fork` in the tests.

Alternatively, we can update existing excuses to handwave these known
broken tests once through the proposed process to let this land.  That
could have its own headaches though.

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to apport in Ubuntu.
https://bugs.launchpad.net/bugs/2143758

Title:
  apport 2.33.1-0ubuntu4 FTBFS - PicklingIssue in Tests

Status in apport package in Ubuntu:
  Triaged

Bug description:
  During the global rebuild of Apport (2.33.1-0ubuntu4) for
  https://launchpad.net/bugs/2132257, it FTBFS with the following
  errors:

  =================================== FAILURES ===================================
  __________ TestUnkillableShutdown.test_omit_all_processes_except_one ___________

  self =
  <tests.integration.test_unkillable_shutdown.TestUnkillableShutdown
  testMethod=test_omit_all_processes_except_one>

      def test_omit_all_processes_except_one(self) -> None:
          """unkillable_shutdown will write exactly one report."""
          existing_pids = self._get_all_pids()
  >       with self._launch_process_with_different_session_id() as runner:
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  tests/integration/test_unkillable_shutdown.py:98: 
  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
  /usr/lib/python3.14/contextlib.py:141: in __enter__
      return next(self.gen)
             ^^^^^^^^^^^^^^
  tests/integration/test_unkillable_shutdown.py:79: in _launch_process_with_different_session_id
      runner.start()
  /usr/lib/python3.14/multiprocessing/process.py:121: in start
      self._popen = self._Popen(self)
                    ^^^^^^^^^^^^^^^^^
  /usr/lib/python3.14/multiprocessing/context.py:224: in _Popen
      return _default_context.get_context().Process._Popen(process_obj)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  /usr/lib/python3.14/multiprocessing/context.py:300: in _Popen
      return Popen(process_obj)
             ^^^^^^^^^^^^^^^^^^
  /usr/lib/python3.14/multiprocessing/popen_forkserver.py:35: in __init__
      super().__init__(process_obj)
  /usr/lib/python3.14/multiprocessing/popen_fork.py:20: in __init__
      self._launch(process_obj)
  /usr/lib/python3.14/multiprocessing/popen_forkserver.py:47: in _launch
      reduction.dump(process_obj, buf)
  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

  obj = <Process name='Process-1' parent=16049 initial>
  file = <_io.BytesIO object at 0x762709abffb0>, protocol = None

      def dump(obj, file, protocol=None):
          '''Replacement for pickle.dump() using ForkingPickler.'''
  >       ForkingPickler(file, protocol).dump(obj)
  E       _pickle.PicklingError: Can't pickle local object <function TestUnkillableShutdown._launch_process_with_different_session_id.<locals>._run_test_executable at 0x76270951ce00>
  E       when serializing dict item '_target'
  E       when serializing multiprocessing.context.Process state
  E       when serializing multiprocessing.context.Process object

  /usr/lib/python3.14/multiprocessing/reduction.py:60: PicklingError
  __________________ TestUnkillableShutdown.test_write_reports ___________________

  self =
  <tests.integration.test_unkillable_shutdown.TestUnkillableShutdown
  testMethod=test_write_reports>

      def test_write_reports(self) -> None:
          """unkillable_shutdown will write reports."""
          # Ensure that at least one process is honoured by unkillable_shutdown.
  >       with self._launch_process_with_different_session_id():
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  tests/integration/test_unkillable_shutdown.py:108: 
  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
  /usr/lib/python3.14/contextlib.py:141: in __enter__
      return next(self.gen)
             ^^^^^^^^^^^^^^
  tests/integration/test_unkillable_shutdown.py:79: in _launch_process_with_different_session_id
      runner.start()
  /usr/lib/python3.14/multiprocessing/process.py:121: in start
      self._popen = self._Popen(self)
                    ^^^^^^^^^^^^^^^^^
  /usr/lib/python3.14/multiprocessing/context.py:224: in _Popen
      return _default_context.get_context().Process._Popen(process_obj)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  /usr/lib/python3.14/multiprocessing/context.py:300: in _Popen
      return Popen(process_obj)
             ^^^^^^^^^^^^^^^^^^
  /usr/lib/python3.14/multiprocessing/popen_forkserver.py:35: in __init__
      super().__init__(process_obj)
  /usr/lib/python3.14/multiprocessing/popen_fork.py:20: in __init__
      self._launch(process_obj)
  /usr/lib/python3.14/multiprocessing/popen_forkserver.py:47: in _launch
      reduction.dump(process_obj, buf)
  _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

  obj = <Process name='Process-2' parent=16049 initial>
  file = <_io.BytesIO object at 0x76270a723100>, protocol = None

      def dump(obj, file, protocol=None):
          '''Replacement for pickle.dump() using ForkingPickler.'''
  >       ForkingPickler(file, protocol).dump(obj)
  E       _pickle.PicklingError: Can't pickle local object <function TestUnkillableShutdown._launch_process_with_different_session_id.<locals>._run_test_executable at 0x762709aae1f0>
  E       when serializing dict item '_target'
  E       when serializing multiprocessing.context.Process state
  E       when serializing multiprocessing.context.Process object

  /usr/lib/python3.14/multiprocessing/reduction.py:60: PicklingError

  ---

  The core problem is a Pickling Error on these two tests.  This results
  in an FTBFS case.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/apport/+bug/2143758/+subscriptions




More information about the foundations-bugs mailing list