Skip to content

Make unreliable tor-proto tests more reliable (#238).

eta requested to merge eta/arti:238 into main

The bad_extend_* failures were caused by bad test code in bad_extend_test_impl that used futures::join!; this meant that the reactor could receive the Extended2 cell before it actually got the ExtendNtor request, which caused it to get (quite rightly) confused and close the circuit. Spawning a background thread which has a short delay before sending the Extended2 cell seems to have alleviated this problem.

new_circ_create_failure is similar; I think the reactor was getting dropped before it had a chance to flush out its CreateFast cell properly, because it had already gotten the result back (since the test code sends it indiscriminately). This was "fixed" in much the same manner as the other test: making it wait a bit before sending the result cell back.

There seem to be other tests that use futures::join! (like begindir?), and use similarly erroneous patterns; I haven't gotten any to fail reliably enough to be able to debug them, though.

Merge request reports