Stabilize Guardian WebSocket tests (#41191)

## Why

Guardian tests could continue after a WebSocket handshake but before the
connection entered the idle pool. The shared request waiter could also miss a
notification delivered between checking the request log and registering its
wait.

## What changed

- Wait for Guardian prewarming to populate the idle connection pool instead of
  treating completed handshakes as sufficient.
- Use two initial Guardian connections in tests while retaining eight in
  non-test builds.
- Register for request-log notifications before inspecting the log to avoid a
  lost wakeup.

GitOrigin-RevId: 88f6a22c5401e03c24e6e114f2563fc641bfef80
This commit is contained in:
jif authored and copyberry committed 2026-08-27 19:47:41 +00:00
1 parent efc020d224
commit 8935ff19db
4 files changed
+45 -27

No files matched your search

+2 -1
View File
@@ -604,6 +604,7 @@ impl WebSocketTestServer {
request_index: usize,
) -> WebSocketRequest {
loop {
let notified = self.request_log_updated.notified();
if let Some(request) = self
.connections
.lock()
@@ -614,7 +615,7 @@ impl WebSocketTestServer {
{
return request;
}
self.request_log_updated.notified().await;
notified.await;
}
}