From ef627bf2db1af1516ff02c77b5ec281f8113d828 Mon Sep 17 00:00:00 2001 From: Russell Cohen Date: Wed, 31 Jul 2024 09:26:50 -0400 Subject: [PATCH] Move atomic earlier --- tests/legacy_client.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/legacy_client.rs b/tests/legacy_client.rs index 43e9442..1303184 100644 --- a/tests/legacy_client.rs +++ b/tests/legacy_client.rs @@ -909,7 +909,6 @@ fn capture_connection_on_client() { assert!(captured_conn.connection_metadata().is_some()); } -#[cfg(not(miri))] #[test] fn connection_poisoning() { use std::sync::atomic::AtomicUsize; @@ -938,9 +937,9 @@ fn connection_poisoning() { let mut buf = [0; 4096]; loop { if sock.read(&mut buf).expect("read 1") > 0 { + num_requests_tracker.fetch_add(1, Ordering::Relaxed); sock.write_all(b"HTTP/1.1 200 OK\r\nContent-Length: 0\r\n\r\n") .expect("write 1"); - num_requests_tracker.fetch_add(1, Ordering::Relaxed); } } });