Opened 6 years ago

Last modified 4 years ago

#3198 new defect

Process environment is not always correctly passed to the children processes

Reported by: sa2ajj Owned by:
Priority: patches-accepted Milestone: 0.9.+
Version: 0.8.10 Keywords:
Cc:

Description

Problem: while trying to run buildbot-0.8.10 tests under CentOS 6.6 with python27 Software Collection enabled , getting this errors:

[FAIL]
Traceback (most recent call last):
File "/builddir/build/BUILD/buildbot-0.8.10/buildbot/test/util/steps.py", line 246, in check
"expected step outcome")
File "/opt/rh/python27/root/usr/lib64/python2.7/site-packages/twisted/trial/_synctest.py", line 356, in assertEqual
% (msg, pformat(first), pformat(second)))
twisted.trial.unittest.FailTest: expected step outcome
not equal:
a = {'result': 2, 'status_text': ['failed (127)']}
b = {'result': 0, 'status_text': ['Ran']}
buildbot.test.unit.test_steps_master.TestMasterShellCommand.test_env_list_subst
buildbot.test.unit.test_steps_master.TestMasterShellCommand.test_env_subst
buildbot.test.unit.test_steps_master.TestMasterShellCommand.test_prop_rendering 

Attachments (2)

trial_output.log (255.2 KB) - added by mmonkk 6 years ago.
scl enable python27 'trial buildbot.test' &> trial_output.log
trial_output.log.gz (24.4 KB) - added by mmonkk 6 years ago.
scl enable python27 'trial --reporter=bwverbose buildbot.test' &> trial_output.log

Download all attachments as: .zip

Change History (6)

comment:1 Changed 6 years ago by sa2ajj

The problem is that sys.executable turns to be empty.

While trying to "fix" the problem (GH:1539), I found that there're many more tests that use sys.executable and they did not fail.

Changed 6 years ago by mmonkk

scl enable python27 'trial buildbot.test' &> trial_output.log

Changed 6 years ago by mmonkk

scl enable python27 'trial --reporter=bwverbose buildbot.test' &> trial_output.log

comment:2 Changed 6 years ago by sa2ajj

  • Milestone changed from 0.8.x to 0.9.+
  • Priority changed from major to patches-accepted

After the investigation, the problem turned out to be the result of how reactor.spawnProcess handles the env parameter.

The way how SCL "enables" the python is by updating PATH and LD_LIBRARY_PATH environment variables, which are not passed to the child processes that actually require them to be present (more specifically, LD_LIBRARY_PATH is required to find proper dynamic libraries).

The proper fix for this problem seems to be:

  • to create a Buildbot function to spawn processes with very well documented semantics of environment handling
  • make sure that this function is used through out the code
  • make sure that this function is used by test cases

Any other approach will not be a "proper" fix.

Since this would require a rather substantial changes (and these changes are not exactly the same for master and eight branches), I change the milestone to 0.9.0+ and priority to "patches-accepted" (and these are very welcome).

comment:3 Changed 6 years ago by sa2ajj

  • Summary changed from Tests fail while building Buildbot package for CentOS 6.6 to Process environment is not always correctly passed to the children processes

(sigh: forgot to update the summary)

Note: See TracTickets for help on using tickets.