fix(v4): retry transient confirmed device reads
This commit is contained in:
@@ -35,6 +35,12 @@ dcheck($f['deviceReadConfirmed']===true&&$f['sourceOldestAt']===$n-1,'successful
|
||||
dcheck($f['sourceVariableOldestAt']===$n-100,'original VariableUpdated retained separately');
|
||||
dcheck($f['batteryW']===-3000.0&&$f['usableForTrial'],'unchanged values accepted after confirmed device response');
|
||||
|
||||
[$c,$r,$n]=dfixture();$times=[$n,$n,$n];$attempts=0;$pauses=[];
|
||||
$f=D::snapshot($c,fn($id)=>D::MODBUS_DEVICE,
|
||||
function()use(&$attempts){$attempts++;return $attempts>=2;},fn($id)=>$r[$id],
|
||||
function()use(&$times){return array_shift($times);},function($us)use(&$pauses){$pauses[]=$us;});
|
||||
dcheck($attempts===3&&$pauses===[200000],'transient busy read is retried once without relaxing confirmation');
|
||||
|
||||
[$c,$r,$n]=dfixture();$times=[$n,$n,$n];
|
||||
dfails(fn()=>D::snapshot($c,fn($id)=>D::MODBUS_DEVICE,fn()=>false,fn($id)=>$r[$id],function()use(&$times){return array_shift($times);}),
|
||||
'failed device read rejected');
|
||||
|
||||
@@ -34,8 +34,9 @@ namespace {
|
||||
ck($p['status']==='preview_only'&&$p['actualBatteryW']==0,'real receiver uses corrected physical feedback rather than held -9kW');
|
||||
ck($p['previewBatteryW']==3000,'net target translated once to total battery demand');
|
||||
ck($p['canDispatch']===false&&$p['localFeedback']['b']['estimated']===true,'model feedback remains marked and preview grants no dispatch');
|
||||
$feedback=['status'=>'unavailable','batteryW'=>null,'gridW'=>null];$p=json_decode($m->GetNetzfahrplanV4Vorschau(),true);
|
||||
$feedback=['status'=>'unavailable','reason'=>'feedback_device_read_failed:grid','batteryW'=>null,'gridW'=>null];$p=json_decode($m->GetNetzfahrplanV4Vorschau(),true);
|
||||
ck($p['status']==='unavailable'&&$p['previewBatteryW']===null,'configured feedback failure never falls back to held virtual display');
|
||||
ck(str_contains($p['reason'],'feedback_unavailable:feedback_device_read_failed:grid'),'configured feedback exposes bounded root cause without credentials');
|
||||
$configured=false;$p=json_decode($m->GetNetzfahrplanV4Vorschau(),true);
|
||||
ck($p['status']==='preview_only'&&$p['feedbackMeaning']==='legacy_display_only_not_for_trial','unconfigured old preview stays compatible but explicitly not for control');
|
||||
ck($p['canDispatch']===false,'legacy display cannot gain actuation permission');
|
||||
|
||||
Reference in New Issue
Block a user