A converging path is not packet loss, and an instant is not session state (#1383) #1384
No reviewers
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
jaylouisw/packetforge!1384
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "feat/ping-convergence"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
A converging path is not packet loss, and an instant is not session state. Fixes #1383.
1. The instant stuck to the session
ping <address> at 0calledsim.setRunTime(0), which persists on the simulator. Every later command in thatconsole session was answered at t=0 — the next plain
ping, a latershow ip route, anything — and nothing said so:Now
at <ms>applies to the command that said it. The console capturesrunAtMson the way in and restores it in afinally, whatever the ping did.2. The line read the command, not the answer
The convergence line printed
at t=<what you typed>, so that second ping saidat t=null ms.Simulator.ping()now returns
runAtMs— the instant the answer belongs to,nullwhen it belongs to no particular instant(
Infinity, a settled lab, which can never be converging) — and the console prints that.3. The browser called convergence packet loss
The Simulate dialog drew
Success rate 0% (0/4)for a path that was still settling — the lie the API stopped tellingin #1377 and #1381, one surface further out. It now shows the sentence and no percentage at all for a converging
answer, while genuine loss still reads as loss and a good path still reads 100%.
The sentence is written once —
pingConvergenceSentence(replies)inengine/simulator.js:Still converging: <process> on <device> (ready at <ms>)— printed once per ping however many echoes were heldup, and mirrored by the browser. The dialog's rendering became a pure function,
pingResultHtml(answer, dst, askedCount), so the awkward cases are checked directly instead of by driving a form.Evidence
test/ping-convergence.test.js— 33 checks:two held-up echoes, and is
nullfor a settled path;runAtMsis0when asked at 0 andnullfor a ping with no instant (not0);at t=0 ms, and nevert=null;ping … at 0, the next plain ping succeeds because it is asked atInfinity— the behavioural proofthat the instant no longer sticks;
two converging on one process, two on different processes with the later instant winning, no instant, nothing
pending, a timeout, all answered, empty);
0% (0/4); good →100% (2/2); unresolvablename → no percentage; half-converging →
50%and the reason.Reverting
engine/cli.jsfails 3 of 33, and the failure printout shows the old behaviour verbatim —% Still converging at t=null ms: …twice, thenSuccess rate is 0 percentfor the next plain ping. Revertingweb/app.jsfails on the missing rule;engine/simulator.json the missing instant.test/convergence-timing.test.jsmoves with the sentence it pins (it now checks the process, when the path will beready, and which instant the answer belongs to).
docs/CLI.mdanddocs/CONVERGENCE.mdquote the new line and statethat
at <ms>applies to one command.Suite: 195 suites, 7,501 assertions, 0 failed. Syntax: 263 files, OK.