classification
Title: test.test_posix.TestPosixSpawn::test_specify_environment fails with custom LD_LIBRARY_PATH
Type: Stage: resolved
Components: Tests Versions: Python 3.8, Python 3.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: hroncok, miss-islington, serhiy.storchaka
Priority: normal Keywords: patch

Created on 2018-05-10 13:50 by hroncok, last changed 2018-05-11 06:07 by serhiy.storchaka. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 6753 merged hroncok, 2018-05-10 15:01
PR 6765 merged miss-islington, 2018-05-11 05:40
Messages (3)
msg316363 - (view) Author: Miro Hrončok (hroncok) * Date: 2018-05-10 13:50
When we build Python in Fedora, we set LD_LIBRARY_PATH environment variable so the testsuite is run against the currently built Python.

However a test added in ef347535f289baad22c0601e12a36b2dcd155c3a (test_specify_environment) spawns a process without passing the environment variables. This means that the new process fails with 

    error while loading shared libraries: libpython3.7m.so.1.0: cannot open shared object file: No such file or directory

And the test fails with:

test_specify_environment (test.test_posix.TestPosixSpawn) ... /builddir/build/BUILD/Python-3.7.0b4/build/optimized/python: error while loading shared libraries: libpython3.7m.so.1.0: cannot open shared object file: No such file or directory
test test_posix failed
FAIL
======================================================================
FAIL: test_specify_environment (test.test_posix.TestPosixSpawn)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/builddir/build/BUILD/Python-3.7.0b4/Lib/test/test_posix.py", line 1467, in test_specify_environment
    self.assertEqual(os.waitpid(pid, 0), (pid, 0))
AssertionError: Tuples differ: (11457, 32512) != (11457, 0)
First differing element 1:
32512
0
- (11457, 32512)
?         ^^^^^
+ (11457, 0)
?         ^
----------------------------------------------------------------------
Ran 101 tests in 0.608s
FAILED (failures=1, skipped=9)
1 test failed again:
    test_posix
Total duration: 23 min 22 sec
Tests result: FAILURE

I believe that a fix for this is to copy os.environ, update it with {'foo': 'bar'} and pass that copy. I'll check and send PR if it works.
msg316388 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2018-05-11 05:40
New changeset 7ec8f28656ea9d84048e9b5655375c6a74a59f53 by Serhiy Storchaka (Miro Hrončok) in branch 'master':
bpo-33455: Pass os.environ in test_posix::test_specify_environment. (GH-6753)
https://github.com/python/cpython/commit/7ec8f28656ea9d84048e9b5655375c6a74a59f53
msg316389 - (view) Author: miss-islington (miss-islington) Date: 2018-05-11 06:01
New changeset 6e9456e4f6123b13750a10e6ae2eba83504d2f1a by Miss Islington (bot) in branch '3.7':
bpo-33455: Pass os.environ in test_posix::test_specify_environment. (GH-6753)
https://github.com/python/cpython/commit/6e9456e4f6123b13750a10e6ae2eba83504d2f1a
History
Date User Action Args
2018-05-11 06:07:22serhiy.storchakasetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2018-05-11 06:01:46miss-islingtonsetnosy: + miss-islington
messages: + msg316389
2018-05-11 05:40:54miss-islingtonsetpull_requests: + pull_request6451
2018-05-11 05:40:53serhiy.storchakasetmessages: + msg316388
2018-05-10 15:01:32hroncoksetkeywords: + patch
stage: patch review
pull_requests: + pull_request6440
2018-05-10 13:50:36hroncokcreate