Say the rotation test's whole trace on its failure's first line, and each judgement in it; an unreadable last declaration is cannot-judge (issue 1945)

The verdict keeps only a failure's first line (issue 1921), so the trace that names the cause rode on lines it dropped.
This commit is contained in:
2026-10-24 21:41:14 +02:00
parent 9372733861
commit 53d9c4de19
3 changed files with 14 additions and 3 deletions
+5 -1
View File
@@ -50,7 +50,11 @@ func judgeMove(ctx context.Context, at composedPlace, key string, to sdkdelivery
if found && have.Composed == "" && have.FP != "" && have.Phase != sdkdelivery.PhaseRemoved && at.lastApplied != nil {
slice, declared, applied, err := at.lastApplied(ctx, to.Module)
if err != nil {
return out, err
// Unread is not judged: a person's yes holds it, and the words say why.
out.Judgement = sdkdelivery.JudgedCannot
out.Words = fmt.Sprintf("%s's have on %s names no composition, and the declaration it last applied cannot be read: %v",
to.Module, at.node, err)
return out, nil
}
if applied {
from := sdkdelivery.Composed{Node: at.node, Module: to.Module, FP: have.FP, Data: to.Data, Resources: slice}
@@ -508,8 +508,11 @@ func TestServedARotationRewritesOnlyTheCompositionsThatUseIt(t *testing.T) {
}
}
diag := fmt.Sprintf("state %+v %v; compose now %v sealed %v; %s %v", state, serr, derr, sealed, credentials, ierr)
t.Fatalf("the board's composition did not move within a minute after the rotation; TRACE\n %s\nLINES %s; holders before %+v, after %+v; DIAG %s; %s",
traced(), strings.Join(strings.Fields(said), " "), holders, after, diag, m.whatIsThere(t, "laptop"))
// One line: the verdict keeps only a failure's first line (issue 1921).
t.Fatalf("the board's composition did not move within a minute after the rotation (revision before %d); TRACE %s; LINES %s; "+
"holders before %+v, after %+v; DIAG %s; %s", before["laptop"][boardKey],
strings.Join(strings.Fields(strings.ReplaceAll(traced(), "\n", " | ")), " "), strings.Join(strings.Fields(said), " "),
holders, after, diag, strings.Join(strings.Fields(m.whatIsThere(t, "laptop")), " "))
}
moved := map[string]bool{}
for node, was := range before {
+4
View File
@@ -202,6 +202,10 @@ func writeComposed(ctx context.Context, at composedPlace, key string, c sdkdeliv
wrote = true
}
judged, err := judgeMove(ctx, at, key, c, digest)
if composeTrace != nil {
composeTrace(fmt.Sprintf("%s: %s: written %v, judged %s %q user-list-only %v against %.19s, err %v", at.node, key, wrote,
judged.Judgement, judged.Words, judged.UserListOnly, judged.Against, err))
}
if err != nil {
return wrote, err
}