mirror of
https://github.com/Vateron-Media/XC_VM.git
synced 2026-11-06 11:03:33 +01:00
cron:root_signals (root, every minute) killed every process titled XC_VM[Signals], meaning a stale run of its own, and then took that title: the xc_vm signals daemon's. So it killed the daemon every minute, and cron:servers, finding the root run under the daemon's title, did not start it again. On the test MAIN the daemon was down more than it ran: kill signals waited, in Redis mode past their TTL. The root cron now titles itself, and kills, XC_VM[RootSignals] only.
22 lines
1.1 KiB
PHP
22 lines
1.1 KiB
PHP
<?php
|
|
|
|
use PHPUnit\Framework\TestCase;
|
|
|
|
/**
|
|
* cron:root_signals (root, every minute) killed every process titled
|
|
* XC_VM[Signals] and then took that title itself: it killed the xc_vm
|
|
* signals daemon each minute, and cron:servers took the root run for the
|
|
* daemon and did not start it again. Each has a title of its own.
|
|
*/
|
|
final class RootSignalsTitleTest extends TestCase {
|
|
public function testTheRootCronNeverKillsNorPassesForTheSignalsDaemon(): void {
|
|
$rRoot = (string) file_get_contents(MAIN_HOME . 'Cli/CronJobs/RootSignalsCronJob.php');
|
|
$rDaemon = (string) file_get_contents(MAIN_HOME . 'Cli/Commands/SignalsCommand.php');
|
|
$this->assertStringContainsString("setProcessTitle('XC_VM[Signals]')", $rDaemon);
|
|
$this->assertStringNotContainsString('XC_VM[Signals]', $rRoot, 'the daemon\'s title');
|
|
$this->assertStringNotContainsString('XC_VM\\[Signals\\]', $rRoot, 'a pattern that matches the daemon');
|
|
$this->assertStringContainsString("cli_set_process_title('XC_VM[RootSignals]')", $rRoot);
|
|
$this->assertStringContainsString("pgrep -f 'XC_VM\\[RootSignals\\]'", $rRoot);
|
|
}
|
|
}
|