Update Harbor client and gateway integration workflows
This commit is contained in:
@@ -56,6 +56,10 @@ test('typed Harbor client validates unknown state and isolates wire compatibilit
|
||||
gatewayAvailable: true,
|
||||
});
|
||||
assert.equal(Object.hasOwn(parsed, 'proxyPort'), false);
|
||||
assert.throws(() => parseHarborState({
|
||||
...snapshot,
|
||||
failover: { ...snapshot.failover, policy: { ...snapshot.failover.policy, intervalMs: 'fast' } },
|
||||
}), { code: 'INCOMPATIBLE_API' });
|
||||
let incompatible;
|
||||
try {
|
||||
parseHarborState({ ...snapshot, revision: -1 });
|
||||
@@ -116,6 +120,21 @@ test('an equal revision keeps the current snapshot identity', () => {
|
||||
assert.equal(next.snapshot.selection.desiredServerId, 'one');
|
||||
});
|
||||
|
||||
test('equal revision accepts only newer failover observations and retires old epochs', () => {
|
||||
const value = (epoch, sequence, status) => ({
|
||||
...snapshot(4, 'one'),
|
||||
failover: { observationEpoch: epoch, observationSequence: sequence, status },
|
||||
});
|
||||
let state = receive(initialHarborState, value('epoch-a', 1, 'primary'));
|
||||
state = receive(state, value('epoch-a', 2, 'waiting-for-idle'));
|
||||
assert.equal(state.snapshot.failover.status, 'waiting-for-idle');
|
||||
state = receive(state, value('epoch-b', 1, 'reserve'));
|
||||
assert.equal(state.snapshot.failover.status, 'reserve');
|
||||
state = receive(state, value('epoch-a', 99, 'primary'));
|
||||
assert.equal(state.snapshot.failover.status, 'reserve');
|
||||
assert.deepEqual(state.failoverTransport.retiredEpochs, ['epoch-a']);
|
||||
});
|
||||
|
||||
test('selection has no client-side shadow and follows canonical profile snapshots', () => {
|
||||
const state = receive(initialHarborState, snapshot(2, 'two'));
|
||||
assert.equal(Object.hasOwn(state, 'pendingServerId'), false);
|
||||
|
||||
Reference in New Issue
Block a user