Bug 124550 - run-jsc-stress-tests only supports host environments that have make installed
Summary: run-jsc-stress-tests only supports host environments that have make installed
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Mark Hahnenberg
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-18 17:13 PST by Mark Hahnenberg
Modified: 2013-12-03 10:48 PST (History)
1 user (show)

See Also:


Attachments
Patch (10.13 KB, patch)
2013-12-02 18:33 PST, Mark Hahnenberg
darin: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Hahnenberg 2013-11-18 17:13:17 PST
This might not be the case for all hosts, so we should write an alternate "backend" for run-jsc-stress-tests to use normal shell commands rather than Makefiles. This will probably sacrifice the ability to run tests in parallel, at least in the first version.
Comment 1 Mark Hahnenberg 2013-11-18 17:15:27 PST
This new backend could be enabled by passing --shell-runner to run-jsc-stress-tests. There would also be a (default) flag for --make-runner.
Comment 2 Mark Hahnenberg 2013-12-02 18:33:53 PST
Created attachment 218254 [details]
Patch
Comment 3 Filip Pizlo 2013-12-03 10:21:06 PST
Comment on attachment 218254 [details]
Patch

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

r=me too

> Tools/Scripts/jsc-stress-test-helpers/shell-runner.sh:53
> +NUM_PROCS=`sysctl -n hw.activecpu`
> +if [ $? -gt 0 ]
> +then
> +    NUM_PROCS=`nproc --all 2>/dev/null`
> +    if [ $? -gt 0 ]
> +    then
> +        NUM_PROCS=1
> +    fi
> +fi
> +
> +INDEX_FILE=".index"
> +TEST_LIST=".all_tests.txt"
> +TEMP_FILE=".temp.txt"
> +LOCK_DIR=".lock_dir"
> +
> +trap "kill -9 0" SIGINT
> +
> +echo 0 > ${INDEX_FILE}
> +ls test_script_* > ${TEST_LIST}
> +
> +function lock_test_list() {
> +    until mkdir ${LOCK_DIR} 2> /dev/null; do sleep 0; done
> +}
> +
> +function unlock_test_list() {
> +    rmdir ${LOCK_DIR}
> +}
> +
> +TOTAL=`wc -l < "${TEST_LIST}" | sed 's/ //g'`
> +for PROC in `seq ${NUM_PROCS}`
> +do
> +    (
> +        lock_test_list
> +        while [ -s ${TEST_LIST} ]
> +        do
> +            INDEX=`cat ${INDEX_FILE}`
> +            INDEX=$((INDEX + 1))
> +            echo "${INDEX}" > ${INDEX_FILE}
> +            printf "\r    ${INDEX}/${TOTAL}"
> +
> +            TEST=`tail -n 1 ${TEST_LIST}`
> +            sed '$d' < ${TEST_LIST} > ${TEMP_FILE}
> +            mv ${TEMP_FILE} ${TEST_LIST}
> +            unlock_test_list
> +
> +            sh ${TEST} > /dev/null
> +
> +            lock_test_list
> +        done
> +        unlock_test_list
> +    )&
> +done
> +wait

Copyright thingy?
Comment 4 Mark Hahnenberg 2013-12-03 10:48:28 PST
Committed r160016: <http://trac.webkit.org/changeset/160016>