Bug 241081 - [webkitpy] run-benchmark script fails to find the lsof command on Linux
Summary: [webkitpy] run-benchmark script fails to find the lsof command on Linux
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Carlos Alberto Lopez Perez
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-05-29 14:28 PDT by Carlos Alberto Lopez Perez
Modified: 2022-06-14 03:12 PDT (History)
8 users (show)

See Also:


Attachments
Patch (2.08 KB, patch)
2022-05-29 14:49 PDT, Carlos Alberto Lopez Perez
no flags Details | Formatted Diff | Diff
Patch for landing (2.04 KB, patch)
2022-06-14 02:15 PDT, Carlos Alberto Lopez Perez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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].