From b70396b8fb66e736fbf5d4e6952ab077ce5dec1d Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Tue, 31 May 2022 18:09:33 -0700 Subject: [PATCH] Disconnect FakeServer when dropping it This prevents memory leak errors in tests, due to parked tasks waiting for RPC responses. --- crates/client/src/test.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/crates/client/src/test.rs b/crates/client/src/test.rs index a809bd2769..92183e2566 100644 --- a/crates/client/src/test.rs +++ b/crates/client/src/test.rs @@ -178,6 +178,12 @@ impl FakeServer { } } +impl Drop for FakeServer { + fn drop(&mut self) { + self.disconnect(); + } +} + pub struct FakeHttpClient { handler: Box< dyn 'static