Scheduler: define expected filtering behaviour for significant tasks

This commit is contained in:
Fischlurch 2023-11-02 23:35:26 +01:00
parent d622b59dfd
commit b1e0ce1a79
3 changed files with 132 additions and 17 deletions

View file

@ -98,6 +98,7 @@ namespace test {
torture_GroomingToken();
verify_DispatchDecision();
verify_findWork();
verify_Significance();
verify_postDispatch();
integratedWorkCycle();
}
@ -347,6 +348,85 @@ namespace test {
/** @test verify that obsoleted or rejected entries are dropped transparently
* - add entries providing extra information regarding significance
* - verify that missing the deadline is detected
* - entries past deadline will be dropped when pulling for work
* - entries tagged with an ManifestationID can be disabled and
* will be automatically disposed.
* - an entry marked as _compulsory_ will block that process
* when missing it's deadline
*/
void
verify_Significance()
{
SchedulerInvocation queue;
SchedulerCommutator sched;
Time t1{10,0}; Activity a1{1u,1u};
Time t2{20,0}; Activity a2{2u,2u};
Time t3{30,0}; Activity a3{3u,3u};
Time t4{40,0}; Activity a4{4u,4u};
queue.instruct (a1, t1, t4, ManifestationID{5});
queue.instruct (a2, t2, t3);
queue.instruct (a3, t3, t3, ManifestationID{23}, true);
queue.instruct (a4, t4, t4);
queue.activate(ManifestationID{5});
queue.activate(ManifestationID{23});
queue.feedPrioritisation();
CHECK (t1 == queue.headTime());
CHECK (isSameObject (a1, *queue.peekHead()));
CHECK (not queue.isMissed(t1));
CHECK (not queue.isOutdated(t1));
queue.drop(ManifestationID{5});
CHECK (t1 == queue.headTime());
CHECK (not queue.isMissed(t1));
CHECK ( queue.isOutdated(t1));
CHECK (not sched.findWork(queue, t1));
CHECK (t2 == queue.headTime());
CHECK (not queue.isMissed (t2));
CHECK (not queue.isOutdated(t2));
CHECK ( queue.isMissed (t3));
CHECK ( queue.isOutdated(t3));
CHECK (not sched.findWork(queue, t2));
CHECK (t3 == queue.headTime());
CHECK (not queue.isMissed (t3));
CHECK (not queue.isOutdated (t3));
CHECK (not queue.isOutOfTime(t3));
CHECK ( queue.isMissed (t4));
CHECK ( queue.isOutdated (t4));
CHECK ( queue.isOutOfTime(t4));
CHECK (not sched.findWork(queue, t4));
CHECK (t3 == queue.headTime());
CHECK (not queue.isMissed (t3));
CHECK (not queue.isOutdated (t3));
CHECK (not queue.isOutOfTime(t3));
CHECK ( queue.isMissed (t4));
CHECK ( queue.isOutdated (t4));
CHECK ( queue.isOutOfTime(t4));
queue.drop(ManifestationID{5});
CHECK (t3 == queue.headTime());
CHECK (not queue.isMissed (t3));
CHECK ( queue.isOutdated (t3));
CHECK (not queue.isOutOfTime(t3));
CHECK ( queue.isMissed (t4));
CHECK ( queue.isOutdated (t4));
CHECK (not queue.isOutOfTime(t4));
CHECK (isSameObject (a3, *queue.peekHead()));
CHECK (isSameObject (a4, *sched.findWork(queue, t4)));
CHECK (queue.empty());
}
/** @test verify entrance point for performing an Activity chain.
*/
void

View file

@ -192,7 +192,7 @@ namespace test {
/** @test verify that obsoleted or rejected entries are dropped transparently
/** @test verify extended classification data and information functions at scheduler head
* - add entries providing extra information regarding significance
* - verify that missing the deadline is detected
* - entries past deadline are marked _outdated_ (will be dropped by Layer-2)
@ -233,6 +233,9 @@ namespace test {
CHECK ( sched.isMissed (Time{4,0}));
CHECK ( sched.isDue (Time{4,0}));
sched.activate (ManifestationID{23});
CHECK (not sched.isOutdated (Time{1,0}));
sched.drop (ManifestationID{5});
CHECK (Time(1,0) == sched.headTime());
CHECK ( sched.isOutdated (Time{1,0}));
@ -241,12 +244,9 @@ namespace test {
CHECK (not sched.isMissed (Time{1,0}));
CHECK ( sched.isDue (Time{1,0}));
sched.feedPrioritisation (act, Time{0,0}, Time{2,0}, ManifestationID{5}, true);
CHECK (Time(0,0) == sched.headTime()); // ^^^^ marked as compulsory
sched.feedPrioritisation (act, Time{0,0}, Time{2,0}, ManifestationID{23}, true);
CHECK (Time(0,0) == sched.headTime()); // ^^^^ marked as compulsory
CHECK (not sched.isMissed (Time{1,0}));
CHECK ( sched.isOutdated (Time{1,0})); // marked as outdated since manifestation 5 is not activated
sched.activate (ManifestationID{5});
CHECK (not sched.isOutdated (Time{1,0}));
CHECK (not sched.isOutOfTime(Time{2,0})); // still OK /at/ deadline
CHECK ( sched.isOutOfTime(Time{3,0})); // ↯ past deadline yet marked as compulsory
@ -254,10 +254,13 @@ namespace test {
CHECK ( sched.isMissed (Time{3,0}));
sched.drop (ManifestationID{5});
CHECK ( sched.isOutOfTime(Time{3,0})); // Manifestation-5 is altogether irrelevant for this case
sched.drop (ManifestationID{23});
CHECK (Time(0,0) == sched.headTime());
CHECK ( sched.isOutdated (Time{1,0}));
CHECK (not sched.isOutOfTime(Time{2,0}));
CHECK (not sched.isOutOfTime(Time{3,0})); // the disabled manifestation masks the fatal out-of-time state
CHECK (not sched.isOutOfTime(Time{3,0})); // the disabled manifestation-23 masks the fatal out-of-time state
CHECK ( sched.isOutdated (Time{3,0}));
CHECK ( sched.isMissed (Time{3,0}));

View file

@ -82186,8 +82186,8 @@ Date:&#160;&#160;&#160;Thu Apr 20 18:53:17 2023 +0200<br/>
<icon BUILTIN="button_ok"/>
</node>
<node COLOR="#338800" CREATED="1697808041495" ID="ID_492054934" MODIFIED="1698079204212" TEXT="die Work-Function zusammenstellen">
<linktarget COLOR="#7779a3" DESTINATION="ID_492054934" ENDARROW="Default" ENDINCLINATION="-814;62;" ID="Arrow_ID_817672667" SOURCE="ID_391492289" STARTARROW="None" STARTINCLINATION="1393;-112;"/>
<linktarget COLOR="#2f9552" DESTINATION="ID_492054934" ENDARROW="Default" ENDINCLINATION="-315;-355;" ID="Arrow_ID_1566437327" SOURCE="ID_830267980" STARTARROW="None" STARTINCLINATION="253;14;"/>
<linktarget COLOR="#7779a3" DESTINATION="ID_492054934" ENDARROW="Default" ENDINCLINATION="-814;62;" ID="Arrow_ID_817672667" SOURCE="ID_391492289" STARTARROW="None" STARTINCLINATION="1393;-112;"/>
<icon BUILTIN="button_ok"/>
<node CREATED="1698004010478" ID="ID_1609383346" MODIFIED="1698009701573" TEXT="Schritte">
<icon BUILTIN="list"/>
@ -84219,6 +84219,22 @@ Date:&#160;&#160;&#160;Thu Apr 20 18:53:17 2023 +0200<br/>
</body>
</html></richcontent>
</node>
<node COLOR="#338800" CREATED="1698966410658" ID="ID_1622080924" MODIFIED="1698966432887" TEXT="brauche allow-List in Layer-1">
<icon BUILTIN="button_ok"/>
</node>
<node CREATED="1698966488184" ID="ID_52503620" MODIFIED="1698966526768">
<richcontent TYPE="NODE"><html>
<head>
</head>
<body>
<p>
brauche generische Informationsfunktion <font face="Monospaced" color="#0d0fb9">isOutdated()</font>
</p>
</body>
</html>
</richcontent>
</node>
</node>
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1698533220909" ID="ID_1286321982" MODIFIED="1698533274744" TEXT="Flag und Steuerung f&#xfc;r &#xbb;verbindliche Activities&#xab;">
<linktarget COLOR="#f13e82" DESTINATION="ID_1286321982" ENDARROW="Default" ENDINCLINATION="107;492;" ID="Arrow_ID_1399415601" SOURCE="ID_326051657" STARTARROW="None" STARTINCLINATION="922;-57;"/>
@ -84252,8 +84268,7 @@ Date:&#160;&#160;&#160;Thu Apr 20 18:53:17 2023 +0200<br/>
</li>
</ul>
</body>
</html>
</richcontent>
</html></richcontent>
</node>
<node CREATED="1698946311193" ID="ID_1622617686" MODIFIED="1698947426886" TEXT="leere ManifestationID">
<richcontent TYPE="NOTE"><html>
@ -84265,8 +84280,7 @@ Date:&#160;&#160;&#160;Thu Apr 20 18:53:17 2023 +0200<br/>
diese spezielle Marker-ID wird implizit stets freigeschaltet, kann also sp&#228;ter nicht verworfen werden; das erscheint mir ein sinnvoller Default
</p>
</body>
</html>
</richcontent>
</html></richcontent>
</node>
<node CREATED="1698946321096" ID="ID_1270673617" MODIFIED="1698947474211" TEXT="not isComplusory">
<richcontent TYPE="NOTE"><html>
@ -84278,8 +84292,7 @@ Date:&#160;&#160;&#160;Thu Apr 20 18:53:17 2023 +0200<br/>
verpflichtende Activities sind ebenfalls ein Feature, das eigentlich erst auf Scheduler-Level angesiedelt ist, und hier nur den entsprechenden Support braucht
</p>
</body>
</html>
</richcontent>
</html></richcontent>
</node>
</node>
</node>
@ -84316,12 +84329,30 @@ Date:&#160;&#160;&#160;Thu Apr 20 18:53:17 2023 +0200<br/>
also geh&#246;rt diese Operation in <b>Layer-2</b>
</p>
</body>
</html></richcontent>
<icon BUILTIN="yes"/>
<node CREATED="1698966624581" ID="ID_610935351" MODIFIED="1698966652638">
<richcontent TYPE="NODE"><html>
<head>
</head>
<body>
<p>
damit: direkt in <b><font face="Monospaced" color="#610da9">findWork</font></b><font face="Monospaced" color="#610da9">(now)</font>
</p>
</body>
</html>
</richcontent>
<icon BUILTIN="yes"/>
</node>
</node>
</node>
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1698966669839" ID="ID_1859516972" MODIFIED="1698966684878" TEXT="Layer-2 baut auf den Informationsfunktionen von Layer 1 auf">
<icon BUILTIN="flag-yellow"/>
</node>
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1698966699869" ID="ID_919547647" MODIFIED="1698966742571" TEXT="Layer-2 findet nur die nach allen Regeln ausf&#xfc;hrbare n&#xe4;chste Activity">
<icon BUILTIN="flag-yellow"/>
</node>
</node>
</node>
<node BACKGROUND_COLOR="#eef0c5" COLOR="#990000" CREATED="1698934459104" ID="ID_1030078999" MODIFIED="1698963463139" TEXT="Scheduler Layer-Tests erg&#xe4;nzen">
<arrowlink COLOR="#1990d6" DESTINATION="ID_774197123" ENDARROW="Default" ENDINCLINATION="589;-82;" ID="Arrow_ID_644878733" STARTARROW="None" STARTINCLINATION="-1097;92;"/>
@ -89148,11 +89179,12 @@ Date:&#160;&#160;&#160;Thu Apr 20 18:53:17 2023 +0200<br/>
<icon BUILTIN="button_ok"/>
</node>
</node>
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1698934474047" ID="ID_340948432" MODIFIED="1698963291724" TEXT="verify_Significance">
<node BACKGROUND_COLOR="#eef0c5" COLOR="#990000" CREATED="1698934474047" ID="ID_340948432" MODIFIED="1698966607384" TEXT="verify_Significance">
<linktarget COLOR="#d6194f" DESTINATION="ID_340948432" ENDARROW="Default" ENDINCLINATION="589;-82;" ID="Arrow_ID_1678021866" SOURCE="ID_1030078999" STARTARROW="None" STARTINCLINATION="-1097;92;"/>
<icon BUILTIN="flag-yellow"/>
<icon BUILTIN="pencil"/>
<node CREATED="1698947608180" ID="ID_935784796" MODIFIED="1698947626950" TEXT="Queue-Processing verwirft abgelaufene Tasks"/>
<node CREATED="1698947694025" ID="ID_1869538175" MODIFIED="1698947727576" TEXT="nicht freigeschalte Manifestation wird unterdr&#xfc;ckt"/>
<node CREATED="1698966580969" ID="ID_1199341321" MODIFIED="1698966601172" TEXT="compulsory Activity blockt das automatische Verwerfen"/>
</node>
<node COLOR="#338800" CREATED="1697560546952" FOLDED="true" ID="ID_1326942653" MODIFIED="1697641948262" TEXT="verify_postDispatch">
<icon BUILTIN="button_ok"/>