The three discarded-check unit tests check only the row, not that nothing was recorded #151

Closed
opened 2026-10-14 16:08:47 +02:00 by clawbot · 2 comments
Collaborator

test/unit/main.test.js lines 200 to 247, at v1.0.0-rc1: the three tests "a check still waiting when its round is given up does not show in its row", "... when the user pauses does not show in its row" and "a check in the first round does not show in its row" assert only that the row's latency figure was not written (latencyFigure(...) === undefined). The guard they exercise, web/src/main.js lines 1260 to 1262, protects three things: the console line, host.pushSample (line 1264) and updateHostRow (line 1265). A change that records the sample and skips only the drawing would keep all three tests green while a given-up round, a check that ended while paused, or the discarded first round went into the host's history, the statistics and the next report.

How to see it: move the guard at lines 1260 to 1262 to just before line 1265 and run make test: the three tests still pass.

What is right: README.md Latency measurement: "A round started early gives up the last round's checks if they are still waiting, and that round records nothing more"; Design: "The first round, after loading or an interval change, is discarded." The tests should check "records nothing": the host's history is unchanged and its status still pending.

Severity: low. The behaviour is right today; the tests would not catch it breaking.

Definition of done

  • Each of the three tests also asserts that the answering host's history is empty (or unchanged) and its status unchanged after the check ends, and that nothing was written to the console.
  • Planting the change above makes at least one of them fail; reverted afterwards.
  • TODO.md updated in the same commit; commit title ends (closes #N) with this issue's number.

Model: fable-5-1

`test/unit/main.test.js` lines 200 to 247, at `v1.0.0-rc1`: the three tests "a check still waiting when its round is given up does not show in its row", "... when the user pauses does not show in its row" and "a check in the first round does not show in its row" assert only that the row's latency figure was not written (`latencyFigure(...) === undefined`). The guard they exercise, `web/src/main.js` lines 1260 to 1262, protects three things: the console line, `host.pushSample` (line 1264) and `updateHostRow` (line 1265). A change that records the sample and skips only the drawing would keep all three tests green while a given-up round, a check that ended while paused, or the discarded first round went into the host's history, the statistics and the next report. **How to see it**: move the guard at lines 1260 to 1262 to just before line 1265 and run `make test`: the three tests still pass. **What is right**: `README.md` Latency measurement: "A round started early gives up the last round's checks if they are still waiting, and that round records nothing more"; Design: "The first round, after loading or an interval change, is discarded." The tests should check "records nothing": the host's `history` is unchanged and its status still `pending`. **Severity**: low. The behaviour is right today; the tests would not catch it breaking. ## Definition of done - [ ] Each of the three tests also asserts that the answering host's `history` is empty (or unchanged) and its `status` unchanged after the check ends, and that nothing was written to the console. - [ ] Planting the change above makes at least one of them fail; reverted afterwards. - [ ] `TODO.md` updated in the same commit; commit title ends ` (closes #N)` with this issue's number. Model: fable-5-1
clawbot self-assigned this 2026-10-14 16:08:47 +02:00
Author
Collaborator

The three tests now also check the host's history, its status and the console: #173

Model: opus-5-5

The three tests now also check the host's history, its status and the console: https://git.eeqj.de/sneak/netwatch/pulls/173 Model: opus-5-5
Author
Collaborator

Fixed in #173.

Model: opus-5-5

Fixed in https://git.eeqj.de/sneak/netwatch/pulls/173. Model: opus-5-5
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/netwatch#151