tor-proto: Ensure rx end of chan reactor output sink is not dropped in test.
This hopefully fixes #1832 (closed).
I haven't been able to repro the failure from #1832 (closed) locally, but judging from the logs, I suspect it's triggered by interleavings like:
-
extend_futexecutes up untilcirc.extend_ntor(..).await, where it's blockedawaiting a completion notification from the circuit reactor -
reply_futstarts running:-
CircuitExtenderinstalls a meta-handler in the circuit reactor, and waits for anEXTENDED2cell -
test_extend()reads a cell from the receiving end of the fake channel's output sink (rx) -
test_extend()sends theEXTENDED2cell to the circuit reactor overCircuitRxSender -
rxis dropped
-
-
reply_futcompletes - in the channel reactor's
run_once(),select_biased!resolves to an error, because the receiving end of theoutputsink (rx) was dropped. The reactor logsgot sink error: SendError { kind: Disconnected }(seeSendError), and exits - the circuit reactor exits too, because the receiving end of its
chan_sender(which was in the channel reactor) was dropped
Returning the rx of the fake channel's output sink from reply_fut
should stop it from being dropped, and fix #1832 (closed).