Skip to content

Defer the chutney bootstrap check until we need Tor

anonym requested to merge dont-wait-on-chutney-bootstrap into stable

This saves a few minutes at test suite start we otherwise idly wait while chutney fully bootstraps. While this is not very impressive for a full test suite run it can have a noticeable impact for developers that frequently start new test suite runs.

Note that chutney is supposed to only need around 30 seconds to bootstrap, but quite frequently one or more of the nodes have issues bootstrapping:

Jun 14 12:33:55.762 [notice] Bootstrapped 75% (enough_dirinfo): Loaded enough directory info to build circuits
Jun 14 12:33:56.716 [warn] No available nodes when trying to choose node. Failing.
Jun 14 12:33:56.716 [warn] Could not find a node that matches the configured _HSLayer2Nodes set
Jun 14 12:33:56.716 [notice] Failed to find node for hop #2 of our path. Discarding this circuit.
Jun 14 12:33:56.716 [notice] Our circuit 0 (id: 6) died due to an invalid selected path, purpose Hidden service: Pre-built vanguard circuit. This may be a torrc configuration issue, or a bug.
Jun 14 12:33:57.717 [notice] Failed to find node for hop #2 of our path. Discarding this circuit.
Jun 14 12:33:58.718 [notice] Failed to find node for hop #2 of our path. Discarding this circuit.
[...]
Jun 14 12:38:54.044 [notice] Failed to find node for hop #2 of our path. Discarding this circuit.
Jun 14 12:38:55.045 [notice] Failed to find node for hop #2 of our path. Discarding this circuit.
Jun 14 12:38:56.046 [warn] Could not find a node that matches the configured _HSLayer2Nodes set [298 similar message(s) suppressed in last 300 seconds]
Jun 14 12:38:56.046 [notice] Failed to find node for hop #2 of our path. Discarding this circuit.
Jun 14 12:38:56.161 [notice] Our directory information is no longer up-to-date enough to build circuits: We need more microdescriptors: we have 5/19, and can only build 33% of likely paths. (We have 69% of guards bw, 69% of midpoint bw, and 69% of end bw (no exits in consensus, using mid) = 33% of path bw.)
Jun 14 12:38:56.163 [notice] The current consensus has no exit nodes. Tor can only build internal paths, such as paths to onion services.
Jun 14 12:38:56.163 [notice] I learned some more directory information, but not enough to build a circuit: We need more microdescriptors: we have 5/19, and can only build 33% of likely paths. (We have 69% of guards bw, 69% of midpoint bw, and 69% of end bw (no exits in consensus, using mid) = 33% of path bw.)
Jun 14 12:38:56.226 [notice] The current consensus contains exit nodes. Tor can build exit and internal paths.
Jun 14 12:38:56.226 [notice] We now have enough directory information to build circuits.
Jun 14 12:38:57.047 [notice] Bootstrapped 90% (ap_handshake_done): Handshake finished with a relay to build circuits
Jun 14 12:38:57.047 [notice] Bootstrapped 95% (circuit_create): Establishing a Tor circuit
Jun 14 12:38:57.089 [notice] Bootstrapped 100% (done): Done

Here bootstrapping was stuck for about 5 minutes.

So in the normal case we'll save around 30s, but in the bad cases where bootstrapping takes minutes, we can save more: I had an instance where I reached Tor is ready after about 3 minutes since starting the test suite, and Chutney was having issues but they resolved at around 4 minutes. So in this case I was idling only 1 minute, instead of the 4 minutes without this MR.

Merge request reports