Skip to content

Commit

Permalink
Improve GetChildren method in server tests
Browse files Browse the repository at this point in the history
Use children method of Process class instead of iterating on all
processes.
  • Loading branch information
micbou committed Dec 22, 2015
1 parent 8da1054 commit a4aaf80
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions ycmd/tests/server_test.py
Expand Up @@ -178,11 +178,7 @@ def _DefaultSettings( self ):


def _GetChildren( self ):
children = []
for proc in psutil.process_iter():
if proc.ppid() == self._popen_handle.pid:
children.append( proc )
return children
return psutil.Process( self._popen_handle.pid ).children()


def _WaitUntilReady( self, timeout = 5 ):
Expand Down

0 comments on commit a4aaf80

Please sign in to comment.