From 9a2d4b66479695da0a26a7168d6ddcfd6838151f Mon Sep 17 00:00:00 2001 From: teor Date: Sat, 4 Oct 2014 13:18:56 +1000 Subject: [PATCH 1/2] Stop an apparent test-network hang when used with make -j2 If (GNU) Make 3.81 is running processes in parallel using -j2 (or more), it waits until all descendent processes have exited before it returns to the shell. When a command like "make -j2 test-network" is run, this means that test-network.sh apparently hangs until it either make is forcibly terminated, or all the chutney-launched tor processes have exited. A workaround is to use make without -j, or make -j1 if there is an existing alias to "make -jn" in the shell. We resolve this bug in tor by using "chutney stop" after "chutney verify" in test-network.sh. --- changes/bug13331-make-j2-test-network-hang | 3 +++ src/test/test-network.sh | 3 +++ 2 files changed, 6 insertions(+) create mode 100644 changes/bug13331-make-j2-test-network-hang diff --git a/changes/bug13331-make-j2-test-network-hang b/changes/bug13331-make-j2-test-network-hang new file mode 100644 index 0000000000..85c0ad8e37 --- /dev/null +++ b/changes/bug13331-make-j2-test-network-hang @@ -0,0 +1,3 @@ + o Minor bugfixes: + - Stop an apparent test-network hang when used with make -j2. + Fixes bug 13331. diff --git a/src/test/test-network.sh b/src/test/test-network.sh index 7b59864166..d7fdb3533b 100755 --- a/src/test/test-network.sh +++ b/src/test/test-network.sh @@ -45,3 +45,6 @@ n=$BOOTSTRAP_TIME; while [ $n -gt 0 ]; do sleep 1; n=$(expr $n - 1); echo -n . done; echo "" ./chutney verify $CHUTNEY_NETWORK +# work around a bug/feature in make -j2 (or more) +# where make hangs if any child processes are still alive +./chutney stop $CHUTNEY_NETWORK From c0794d22a2fc25c8764615428f08dc0efb4df2bd Mon Sep 17 00:00:00 2001 From: teor Date: Sun, 5 Oct 2014 09:59:27 +1100 Subject: [PATCH 2/2] Exit test-network with status of chutney verify Preserve previous semantics of src/test/test-network.sh by exiting with the exit status of chutney verify, even though the latest version ends with chutney stop. --- src/test/test-network.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/test/test-network.sh b/src/test/test-network.sh index d7fdb3533b..fb33842f32 100755 --- a/src/test/test-network.sh +++ b/src/test/test-network.sh @@ -45,6 +45,8 @@ n=$BOOTSTRAP_TIME; while [ $n -gt 0 ]; do sleep 1; n=$(expr $n - 1); echo -n . done; echo "" ./chutney verify $CHUTNEY_NETWORK +VERIFY_EXIT_STATUS=$? # work around a bug/feature in make -j2 (or more) # where make hangs if any child processes are still alive ./chutney stop $CHUTNEY_NETWORK +exit $VERIFY_EXIT_STATUS