mesh-delivery: rebase only a first phase that starts at the walk's merge; a class without a budget is said unknown
mesh/merge-gate fail: builds mesh-delivery → novox; no bus step; a manifest the change touches fails the module check: mesh-delivery claims mesh-delivery a…
mesh/repo-check fail: its merge-check.sh failed: files asking for a setting without saying whether it is trusted: 25
mesh/delivery superseded: a newer head of the same pull request

This commit is contained in:
jochen
2026-10-10 20:16:46 +02:00
parent 404efb764b
commit 383e698254
2 changed files with 21 additions and 1 deletions
@@ -98,7 +98,7 @@ func timeOf(d *Delivery, w Walk) *DeliveryTime {
if ph.End == nil {
continue
}
if ph.State == phaseMeasured {
if ph.State == phaseMeasured && ph.Start != nil && ph.Start.Equal(*p.From) {
start := from
ph.Start = &start
ph.TookMS = ph.End.Sub(from).Milliseconds()
@@ -140,6 +140,9 @@ func longestOf(phases []WalkPhase) string {
// timeWalk keeps, on every delivery the walk answers, its delivery time once the walk's end is known; a delivery
// whose time did not change is not written again (issue 326).
func (h *Holder) timeWalk(w Walk) {
if s, ok := h.walks[w.ID]; ok && s.walk.Revision > w.Revision {
w = s.walk // an older record arriving late: the newest says the time
}
if w.Phases == nil || w.Phases.End == nil {
return
}
@@ -247,6 +250,10 @@ func (h *Holder) times(days int) TimesAnswer {
if d.Time.End.Before(since) {
continue
}
if _, ok := budgets[d.Time.Class]; !ok {
a.Unknown = append(a.Unknown, fmt.Sprintf("%s: took %s, its class %q has no budget", d.ID, d.Time.Took, d.Time.Class))
continue
}
took[d.Time.Class] = append(took[d.Time.Class], d)
}
sort.Strings(a.Unknown)
@@ -83,6 +83,19 @@ func TestADeliveryKeepsItsTimeFromItsOwnMerge(t *testing.T) {
if d.Time.Phases[0].TookMS != 80000 || !strings.HasPrefix(d.Time.Longest, "judgement") {
t.Fatalf("its window starts at its own merge (80s), longest judgement: %+v %s", d.Time.Phases[0], d.Time.Longest)
}
// Its own merge after a first phase whose start is unknown: the unknown time moves, the sum holds.
p := phasesOf("leaf", from, ph{"window", 90 * time.Second}, ph{"build", 30 * time.Second})
p.Phases[0] = WalkPhase{Name: "window", Tier: -1, State: phaseUnknown, End: p.Phases[0].End}
p.UnknownMS = 90000
dt := timeOf(&Delivery{MergedAt: from.Add(10 * time.Second)}, Walk{ID: "w", Phases: p})
if dt.UnknownMS != 80000 || dt.TookMS != 110000 {
t.Fatalf("unknown first phase: %+v", dt)
}
// Exactly its budget is within it.
p = phasesOf("leaf", from, ph{"build", 5*time.Minute + 10*time.Second})
if dt := timeOf(&Delivery{MergedAt: from.Add(10 * time.Second)}, Walk{ID: "w", Phases: p}); dt.Over || dt.TookMS != 300000 {
t.Fatalf("five minutes is within a leaf's budget: %+v", dt)
}
// Seen again, unchanged: not written again (issue 326).
before := w.store.puts
w.h.Reconcile()