Best headless browser for AI agents. Lite, Fast, High-Compatibility. Built in Rust
Rust ai-agentsai-toolsbrowserbrowser-automationcloud-browserheadlessheadless-browserkitesurfplaywrightpuppeteerrustservoweb-crawlerweb-crawlingweb-scraperweb-scraping
fix(wpt): absorb parallel fixture connection bursts
ldm0b35056ac82ba
diff --git a/moli-benchmark/moli_benchmark/wpt_cross/server.py b/moli-benchmark/moli_benchmark/wpt_cross/server.pyindex bb22c9abf..02fb951e4 100644--- a/moli-benchmark/moli_benchmark/wpt_cross/server.py+++ b/moli-benchmark/moli_benchmark/wpt_cross/server.py@@ -1847,6 +1847,11 @@ def _wpt_cookie_websocket_set_cookie(query: str) -> str | None:class _FixtureThreadingHTTPServer(ThreadingHTTPServer):+ # Match wptserve: parallel browsers open bursts of subresource connections.+ # The stdlib backlog of five makes them wait for TCP retransmissions before+ # their requests reach a handler, changing the timing the cases measure.+ request_queue_size = 2000+def handle_error(self, request: object, client_address: object) -> None:# Disposing a case BrowserContext intentionally cancels any auxiliary# requests that outlive the harness result. The stdlib server prints adiff --git a/moli-benchmark/tests/test_wpt_connection_backlog.py b/moli-benchmark/tests/test_wpt_connection_backlog.pynew file mode 100644index 000000000..43a044194--- /dev/null+++ b/moli-benchmark/tests/test_wpt_connection_backlog.py@@ -0,0 +1,39 @@+from __future__ import annotations++import socket+import unittest+from contextlib import ExitStack, closing+from http.server import BaseHTTPRequestHandler++from moli_benchmark.wpt_cross.server import (+ _FixtureThreadingHTTPServer,+ _Ipv6ThreadingHTTPServer,+)+++class FixtureConnectionBacklogTests(unittest.TestCase):+ def assert_worker_burst_can_connect(+ self,+ server_class: type[_FixtureThreadingHTTPServer],+ address: tuple[str, int],+ ) -> None:+ # Hold the accept loop so all connections coexist in the listen queue.+ # This isolates queue capacity from handler speed and TCP retry timing.+ with server_class(address, BaseHTTPRequestHandler) as server:+ host, port = server.server_address[:2]+ with ExitStack() as connections:+ for _ in range(50):+ connections.enter_context(closing(socket.create_connection(+ (host, port), timeout=1,+ )))++ def test_loopback_listener_accepts_a_full_worker_burst(self) -> None:+ self.assert_worker_burst_can_connect(+ _FixtureThreadingHTTPServer, ("127.0.0.1", 0),+ )++ @unittest.skipUnless(socket.has_ipv6, "IPv6 is unavailable")+ def test_ipv6_listener_accepts_a_full_worker_burst(self) -> None:+ self.assert_worker_burst_can_connect(+ _Ipv6ThreadingHTTPServer, ("::1", 0),+ )