From c4d0fceec37e3842fad4aeb5afb0dfac4353390d Mon Sep 17 00:00:00 2001 From: Matt Mastracci Date: Tue, 16 Apr 2024 12:54:50 -0600 Subject: fix(cli): TestEventSender should be !Clone (#23405) `TestEventSender` should not be Clone so we don't end up with multiple copies of the same writer FD. This is probably not the cause of the test channel lockups, but it's a lot easier to reason about. --- cli/tools/test/channel.rs | 16 ---------------- 1 file changed, 16 deletions(-) (limited to 'cli/tools/test/channel.rs') diff --git a/cli/tools/test/channel.rs b/cli/tools/test/channel.rs index a024393bb..aad3f926e 100644 --- a/cli/tools/test/channel.rs +++ b/cli/tools/test/channel.rs @@ -16,7 +16,6 @@ use std::io::Write; use std::pin::Pin; use std::sync::atomic::AtomicUsize; use std::sync::atomic::Ordering; -use std::sync::Arc; use std::task::ready; use std::task::Poll; use std::time::Duration; @@ -310,7 +309,6 @@ impl TestEventSenderFactory { let sender = TestEventSender { id, - ref_count: Default::default(), sender: self.sender.clone(), sync_sender, stdout_writer, @@ -373,26 +371,12 @@ pub struct TestEventWorkerSender { /// are not guaranteed to be sent on drop unless flush is explicitly called. pub struct TestEventSender { pub id: usize, - ref_count: Arc<()>, sender: UnboundedSender<(usize, TestEvent)>, sync_sender: UnboundedSender<(SendMutex, SendMutex)>, stdout_writer: PipeWrite, stderr_writer: PipeWrite, } -impl Clone for TestEventSender { - fn clone(&self) -> Self { - Self { - id: self.id, - ref_count: self.ref_count.clone(), - sender: self.sender.clone(), - sync_sender: self.sync_sender.clone(), - stdout_writer: self.stdout_writer.try_clone().unwrap(), - stderr_writer: self.stderr_writer.try_clone().unwrap(), - } - } -} - impl TestEventSender { pub fn send(&mut self, message: TestEvent) -> Result<(), ChannelClosedError> { // Certain messages require us to ensure that all output has been drained to ensure proper -- cgit v1.2.3