Bug 63624 - [webkitpy] Executive.running_pids() sometimes doesn't correctly process "ps" output
Summary: [webkitpy] Executive.running_pids() sometimes doesn't correctly process "ps" ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords:
: 63619 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-06-29 06:58 PDT by Philippe Normand
Modified: 2011-06-29 08:32 PDT (History)
2 users (show)

See Also:


Attachments
proposed patch (1.82 KB, patch)
2011-06-29 07:03 PDT, Philippe Normand
mrobinson: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Philippe Normand 2011-06-29 06:58:59 PDT
$ ps -eo pid,comm
  PID COMMAND
    1 init
 1985 dbus-daemon
 2128 dbus-daemon
 2733 rsyslogd
19049 dbus-daemon
19128 dbus-daemon

^ See the leading white space? For those lines the pid won't be added to the list because:


>>> " 1985 dbus-daemon".split(' ', 1)
['', '1985 dbus-daemon']

So line 308 of executive.py will raise a ValueError because pid="".

I'll work on a patch for this issue.
Comment 1 Philippe Normand 2011-06-29 07:03:33 PDT
Created attachment 99085 [details]
proposed patch
Comment 2 Philippe Normand 2011-06-29 07:04:15 PDT
BTW this issue showed up in GTK bots but I think it's not specific to them.
Comment 3 Philippe Normand 2011-06-29 07:05:46 PDT
The test-webkipy failure:

======================================================================
FAIL: test_running_pids (webkitpy.common.system.executive_unittest.ExecutiveTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/var/lib/buildbot/build/gtk-linux-32-release/build/Tools/Scripts/webkitpy/common/system/executive_unittest.py", line 209, in test_running_pids
    self.assertTrue(os.getpid() in pids)
AssertionError

----------------------------------------------------------------------
Comment 4 Martin Robinson 2011-06-29 07:10:57 PDT
Comment on attachment 99085 [details]
proposed patch

View in context: https://bugs.webkit.org/attachment.cgi?id=99085&action=review

> Tools/Scripts/webkitpy/common/system/executive.py:306
> +                # in some cases the line can contain one or more

in -> In
Comment 5 Philippe Normand 2011-06-29 07:19:17 PDT
Committed r90016: <http://trac.webkit.org/changeset/90016>
Comment 6 Adam Barth 2011-06-29 08:32:06 PDT
Comment on attachment 99085 [details]
proposed patch

Thanks!  You guys are awesome.
Comment 7 Adam Barth 2011-06-29 08:32:32 PDT
*** Bug 63619 has been marked as a duplicate of this bug. ***