[tor-commits] [chutney/master] test-network: Require the network to bootstrap

teor at torproject.org teor at torproject.org
Fri Mar 13 01:11:26 UTC 2020


commit bf3197b0434ec28c319794fae31fdb5be6491107
Author: teor <teor at torproject.org>
Date:   Wed Feb 19 16:17:19 2020 +1000

    test-network: Require the network to bootstrap
    
    Before launching "chutney verify", test-network checks that all the
    nodes have bootstrapped.
    
    Part of 33232.
---
 README                     |  3 +--
 tools/test-network-impl.sh | 14 ++++++++++----
 2 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/README b/README
index 2e850ff..0d14d64 100644
--- a/README
+++ b/README
@@ -187,8 +187,7 @@ Bootstrapping the network:
   whether the logged bootstrapped status for every node is 100% (step 9). If
   all the nodes have bootstrapped, wait_for_bootstrap succeeds. If some nodes
   have not bootstrapped, wait_for_bootstrap dumps the bootstrap statuses, and
-  exits with a failure. But test-network.sh does not exit immediately if a tor
-  node fails to bootstrap. Instead, it attempts to verify.
+  exits with a failure.
 
 Verifying the network:
 
diff --git a/tools/test-network-impl.sh b/tools/test-network-impl.sh
index a272f30..dc8d28c 100755
--- a/tools/test-network-impl.sh
+++ b/tools/test-network-impl.sh
@@ -29,10 +29,16 @@ CHUTNEY="$CHUTNEY_PATH/chutney"
 
 if [ "$CHUTNEY_START_TIME" -ge 0 ]; then
     $ECHO "Waiting $CHUTNEY_START_TIME seconds for a consensus containing relays to be generated..."
-    # We log bootstrap status for debugging purposes.
-    # We'll fix bootstrap errors in #20473.
-    "$CHUTNEY" wait_for_bootstrap "$CHUTNEY_NETWORK" \
-        || $ECHO "Tor bootstrap failed, ignoring for now."
+    # We require the network to bootstrap, before we verify
+    if ! "$CHUTNEY" wait_for_bootstrap "$CHUTNEY_NETWORK"; then
+        "$DIAGNOSTICS"
+        CHUTNEY_WARNINGS_IGNORE_EXPECTED=false \
+            CHUTNEY_WARNINGS_SUMMARY=false \
+            "$WARNING_COMMAND"
+        "$WARNINGS"
+        $ECHO "chutney boostrap failed (in wait_for_bootstrap)"
+        exit 1
+    fi
 else
     $ECHO "Chutney network launched and running. To stop the network, use:"
     $ECHO "$CHUTNEY stop $CHUTNEY_NETWORK"





More information about the tor-commits mailing list