Files
Enelix-EMS/tests/V4ControlTrial/cache_checks.php
T
dh 9fbc52ee47
Tests / test (push) Failing after 49s
feat(manager): integrate forecast controls and merge V4 development
Merge the V4 development history with current manager, SDL and setpoint fixes. Retain guarded trial behavior and consolidate controls in Prognose / Forecast. Exclude the unverified accounting-evidence change; no runtime deployment or new dispatch permission.

Validated: 357 PHPUnit tests / 1758 assertions, 150 PHP syntax checks, 310 backend tests, 16 portal tests and isolated UI/receiver checks. develop and beta publication explicitly approved by Daniel Haefliger.
2026-10-06 14:22:16 +00:00

21 lines
1.5 KiB
PHP

<?php
[$m,$b,$s]=fixture();start($m,$s);tick($m);
$before=$b->cachedFeedback();$reads=$GLOBALS['deviceReads'];
$GLOBALS['locks']['ENELIX.V4.Feedback.44234']=true;
$b->watchdogOnly();
check($b->active() && $GLOBALS['deviceReads']===$reads,'busy sampler cannot block watchdog or trigger device I/O');
check($b->cachedFeedback()===$before,'cache preserves original confirmed timestamps and values');
$b->V4BatterieTestStoppen();
check(!$b->active() && end($b->writes)===0,'stop reaches zero while the independent sampler is busy');
[$m,$b,$s]=fixture();start($m,$s);tick($m);advance(3);$b->watchdogOnly();
check(!$b->active() && end($b->writes)===0,'stale sample revokes the command after two seconds');
[$m,$b,$s]=fixture();start($m,$s);tick($m);$GLOBALS['mono']+=2.01;$b->watchdogOnly();
check(!$b->active() && end($b->writes)===0,'monotonic sample age blocks frozen wall clock');
[$m,$b,$s]=fixture();start($m,$s);tick($m);$GLOBALS['clock']--;$b->watchdogOnly();
check(!$b->active() && end($b->writes)===0,'future cache timestamp is never made current');
[$m,$b,$s]=fixture();start($m,$s);tick($m);$deviceReadOk=false;$b->sample();
rejects(fn()=>$b->cachedFeedback(),'failed acquisition invalidates a still-young cached sample');
[$m,$b,$s]=fixture();start($m,$s);tick($m);$reads=$GLOBALS['deviceReads'];
$c=$m->command();$c['sequence']++;$b->V4BatterieTestBefehl(json_encode($c));
check($b->active() && $GLOBALS['deviceReads']===$reads,'command independently validates cache and sends without transport I/O');