Bug 141000

Summary: Make run-jsc-stress-tests --remote work on Linux too
Product: WebKit Reporter: Csaba Osztrogonác <ossy>
Component: Tools / TestsAssignee: Csaba Osztrogonác <ossy>
Status: RESOLVED FIXED    
Severity: Normal CC: commit-queue, darin, ddkilzer, fpizlo, oliver, ossy
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 141165    
Attachments:
Description Flags
Patch none

Description Csaba Osztrogonác 2015-01-28 09:54:20 PST
Now the --remote option of run-jsc-stress-tests works only 
on Mac, it would be great to be able use it on Linux too.
Comment 1 Csaba Osztrogonác 2015-01-28 10:01:05 PST
Created attachment 245549 [details]
Patch

I have no idea if it will work on iOS, so it would be good if an iOS expert can review it.
Comment 2 Csaba Osztrogonác 2015-01-28 10:07:45 PST
Some additional info why we need this changes:

- The runner script is run with "sh runner" command and sh is dash on
Debian/Ubuntu distros, so we have to remove the function bashisms.

- find doesn't have "-depth N" option on Linux, but "-maxdepth N"
is available on Linux and Mac too and do the same in this case.

- find warns if we put an option after a non-option argument, so
we should put is before the -name.
("find: warning: you have specified the -maxdepth option after a non-option argument -name, but options are not positional (-maxdepth affects tests specified before it as well as those specified after it).  Please specify options before other arguments.")

- trap of dash doesn't know SIGINT SIGHUP SIGTERM signals, but bash and dash
know INT HUP TERM signals, so let's replace them.
Comment 3 Darin Adler 2015-01-28 16:32:59 PST
Comment on attachment 245549 [details]
Patch

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

> Tools/Scripts/jsc-stress-test-helpers/shell-runner.sh:24
> +numProcs=`sysctl -n hw.activecpu 2>/dev/null`

A lot of times this pattern is dangerous; if there is some failure it is silently sent to the bit bucket. Do we really need to do this?
Comment 4 Csaba Osztrogonác 2015-01-29 04:48:46 PST
Comment on attachment 245549 [details]
Patch

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

>> Tools/Scripts/jsc-stress-test-helpers/shell-runner.sh:24
>> +numProcs=`sysctl -n hw.activecpu 2>/dev/null`
> 
> A lot of times this pattern is dangerous; if there is some failure it is silently sent to the bit bucket. Do we really need to do this?

It always dumps error on Linux:
"sysctl: cannot stat /proc/sys/hw/activecpu: No such file or directory"

We don't need useless error/warning messages always on Linux, 
and we already use the same pattern for nproc in line27 and in
jsc-stress-tests too. I think it's safe, because we handle
the return code/value properly everywhere.
Comment 5 WebKit Commit Bot 2015-01-29 05:33:50 PST
Comment on attachment 245549 [details]
Patch

Clearing flags on attachment: 245549

Committed r179343: <http://trac.webkit.org/changeset/179343>
Comment 6 WebKit Commit Bot 2015-01-29 05:33:54 PST
All reviewed patches have been landed.  Closing bug.