Bug 63624

Summary: [webkitpy] Executive.running_pids() sometimes doesn't correctly process "ps" output
Product: WebKit Reporter: Philippe Normand <pnormand>
Component: Tools / TestsAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: abarth, ossy
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
proposed patch mrobinson: review+

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. ***