From: Brian Norris Date: Wed, 5 Aug 2015 15:52:25 +0000 (-0700) Subject: aiaiai-test-patchset: remove leftover 'wait for bisect test' code X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=81bcdb7bdaec2b6b43d15eaf0509445c96aef17c;p=users%2Fdedekind%2Faiaiai.git aiaiai-test-patchset: remove leftover 'wait for bisect test' code I didn't notice this code in my first (quick) pass at fixing a race condition here. Apparently we *were* trying to wait for the bisection test to complete, but we just weren't doing it at the right time. Anyway, with the current code, multi-config test runs will fail, since the second config will have a valid $pid_bisect from the previous config, meaning we will try to 'wait' again for the same expired process. The shell doesn't like that, so we fail. Let's move the bisect process's PID into a function-local context, and ensure that each config is completely finished before moving to the next one. So there will be a single, obvious place to wait for the process completion. Signed-off-by: Brian Norris Signed-off-by: Jacob Keller --- diff --git a/aiaiai-test-patchset b/aiaiai-test-patchset index b16d7a6..6193dfc 100755 --- a/aiaiai-test-patchset +++ b/aiaiai-test-patchset @@ -163,7 +163,6 @@ test_checkpatch() } -pid_bisect= test_configuration() { local config="$1" @@ -171,21 +170,10 @@ test_configuration() local arch="$(leave_second "$1")"; local cross="$(leave_third "$1")"; local arch_opt= + local pid_bisect= [ -z "$arch" ] || arch_opt="-a $arch${cross:+",$cross"}" - if [ -n "$bisectability" ]; then - # We share the same source tree with 'aiaiai-test-bisectability', so - # wait for it (it could be run at the previous iteration) - if [ -n "$pid_bisect" ]; then - wait "$pid_bisect" || die "aiaiai-test-bisectability failed" - pid_bisect= - fi - - # Clean-up the git tree after the test - rm $verbose -rf "$cloned_kernel1/.git/rebase-apply" >&2 - fi - git --git-dir="$(git_dir "$cloned_kernel1")" reset $quiet --hard "$commit_id1" >&2 # Enable use of a random condiguration that is stable between the @@ -248,9 +236,14 @@ test_configuration() aiaiai-diff-log $verbose $preserve "$tmpdir/diff-for-diff-log" "$log1.stderr.log" \ -w "$tmpdir" "$log2.stderr.log" > "$tmpdir/$config.stderr.diff" - # MUST sync with bisect test before removing build artifacts - [ -z "$pid_bisect" ] || wait "$pid_bisect" || die "aiaiai-test-bisectability failed" - verbose "Done with bisectability test" + if [ -n "$bisectability" ]; then + # MUST sync with bisect test before removing build artifacts + wait "$pid_bisect" || die "aiaiai-test-bisectability failed" + + # Clean-up the git tree after the test + rm $verbose -rf "$cloned_kernel1/.git/rebase-apply" >&2 + verbose "Done with bisectability test" + fi if [ -n "$preserve" ]; then message "Preserving objdirs: $obj1 $obj2"