mirror of
https://github.com/stablyai/orca.git
synced 2026-09-29 08:03:20 +00:00
fix(relay): classify an empty region catalog as catalog-incomplete, not all-unreachable
This commit is contained in:
@@ -185,6 +185,16 @@ describe('Relay region probe log', () => {
|
||||
expect(probeEvents(events)[0]!.reason).toBe('all-unreachable')
|
||||
})
|
||||
|
||||
it('reports an empty catalog as catalog-incomplete, since nothing was probed', async () => {
|
||||
const { resolver, events } = resolverWithLog({
|
||||
path: userDataPath(),
|
||||
fetch: catalogFetch([]),
|
||||
probe: sampledProbe({})
|
||||
})
|
||||
await expect(resolver.resolve()).resolves.toBeUndefined()
|
||||
expect(probeEvents(events)[0]).toMatchObject({ reason: 'catalog-incomplete', regions: [] })
|
||||
})
|
||||
|
||||
it('reports a lone flapping region as all-rejected, and a lone healthy one as catalog-incomplete', async () => {
|
||||
const path = userDataPath()
|
||||
const flapping = resolverWithLog({
|
||||
|
||||
@@ -131,7 +131,12 @@ function refreshReason(
|
||||
return best && selected.region !== best.region ? 'held-previous' : 'measured'
|
||||
}
|
||||
// Reachability first: a support census counting all-unreachable to spot
|
||||
// client-side network breakage must not lose those runs to a roll wave.
|
||||
// client-side network breakage must not lose those runs to a roll wave. An
|
||||
// empty catalog (every region drained at once) probed nothing, so it is the
|
||||
// catalog that is incomplete, not the network.
|
||||
if (reports.length === 0) {
|
||||
return 'catalog-incomplete'
|
||||
}
|
||||
if (reports.every((report) => report.verdict === 'unreachable')) {
|
||||
return 'all-unreachable'
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user