Clarify and strengthen state invariant tests
All checks were successful
Build and Deploy Gateway / build-and-push (push) Successful in 13s
Build and Deploy Gateway / deploy (push) Successful in 6s

This commit is contained in:
2026-07-12 12:22:59 +03:00
parent 5e33360c92
commit 2a214fc28b
5 changed files with 76 additions and 5 deletions

View File

@@ -26,7 +26,7 @@ function deferred() {
return { promise, resolve };
}
test('an older polling promise cannot replace a newer mutation snapshot', async () => {
test('data invariant: an older polling promise cannot replace a newer mutation snapshot', async () => {
let state = receive(initialHarborState, snapshot(1, 'one'));
const poll = deferred();
const mutation = deferred();
@@ -68,7 +68,7 @@ test('pending selection is cleared when its server disappears', () => {
assert.equal(receive(state, snapshot(2, 'one', ['one'])).pendingServerId, '');
});
test('initial 500 and connection refusal become retryable boot failures', () => {
test('data invariant: initial control outage is retryable without a fabricated snapshot', () => {
const serverError = Object.assign(new Error('Internal Server Error'), { status: 500 });
const refused = new TypeError('fetch failed');