Commit 0f5bed4
committed
fix(pipeline): baseline double-count, counter drift, retest totals, loop stop
From the bug hunt, adversarially reviewed (safe to commit, no CRITICAL/HIGH):
- baselineHistory double-count: refreshBaseline() ran per node ATTEMPT (before
testNode), so a stop+resume or pause-retry of one node pushed multiple baseline
samples (user saw baseline=4 vs speed=3 for 3 nodes). Now refreshBaseline only
stashes a pending sample; commitBaselineSample(addr) pushes once per RECORDED
node (dedup by address, per-invocation closure), at the success/fail result
sites — interrupted/retried attempts commit nothing. baseline == tested-count.
- runAudit now calls recomputeCounters(state) at completion (only on finish/stop,
not the error path) so persisted counters match results[] instead of the
drift-prone live increments.
- Iron-Rule retest block now guards the success flip on result.actualMbps!=null
(mirrors the internet-recovery block); a null-mbps result persists as a fail
without a bogus failed--/tested++.
- runRetestSkips no longer rewrites totalNodes = tested+failed (which collapsed
the grand total for partial/stopped runs) — uses Math.max(results.length,total).
- fresh runAudit now resets skippedNodes alongside the sibling counters.
- continuous pause()/stop() now propagate to the in-flight pipeline
(triggerPipelineStop() + loopState.stopRequested) so a sweep and its payments
halt promptly instead of running to completion first.
Test suite green (188/31/45/35).1 parent aa2d951 commit 0f5bed4
2 files changed
Lines changed: 58 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| |||
144 | 144 | | |
145 | 145 | | |
146 | 146 | | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
147 | 151 | | |
148 | 152 | | |
149 | 153 | | |
| |||
371 | 375 | | |
372 | 376 | | |
373 | 377 | | |
| 378 | + | |
| 379 | + | |
374 | 380 | | |
375 | 381 | | |
376 | 382 | | |
| |||
613 | 619 | | |
614 | 620 | | |
615 | 621 | | |
| 622 | + | |
616 | 623 | | |
617 | 624 | | |
618 | 625 | | |
| |||
728 | 735 | | |
729 | 736 | | |
730 | 737 | | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
731 | 742 | | |
732 | 743 | | |
733 | 744 | | |
| |||
744 | 755 | | |
745 | 756 | | |
746 | 757 | | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
747 | 763 | | |
748 | 764 | | |
749 | 765 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
617 | 617 | | |
618 | 618 | | |
619 | 619 | | |
| 620 | + | |
620 | 621 | | |
621 | 622 | | |
622 | 623 | | |
| |||
666 | 667 | | |
667 | 668 | | |
668 | 669 | | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
669 | 678 | | |
670 | 679 | | |
671 | 680 | | |
672 | 681 | | |
673 | 682 | | |
674 | | - | |
| 683 | + | |
675 | 684 | | |
676 | 685 | | |
677 | 686 | | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
678 | 696 | | |
679 | 697 | | |
680 | 698 | | |
| |||
909 | 927 | | |
910 | 928 | | |
911 | 929 | | |
| 930 | + | |
912 | 931 | | |
913 | 932 | | |
914 | 933 | | |
| |||
977 | 996 | | |
978 | 997 | | |
979 | 998 | | |
| 999 | + | |
980 | 1000 | | |
981 | 1001 | | |
982 | 1002 | | |
| |||
1169 | 1189 | | |
1170 | 1190 | | |
1171 | 1191 | | |
1172 | | - | |
| 1192 | + | |
| 1193 | + | |
1173 | 1194 | | |
1174 | 1195 | | |
1175 | 1196 | | |
1176 | 1197 | | |
1177 | 1198 | | |
1178 | 1199 | | |
1179 | 1200 | | |
| 1201 | + | |
| 1202 | + | |
| 1203 | + | |
| 1204 | + | |
| 1205 | + | |
| 1206 | + | |
| 1207 | + | |
| 1208 | + | |
1180 | 1209 | | |
1181 | 1210 | | |
1182 | 1211 | | |
| |||
1195 | 1224 | | |
1196 | 1225 | | |
1197 | 1226 | | |
| 1227 | + | |
| 1228 | + | |
| 1229 | + | |
| 1230 | + | |
1198 | 1231 | | |
1199 | 1232 | | |
1200 | 1233 | | |
| |||
1218 | 1251 | | |
1219 | 1252 | | |
1220 | 1253 | | |
1221 | | - | |
| 1254 | + | |
| 1255 | + | |
| 1256 | + | |
| 1257 | + | |
| 1258 | + | |
| 1259 | + | |
1222 | 1260 | | |
1223 | 1261 | | |
1224 | 1262 | | |
| |||
0 commit comments