fix(watchdog): pin the heartbeat telemetry fixes with stronger tests

Review follow-up to the bandwidth/rps/producers fix. The nginx stub_status
parse moves into SystemInfo::nginxRequestCount(), so the requests field the
watchdog samples is tested against a real status body and an unreachable
one (no count, rps 0). The getStats() test now pins the whole array_replace
statement (a `+` would leave the bandwidth keys at 0), and the sampler test
checks that 120 s is in range by default. No behaviour change.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TQHeypQpfAXTdCysmi7b6a
This commit is contained in:
Claude
2026-09-25 00:20:41 +00:00
parent f8f3ca3a82
commit 3dfaa83712
5 changed files with 47 additions and 4 deletions
+2 -1
View File
@@ -93,7 +93,8 @@ final class SystemInfoNetworkTest extends TestCase {
public function testGetStatsTakesItsBandwidthFromAggregateNetwork(): void {
$rSource = (string) file_get_contents(MAIN_HOME . 'Core/Util/SystemInfo.php');
$this->assertStringContainsString('self::aggregateNetwork($rJSON[\'network_info\'])', $rSource);
// array_replace, not `+`: the keys already exist (as 0) and must be overwritten in place.
$this->assertStringContainsString("\$rJSON = array_replace(\$rJSON, self::aggregateNetwork(\$rJSON['network_info']));", $rSource);
$this->assertStringNotContainsString("\$rJSON['bytes_sent_total'] = (", $rSource, 'the total must not be assigned per interface');
}
}