Commit b938af8b authored by Kirill Smelkov's avatar Kirill Smelkov

golang: tests: Fix IPython integration test wrt TSAN/ASAN

test_defer_excchain_dump_ipython was setting fresh env anew, thus not
propagating $LD_PRELOAD that trun sets when libgolang was built with
thread or address sanitizer. This way the subprocess spawned for IPython
was failing with e.g.

        ==152924==ASan runtime does not come first in initial library list; you should either link runtime to your application or manually preload it with LD_PRELOAD.

-> Fix it by only adjusting environment for spawned IPython instead of
setting it completely anew.

Fixes: 09629367 (golang: tests: Add tests for IPython and Pytest
integration patches)
parent 6e31304d
...@@ -1659,7 +1659,7 @@ def test_defer_excchain_dump_ipython(): ...@@ -1659,7 +1659,7 @@ def test_defer_excchain_dump_ipython():
tbok = readfile(dir_testprog + "/golang_test_defer_excchain.txt-ipython") tbok = readfile(dir_testprog + "/golang_test_defer_excchain.txt-ipython")
retcode, stdout, stderr = _pyrun(["-m", "IPython", "--quick", "--colors=NoColor", retcode, stdout, stderr = _pyrun(["-m", "IPython", "--quick", "--colors=NoColor",
"-m", "golang_test_defer_excchain"], "-m", "golang_test_defer_excchain"],
env={"COLUMNS": "80"}, # force ipython5 avoid thinking termwidth=0 envadj={"COLUMNS": "80"}, # force ipython5 avoid thinking termwidth=0
cwd=dir_testprog, stdout=PIPE, stderr=PIPE) cwd=dir_testprog, stdout=PIPE, stderr=PIPE)
assert retcode == 0, (stdout, stderr) assert retcode == 0, (stdout, stderr)
# ipython5 uses .pyc for filenames instead of .py # ipython5 uses .pyc for filenames instead of .py
...@@ -1813,6 +1813,8 @@ def _pyrun(argv, stdin=None, stdout=None, stderr=None, **kw): # -> retcode, st ...@@ -1813,6 +1813,8 @@ def _pyrun(argv, stdin=None, stdout=None, stderr=None, **kw): # -> retcode, st
kw = kw.copy() kw = kw.copy()
pathv = [dir_pygolang] pathv = [dir_pygolang]
env = kw.pop('env', os.environ.copy()) env = kw.pop('env', os.environ.copy())
envadj = kw.pop('envadj', {})
env.update(envadj)
envpath = env.get('PYTHONPATH') envpath = env.get('PYTHONPATH')
if envpath is not None: if envpath is not None:
pathv.append(envpath) pathv.append(envpath)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment