Try to make the tor_proto::circuit::begindir test more reliable.

I traced the problem here to the fact that sometimes "rx" in this
test would be dropped before the test was done.  When "rx" is
dropped, the channel reactor shuts down, which in turn kills off the
circuit reactor.

This bug may exist in other cases in these tests.  This patch may
fix one case of #238.
This commit is contained in:
Nick Mathewson 2021-11-23 10:50:20 -05:00
parent 9e617fac43
commit 672b111262
1 changed files with 2 additions and 2 deletions

View File

@ -1154,10 +1154,10 @@ mod test {
let end = relaymsg::End::new_with_reason(relaymsg::EndReason::DONE).into();
sink.send(rmsg_to_ccmsg(streamid, end)).await.unwrap();
sink // gotta keep the sink alive, or the reactor will exit.
(rx, sink) // gotta keep these alive, or the reactor will exit.
};
let (_stream, _) = futures::join!(begin_and_send_fut, reply_fut);
let (_stream, (_rx, _sink)) = futures::join!(begin_and_send_fut, reply_fut);
});
}