utah-client run_cmd looses output
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
UTAH |
Fix Released
|
High
|
Andy Doan |
Bug Description
we have an odd timing/race issue with the run_cmd implementation. I've added a simple test to test_common.py that repeats it pretty frequently:
def test_run_
"""Ensure run_cmd returns proper output."""
result = run_cmd('echo 1')
Most of the timeout result['stdout'] is an empty string. If you add a small pause and then an extra check for stdout like:
@@ -219,6 +219,14 @@ def run_cmd(command, cwd=None, timeout=0, cmd_type=CMD_TC_T
except Empty:
+ try:
+ print "one more read"
+ stdout_tmp = _normalize_
+ syslog.
+ stdout.
+ except Empty:
+ print 'no data'
+ pass
Things magically work. We've been debating re-implementing this in a proper way. i think now is the time, and I'll do it today
Related branches
- Andy Doan (community): Needs Resubmitting
-
Diff: 569 lines (+282/-144)6 files modifiedtests/test_process.py (+53/-1)
utah/client/battery.py (+17/-1)
utah/client/common.py (+36/-139)
utah/client/tests/test_battery.py (+12/-0)
utah/client/tests/test_common.py (+47/-3)
utah/process.py (+117/-0)
Changed in utah: | |
assignee: | nobody → Andy Doan (doanac) |
importance: | Undecided → High |
Changed in utah: | |
milestone: | none → 0.13 |
status: | New → In Progress |
Changed in utah: | |
status: | In Progress → Fix Released |