[Webkit-unassigned] [Bug 145584] use multiprocessing in run-benchmark to launch web server

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jun 2 19:28:10 PDT 2015


Ryosuke Niwa <rniwa at webkit.org> changed:

           What    |Removed                     |Added
 Attachment #254129|review?                     |review+
              Flags|                            |

--- Comment #2 from Ryosuke Niwa <rniwa at webkit.org> ---
Comment on attachment 254129
  --> https://bugs.webkit.org/attachment.cgi?id=254129

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

> Tools/ChangeLog:4
> +

Missing bug URL.

> Tools/Scripts/webkitpy/benchmark_runner/http_server_driver/simple_http_server_driver.py:35
> +        except Exception as e:

Spell out exception or error.

> Tools/Scripts/webkitpy/benchmark_runner/http_server_driver/simple_http_server_driver.py:65
> +                        command = ['/usr/sbin/lsof', '-a', '-iTCP', '-sTCP:LISTEN', '-p', str(self.server_process.pid)]
> +                        output = subprocess.check_output(command)

Perhaps we don't really need a local variable `command` here?

> Tools/Scripts/webkitpy/benchmark_runner/http_server_driver/simple_http_server_driver.py:66
> +                        self.server_port = int(re.findall('TCP \*:(\d+) \(LISTEN\)', output)[0])

Why don't we just use re.search if we're grabbing the first result?

> Tools/Scripts/webkitpy/benchmark_runner/http_server_driver/simple_http_server_driver.py:71
> +                    except Exception as e:
> +                         _log.info('Error: %s' % e)

nit: spell out e.

> Tools/Scripts/webkitpy/benchmark_runner/http_server_driver/simple_http_server_driver.py:76
> +            except Exception as e:
> +                sys.exit("Cannot listen to server, max tries exceeded: %s" % e)

Ditto. Also, why don't we use _log.error and sys.exit separately as done elsewhere for consistency?

> Tools/Scripts/webkitpy/benchmark_runner/http_server_driver/simple_http_server_driver.py:87
> +        except Exception as e:
> +            _log.info('Server not running, max tries exceeded: %s' % e)

This code never runs unless _log.info or time.sleep blows up.
I think what you wanna do is to return immediately after subprocess.check_call.
And just error and sys.exit when we got out of the for loop without hitting that return.

> Tools/Scripts/webkitpy/benchmark_runner/http_server_driver/simple_http_server_driver.py:121
> +    def postResult(self, result):

Can we rename this to post_result for consistency if we're using PEP style?

You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.webkit.org/pipermail/webkit-unassigned/attachments/20150603/0f566d4b/attachment.html>

More information about the webkit-unassigned mailing list