Hold the plans schema's longest bound to the value, and say what a slow store gives (review 75)
mesh/delivery ready: it delivers once merged
mesh/repo-check waiting in the build queue since 18:51: asked by the merge tool against trunk f8daec01d3f0
mesh/merge-gate building on novox since 18:51

This commit is contained in:
jochen
2026-10-12 16:50:59 +02:00
parent d20b52cb19
commit 5ad36127ee
2 changed files with 17 additions and 0 deletions
+2
View File
@@ -26,6 +26,8 @@ import (
var maxPlanWait = link.LongestAnswer - planWaitStart
// planWaitStart is what the verb's window allows beyond the bound: starting the command and opening the stores.
// A store slow enough to push the read and the answer past it degrades as any long call does: the caller is
// answered that the call is still running, and `calls` with its id says what came of it.
const planWaitStart = 5 * time.Second
// planWaitEvery is how often a wait reads the plan again.
+15
View File
@@ -179,3 +179,18 @@ func TestAPlanFollowedFromTheStoreAnswersWhenItMoves(t *testing.T) {
t.Fatalf("a plan that did not move answered %+v (%v)", got, err)
}
}
// The verb's schema says the longest bound in words, and the words are the value (review 75 on #266): the
// catalogue cannot read maxPlanWait, so this holds them together.
func TestThePlansSchemaSaysTheLongestBoundThereIs(t *testing.T) {
v, ok := controllerVerb("plans")
if !ok {
t.Fatal("no plans verb")
}
props, _ := v.Input["properties"].(map[string]any)
bound, _ := props["bound"].(map[string]any)
said, _ := bound["description"].(string)
if !strings.Contains(said, maxPlanWait.String()+", the default, is the longest") {
t.Fatalf("the schema says %q; the longest bound is %s", said, maxPlanWait)
}
}