the queue is settled when it is empty, and the impact scene asks its questions one at a time
ci / build, test, smoke (push) Successful in 2m39s
ci / the operator page in a real browser (push) Failing after 2m29s
ci / lint the workflow and the shell (push) Successful in 8s
ci / build the image and smoke it (push) Successful in 4m2s

Two assertions that could not pass, each for a different reason.

AlertPushQueueTests.Attempts_run_out_and_the_surface_says_who_was_never_told
waited for the first delivery to give up and then asserted the queue was empty.
Six 502s at N=3 raise two alerts - the crossing at 3, the doubling at 6 - so two
deliveries are owed, and the second is still inside its backoff window when the
first gives up. Measured on the Gitea runner (run 2361, head 223b8d6): 404 of 405
passed and this one read pending=1. The wait now asks for both, which is what the
Settled helper two screens up already says a settled queue means.

console-check.cjs asked /admin-api/impact whether a live range already covers the
match while its own seeded exemption was still live. The endpoint reports
alreadyCoveredBy as what already ANSWERS for the match's own address, and a live
allow answers that address first, so the field is null by design and the
assertion could not pass for any build. Measured on the same run: the answer
named the exemption and nothing else. The exemption now comes off before that
question is asked.
This commit is contained in:
Pavlo Ratushnyi
2026-10-05 21:53:02 +02:00
parent 63cc575eb9
commit 36d9338621
2 changed files with 29 additions and 7 deletions
@@ -162,7 +162,17 @@ public sealed class AlertPushQueueTests
await BreakTheUpstreamAsync(f);
var state = await WaitForStateAsync(f, s => s.GetProperty("alertPushGivenUp").GetInt32() >= 1);
// Settled means the QUEUE is empty, not merely that one row reached its
// end. Six 502s at N=3 raise two alerts — the crossing at 3 and the
// doubling at 6 — so two deliveries are owed, and the first one to give
// up leaves the second still retrying for another backoff window. Waiting
// on givenUp alone read that window as a product that had stopped asking
// while still holding a row: measured on the Gitea Actions runner (run
// 2361, head 223b8d6) this assertion read pending=1 there, and the same
// race is what the Settled helper two screens up already exists for.
var state = await WaitForStateAsync(f,
s => s.GetProperty("alertPushGivenUp").GetInt32() >= 1
&& s.GetProperty("alertPushPending").GetInt32() == 0);
Assert.Equal(0, state.GetProperty("alertPushPending").GetInt32());
Assert.True(state.GetProperty("alertPushGivenUp").GetInt32() >= 1, state.ToString());
+18 -6
View File
@@ -1777,6 +1777,24 @@ const rgb = (s) => s.match(/\d+/g).slice(0, 3).map(Number);
&& /^asked: 192\.0\.2\.120\/30 at \/ - \d+ sources probed - newly refused 0, already refused 0, still passing [1-9]\d*$/.test(exempt[0] || ''),
JSON.stringify(exempt));
// The exemption comes off BEFORE the covering-range question is asked.
// /admin-api/impact reports alreadyCoveredBy as what already ANSWERS for the
// match's own address, and while a live allow covers that address the answer
// is pass_allowlisted — the engine never reaches the range, so the field is
// null by design (AdminEndpoints.cs, the self.IsBlocked arm). Asking with the
// exemption still in place asked the same question twice: measured on Gitea
// Actions run 2361 (head 223b8d6) the answer named the exemption and nothing
// else, and this assertion could not have passed for any build.
const exemptKey = await page.$$eval('#allow tbody tr', (trs, t) => {
const tr = trs.find((r) => (r.children[0].textContent || '').trim() === t);
const b = tr && tr.querySelector('button[data-act="delallow"]');
return b ? b.dataset.k : '';
}, IMP_NET);
if (exemptKey) await page.click(`#allow tbody button[data-act="delallow"][data-k="${exemptKey}"]`);
await page.waitForFunction((m) => ![...document.querySelectorAll('#allow tbody tr')]
.some((tr) => (tr.children[0].textContent || '').trim() === m), IMP_NET,
{ timeout: 15000 }).catch(() => {});
await page.fill('#blockIp', IMP_WIDE);
await page.fill('#blockReason', 'console gate: impact wide range');
await page.click('#addBlock');
@@ -1787,12 +1805,6 @@ const rgb = (s) => s.match(/\d+/g).slice(0, 3).map(Number);
covered.some((l) => /^already covered at its own address: block_operator by 192\.0\.2\.112\/28 - this write would change nothing there/.test(l || '')),
JSON.stringify(covered));
const allowKey = await page.$$eval('#allow tbody tr', (trs, t) => {
const tr = trs.find((r) => (r.children[0].textContent || '').trim() === t);
const b = tr && tr.querySelector('button[data-act="delallow"]');
return b ? b.dataset.k : '';
}, IMP_NET);
if (allowKey) await page.click(`#allow tbody button[data-act="delallow"][data-k="${allowKey}"]`);
await page.click(`#blocks tbody button[data-act="delblock"][data-k="${IMP_WIDE}"]`);
await page.waitForFunction((k) => ![...document.querySelectorAll('#blocks tbody button[data-act="delblock"]')]
.some((b) => b.dataset.k === k), IMP_WIDE, { timeout: 15000 }).catch(() => {});