[BUG] aiaiai-test-patchset removes obj dirs too early

Brian Norris computersforpeace at gmail.com
Wed Aug 5 08:52:25 PDT 2015


On Tue, Aug 04, 2015 at 04:49:42PM -0700, Brian Norris wrote:
> On Tue, Aug 04, 2015 at 11:25:24PM +0000, Keller, Jacob E wrote:
> > I'll go ahead and queue this patch up.
> 
> Actually, hold off there. There are some problems I didn't notice, that
> get exposed with multi-config runs. I'll work it out and send an addon
> patch shortly, I expect.
> 
> With this patch, I've seen this sample error:
> 
> [2015-08-04 16:29:07] aiaiai-test-patchset: Fatal error: aiaiai-test-bisectability failed

Yep, I was a bit hasty. I completely ignored some code from the
beginning of test_configuration()! With this patch appended, I've got
all my variations of single- and multi-config tests working.

Brian

Subject: [PATCH] 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 <computersforpeace at gmail.com>
---
 aiaiai-test-patchset | 25 +++++++++----------------
 1 file changed, 9 insertions(+), 16 deletions(-)

diff --git a/aiaiai-test-patchset b/aiaiai-test-patchset
index 92ca3dfe8a40..6193dfcae0f1 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"
-- 
2.5.0.rc2.392.g76e840b




More information about the aiaiai mailing list