Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 916248 - sys-apps/portage: test_soname_atom_pickle.py incompatible with multiprocessing spawn start method
Summary: sys-apps/portage: test_soname_atom_pickle.py incompatible with multiprocessin...
Status: RESOLVED FIXED
Alias: None
Product: Portage Development
Classification: Unclassified
Component: Core (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Portage team
URL:
Whiteboard:
Keywords: InVCS
Depends on: 916031
Blocks: 914876
  Show dependency tree
 
Reported: 2023-10-24 20:09 UTC by Zac Medico
Modified: 2023-10-25 05:49 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Zac Medico gentoo-dev 2023-10-24 20:09:26 UTC
When launching lib/portage/tests/dep/test_soname_atom_pickle.pyy via this script that runs pytest with the multiprocessing spawn start method, it fails and I'm not sure why:

> import multiprocessing
> import sys
> import pytest
> if __name__ == "__main__":
>     multiprocessing.set_start_method("spawn", force=True)
>     sys.exit(pytest.console_main())

> ============================= test session starts ==============================
> platform linux -- Python 3.12.0, pytest-7.4.2, pluggy-1.3.0
> rootdir: portage
> collected 1 item
> 
> lib/portage/tests/dep/test_soname_atom_pickle.py F
> 
> =================================== FAILURES ===================================
> _________________ TestSonameAtomPickle.test_soname_atom_pickle _________________
> 
> self = <portage.tests.dep.test_soname_atom_pickle.TestSonameAtomPickle testMethod=test_soname_atom_pickle>
> 
>     def test_soname_atom_pickle(self):
>         loop = asyncio._wrap_loop()
>         with ForkExecutor(loop=loop) as executor:
>             result = loop.run_until_complete(
>                 loop.run_in_executor(executor, self._get_all_provides)
>             )
> >       self.assertEqual(self._ALL_PROVIDES, result)
> E       AssertionError: Items in the first set but not the second:
> E       SonameAtom('x86_64', 'libc.so.6')
> E       Items in the second set but not the first:
> E       SonameAtom('x86_64', 'libc.so.6')
> 
> lib/portage/tests/dep/test_soname_atom_pickle.py:20: AssertionError
> =========================== short test summary info ============================
> FAILED lib/portage/tests/dep/test_soname_atom_pickle.py::TestSonameAtomPickle::test_soname_atom_pickle
> ============================== 1 failed in 0.51s ===============================
Comment 1 Zac Medico gentoo-dev 2023-10-24 22:20:30 UTC
For some reason, comparison of the two frozenset instances returns False without even calling the SonameAtom __eq__ method. If I compare the two SonameAtom instances themselves, __eq__ returns True.
Comment 2 Larry the Git Cow gentoo-dev 2023-10-24 22:58:00 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/proj/portage.git/commit/?id=334946eadc7efb457062c7aba9d3b51085e463c3

commit 334946eadc7efb457062c7aba9d3b51085e463c3
Author:     Zac Medico <zmedico@gentoo.org>
AuthorDate: 2023-10-24 22:33:20 +0000
Commit:     Zac Medico <zmedico@gentoo.org>
CommitDate: 2023-10-24 22:34:25 +0000

    SonameAtom: multiprocessing spawn compat
    
    Do not pickle the SonameAtom _hash_value attribute, since
    hash() results are not meaningfully picklable.
    
    Bug: https://bugs.gentoo.org/916248
    Signed-off-by: Zac Medico <zmedico@gentoo.org>

 lib/portage/dep/soname/SonameAtom.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
Comment 3 Larry the Git Cow gentoo-dev 2023-10-25 05:49:11 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2b9128b401def05cac46f9e6d66048e5a0d888b8

commit 2b9128b401def05cac46f9e6d66048e5a0d888b8
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2023-10-25 05:48:31 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2023-10-25 05:48:40 +0000

    sys-apps/portage: add 3.0.54
    
    Closes: https://bugs.gentoo.org/905869
    Closes: https://bugs.gentoo.org/915551
    Closes: https://bugs.gentoo.org/915896
    Closes: https://bugs.gentoo.org/916106
    Closes: https://bugs.gentoo.org/916108
    Closes: https://bugs.gentoo.org/916112
    Closes: https://bugs.gentoo.org/916116
    Closes: https://bugs.gentoo.org/916139
    Closes: https://bugs.gentoo.org/916141
    Closes: https://bugs.gentoo.org/916142
    Closes: https://bugs.gentoo.org/916149
    Closes: https://bugs.gentoo.org/916182
    Closes: https://bugs.gentoo.org/916231
    Closes: https://bugs.gentoo.org/916235
    Closes: https://bugs.gentoo.org/916240
    Closes: https://bugs.gentoo.org/916242
    Closes: https://bugs.gentoo.org/916245
    Closes: https://bugs.gentoo.org/916248
    Closes: https://bugs.gentoo.org/899898
    Closes: https://bugs.gentoo.org/906129
    Closes: https://bugs.gentoo.org/906156
    Closes: https://bugs.gentoo.org/916031
    Signed-off-by: Sam James <sam@gentoo.org>

 sys-apps/portage/Manifest              |   1 +
 sys-apps/portage/portage-3.0.54.ebuild | 238 +++++++++++++++++++++++++++++++++
 2 files changed, 239 insertions(+)