test(servers): cover exhaustion reconnection and offline retry loop
Adds a production-wired exhaustion trigger hook, documents the no-throw invariant behind the fire-and-forget verification probe, and covers the confirmed-offline reconnect and debounce-driven recovery.
This commit is contained in:
@@ -1139,6 +1139,9 @@ class MultiServerManager {
|
||||
});
|
||||
}
|
||||
|
||||
/// Fire-and-forget safe: both backends' `checkHealth` catch every failure
|
||||
/// and fold it into a [HealthStatus], and the scheduled reconnection guards
|
||||
/// its own errors — this future must never complete with one.
|
||||
Future<void> _verifyServerEndpointsExhausted(ServerId serverId) async {
|
||||
final client = _clients[serverId];
|
||||
if (client == null || !_endpointHealthChecks.add(serverId)) return;
|
||||
@@ -1193,6 +1196,11 @@ class MultiServerManager {
|
||||
Future<void> debugVerifyServerEndpointsExhaustedForTesting(ServerId serverId) =>
|
||||
_verifyServerEndpointsExhausted(serverId);
|
||||
|
||||
/// Entry point matching production exhaustion wiring (debounce + the
|
||||
/// in-flight-verification guard), for tests driving the full retry loop.
|
||||
@visibleForTesting
|
||||
void debugTriggerEndpointsExhaustedForTesting(ServerId serverId) => _onServerEndpointsExhausted(serverId);
|
||||
|
||||
/// Disconnect all servers
|
||||
void disconnectAll() {
|
||||
appLogger.i('Disconnecting all servers');
|
||||
|
||||
Reference in New Issue
Block a user