Skip to content

Commit f2c451d

Browse files
fix(live): surface Skipped count so buckets always reconcile with Tested
Follow-up to the 3-bucket partition: the headline "N / M nodes tested" counts arr.length (incl. skipped / TEST_RUN_SKIP rows), but Passed SLA / Slow / Failed skip those rows — so during a TEST RUN (all skipped) or a P2P run with price-cap/offline skips the three buckets summed to fewer than Tested, breaking the "always sums to Tested" invariant. cbRender now also counts Skipped; the Skipped chip renders only when >0 (keeps normal runs uncluttered). passed + slow + failed + skipped now always === arr.length === Tested.
1 parent 0a600bc commit f2c451d

1 file changed

Lines changed: 15 additions & 5 deletions

File tree

live.html

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,7 @@
281281
.cb-snap-pass { color: var(--green); font-weight: 700; }
282282
.cb-snap-slow { color: var(--yellow); font-weight: 700; }
283283
.cb-snap-fail { color: var(--red); font-weight: 700; }
284+
.cb-snap-skip { color: var(--text-muted); font-weight: 700; }
284285
.cb-complete-msg {
285286
font-family: var(--font-display);
286287
font-size: 12px;
@@ -772,6 +773,7 @@ <h1 class="live-page-title">
772773
<span class="cb-snap-item">Passed SLA: <strong class="cb-snap-pass" id="cbPassed">0</strong></span>
773774
<span class="cb-snap-item">Slow: <strong class="cb-snap-slow" id="cbSlow">0</strong></span>
774775
<span class="cb-snap-item">Failed: <strong class="cb-snap-fail" id="cbFailed">0</strong></span>
776+
<span class="cb-snap-item" id="cbSkippedWrap" style="display:none">Skipped: <strong class="cb-snap-skip" id="cbSkipped">0</strong></span>
775777
</div>
776778
<div class="cb-complete-msg" id="cbCompleteMsg"></div>
777779
</div>
@@ -1518,6 +1520,7 @@ <h1 class="live-page-title">
15181520
passed: 0,
15191521
slow: 0,
15201522
failed: 0,
1523+
skipped: 0,
15211524
gapEndsAt: null,
15221525
gapTimer: null,
15231526
};
@@ -1531,7 +1534,7 @@ <h1 class="live-page-title">
15311534
const startRaw = data.startedAt || data.started_at;
15321535
_cb.startedAt = startRaw ? new Date(startRaw).getTime() : Date.now();
15331536
_cb.iteration = data.iteration ?? null;
1534-
_cb.tested = 0; _cb.passed = 0; _cb.slow = 0; _cb.failed = 0;
1537+
_cb.tested = 0; _cb.passed = 0; _cb.slow = 0; _cb.failed = 0; _cb.skipped = 0;
15351538
_cb.gapEndsAt = null;
15361539
if (_cb.gapTimer) { clearInterval(_cb.gapTimer); _cb.gapTimer = null; }
15371540
const dot = _cbEl('cbDot');
@@ -1646,21 +1649,28 @@ <h1 class="live-page-title">
16461649
// surfaced in the stat tiles, not here. (This replaced a 2-bucket scheme
16471650
// where slow-but-connected nodes fell through both filters, e.g. 7 tested
16481651
// showing 5 passed / 0 failed with the 2 slow nodes uncounted.)
1649-
let passed = 0, slow = 0, failed = 0;
1652+
let passed = 0, slow = 0, failed = 0, skipped = 0;
16501653
for (const r of arr) {
1651-
if (r.skipped || r.errorCode === 'TEST_RUN_SKIP') continue;
1654+
if (r.skipped || r.errorCode === 'TEST_RUN_SKIP') { skipped++; continue; }
16521655
const m = r.actualMbps != null ? Number(r.actualMbps) : null;
16531656
if (m == null || r.error || r.errorCode) failed++;
16541657
else if (m >= 10) passed++;
16551658
else slow++;
16561659
}
1657-
_cb.passed = passed; _cb.slow = slow; _cb.failed = failed;
1660+
// passed + slow + failed + skipped === arr.length (=== Tested), always.
1661+
_cb.passed = passed; _cb.slow = slow; _cb.failed = failed; _cb.skipped = skipped;
16581662
const passEl = _cbEl('cbPassed');
16591663
if (passEl) passEl.textContent = passed;
16601664
const slowEl = _cbEl('cbSlow');
16611665
if (slowEl) slowEl.textContent = slow;
16621666
const failEl = _cbEl('cbFailed');
16631667
if (failEl) failEl.textContent = failed;
1668+
// Skipped (price-cap / offline / TEST RUN) only shows when present, so the
1669+
// buckets visibly reconcile with Tested without cluttering normal runs.
1670+
const skipEl = _cbEl('cbSkipped');
1671+
if (skipEl) skipEl.textContent = skipped;
1672+
const skipWrap = _cbEl('cbSkippedWrap');
1673+
if (skipWrap) skipWrap.style.display = skipped > 0 ? '' : 'none';
16641674

16651675
const snapEl = _cbEl('cbSnapshot');
16661676
if (snapEl) snapEl.textContent = snap || '—';
@@ -2257,7 +2267,7 @@ <h1 class="live-page-title">
22572267
resultsArr.length = 0;
22582268
const tbody = document.getElementById('resultsBody');
22592269
if (tbody) tbody.innerHTML = '';
2260-
_cb.tested = 0; _cb.passed = 0; _cb.slow = 0; _cb.failed = 0;
2270+
_cb.tested = 0; _cb.passed = 0; _cb.slow = 0; _cb.failed = 0; _cb.skipped = 0;
22612271
}
22622272
}
22632273
if (Array.isArray(d.results) && d.results.length) {

0 commit comments

Comments
 (0)