Bug 241081

Summary: [webkitpy] run-benchmark script fails to find the lsof command on Linux
Product: WebKit Reporter: Carlos Alberto Lopez Perez <clopez>
Component: Tools / TestsAssignee: Carlos Alberto Lopez Perez <clopez>
Status: RESOLVED FIXED    
Severity: Normal CC: dewei_zhu, ews-watchlist, glenn, jbedard, lmoura, saam, slewis, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch for landing none

Description Carlos Alberto Lopez Perez 2022-05-29 14:28:39 PDT
The lsof command is shipped on Linux typically on /usr/bin meanwhile on Mac is shipped on /usr/sbin

The GTK perf bot is having issues with this and is causing the tests to fail.
Comment 1 Carlos Alberto Lopez Perez 2022-05-29 14:49:57 PDT
Created attachment 459842 [details]
Patch
Comment 2 Lauro Moura 2022-05-30 12:24:13 PDT
Comment on attachment 459842 [details]
Patch

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

Looks good. Minor suggestion inline.

> Tools/Scripts/webkitpy/benchmark_runner/http_server_driver/simple_http_server_driver.py:71
> +                lsof_path = shutil.which('lsof') if shutil.which('lsof') else '/usr/sbin/lsof'

Maybe `lsov_path = shutil.which('lsof') or '/usr/sbin/lsof'` to avoid the extra which call?
Comment 3 Lauro Moura 2022-05-30 12:24:56 PDT
(In reply to Lauro Moura from comment #2)
> Comment on attachment 459842 [details]
>
> Maybe `lsov_path = shutil.which('lsof') or '/usr/sbin/lsof'` to avoid the
> extra which call?

Obviously, I meant `lsof_path = ...`.
Comment 4 dewei_zhu 2022-05-30 16:15:02 PDT
Comment on attachment 459842 [details]
Patch

r=me
Comment 5 Radar WebKit Bug Importer 2022-06-05 14:29:12 PDT
<rdar://problem/94408913>
Comment 6 Carlos Alberto Lopez Perez 2022-06-14 02:12:26 PDT
(In reply to Lauro Moura from comment #2)
> Maybe `lsov_path = shutil.which('lsof') or '/usr/sbin/lsof'` to avoid the
> extra which call?

Good idea, seems cleaner.

I will land with this
Comment 7 Carlos Alberto Lopez Perez 2022-06-14 02:15:49 PDT
Created attachment 460226 [details]
Patch for landing
Comment 8 EWS 2022-06-14 03:12:36 PDT
Committed r295520 (251525@main): <https://commits.webkit.org/251525@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 460226 [details].