Files
cacti/tests/Unit/Core/Boost
63a53d511b fix: Make boost_redirect the default boost behavior (develop port of #8559) (#8561)
* fix: Make boost_redirect the default boost behavior

Port of the 1.2.x change (issue#8470) to develop. Boost redirection is now
permanent whenever boost is enabled, so the boost_redirect setting is removed
and the collector always stages poller output directly into
poller_output_boost.

- cmd.php: drop the boost_redirect guard; stage whenever boost_rrd_update_enable
  is on.
- include/global_settings.php, settings.php: remove the boost_redirect setting
  and its UI toggles.
- lib/snmpagent.php: always report the redirect object as enabled.
- poller.php, settings.php: stop force-setting boost_redirect for multi-poller
  installs (boost_rrd_update_enable alone now implies redirection).
- lib/boost.php: boost_poller_on_demand() no longer stages inline; cmd.php owns
  staging, so it only reports rows as already staged and never re-inserts.

Tests are updated to match the single, permanent-redirect pipeline: the
hand-off acknowledgement and consolidation contracts point at the surviving
cmd.php/poller_recovery.php call sites, and the PollerOutput probe drops the
now-dead redirect-off staging scenarios.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* test(coverage): cover the permanent Boost redirect in snmpagent

Add a request-coverage probe that exercises the permanent
boostApplRrdUpdateRedirect assignment in snmpagent_global_settings_update().
The statement lives in a MibCache-driven function that cannot run under the
unit/integration coverage driver without a live SNMP agent cache, so the
single changed line is compiled at its original line number and executed
against a minimal MibCache stand-in, with Xdebug coverage remapped to
lib/snmpagent.php. Register the probe so the changed-PHP coverage gate runs
it whenever lib/snmpagent.php changes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* i18n:

* tests: Cover the cmd.php Boost flush guards for the changed-line gate

Making boost_redirect the default removed the boost_redirect half of the three poller flush conditions in cmd.php, leaving bare read_config_option(boost_rrd_update_enable) guards at lines 392, 501, and 537. Those statements live in cmd.php top-level poller loop, so the unit/integration driver includes them in the denominator but never executes them, dropping changed-line coverage to 3 of 6 (50 percent).

Adds a request-coverage probe that compiles each changed guard at its original line number and executes it against minimal read_config_option/boost_flush_output_batch stand-ins, mirroring the existing snmpagent redirect probe. Xdebug hits are remapped to cmd.php, raising changed-line coverage to 6 of 6 (100 percent). Registers the probe in run_request_coverage.sh so it runs whenever cmd.php changes.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

* fix(boost): keep the boost_redirect compatibility flag enabled

Port the poller.php compatibility assignment from the 1.2.x change
(#8559, commit ba2ab827) that this develop port dropped. Supported
Spine versions still read the hidden boost_redirect flag to stage
poller output into poller_output_boost; without it a compatible
collector never stages, yet boost_poller_on_demand() still reports
the rows as staged and poller_acknowledge_output() deletes them,
losing samples. Set the flag unconditionally before launching
collectors so redirection stays permanent whenever Boost is enabled.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

---------

Co-authored-by: TheWitness <copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-11-02 17:28:47 +00:00
..