Skip to content

The headless browser for AI agents and web scraping

test(browser): wait for concurrent fixture requests on macOS

ice Zeus6635ddeff10f
diff --git a/crates/obscura-browser/src/page.rs b/crates/obscura-browser/src/page.rs
index 2ce5976f..dd3dbac0 100644
--- a/crates/obscura-browser/src/page.rs
+++ b/crates/obscura-browser/src/page.rs
@@ -8029,6 +8029,12 @@ mod tests {
let (open, peak, seen_tx) =
(open_thread.clone(), peak_thread.clone(), seen_tx.clone());
std::thread::spawn(move || {
+ // Accepted sockets inherit nonblocking mode on macOS.
+ // Wait for request bytes before sending the delayed body.
+ stream.set_nonblocking(false).unwrap();
+ stream
+ .set_read_timeout(Some(std::time::Duration::from_secs(1)))
+ .unwrap();
let now = open.fetch_add(1, Ordering::SeqCst) + 1;
peak.fetch_max(now, Ordering::SeqCst);
let mut request = [0u8; 4096];