AS23: build.ended says a failed end too; a hold under rule 1 says how the build stands
The builder's build.ended is said for a failed build as well (outcome, error whole); the assigner's rule-1 hold reads "the build of M at F failed: <error>" from it and "is being built" while none is heard. The assigner's reads of the builder's builds bucket stay (see the report: a restarted assigner holds no ends heard). Builds: design 47 G §575, §568, A-162 (survey AS23) Claude-Session: https://claude.ai/code/session_01NcbgfGKaxw984XyAPfLm4h
This commit is contained in:
@@ -594,7 +594,7 @@ func TestBuilderMakesADoneKeyWithTheDigests(t *testing.T) { // 1607/AC7
|
||||
t.Errorf("no build.ended of netcheck's build: %v", err)
|
||||
} else {
|
||||
var ev builds.BuildEnded
|
||||
if err := json.Unmarshal(raw.Data, &ev); err != nil || ev.Module != "netcheck" || ev.Fingerprint != fp || len(ev.Made) != 2 {
|
||||
if err := json.Unmarshal(raw.Data, &ev); err != nil || ev.Module != "netcheck" || ev.Fingerprint != fp || ev.Outcome != builds.BuildDone || len(ev.Made) != 2 {
|
||||
t.Errorf("build.ended = %s (%v), want netcheck at its fingerprint with two artifacts' digests", raw.Data, err)
|
||||
}
|
||||
}
|
||||
@@ -656,9 +656,18 @@ func TestBuilderMakesADoneKeyWithTheDigests(t *testing.T) { // 1607/AC7
|
||||
b.fake.hang.Store(&release)
|
||||
third := "src2:" + strings.Repeat("4", 64)
|
||||
b.moduleFP(t, "netcheck", netcheck, "modules/netcheck", bothToolchains, commit, third, 3)
|
||||
if f := b.awaitFP(t, "netcheck", third, isState(builds.BuildFailed)); !strings.Contains(f.Error, "did not end within") {
|
||||
f := b.awaitFP(t, "netcheck", third, isState(builds.BuildFailed))
|
||||
if !strings.Contains(f.Error, "did not end within") {
|
||||
t.Errorf("the failed build = %+v, want its bound run out", f)
|
||||
}
|
||||
// A-162: the failed end is said as build.ended too, with its error whole.
|
||||
if st, err := b.js.Stream(b.ctx, "BUILDER_BUILDS"); err != nil {
|
||||
t.Fatal(err)
|
||||
} else if raw, err := st.GetLastMsgForSubject(b.ctx, "mesh.stream.mesh-delivery-builder.event."+builds.BuildEndedEventName("netcheck", third)); err != nil {
|
||||
t.Errorf("no build.ended of netcheck's failed build: %v", err)
|
||||
} else if ev := (builds.BuildEnded{}); json.Unmarshal(raw.Data, &ev) != nil || ev.Outcome != builds.BuildFailed || ev.Error != f.Error {
|
||||
t.Errorf("build.ended = %s, want the failed outcome with the error %q", raw.Data, f.Error)
|
||||
}
|
||||
failed := meshconditionsclient.Key(meshconditionsclient.ScopeModule, "netcheck", BuildFailed)
|
||||
reg.awaitFinding(t, failed, true)
|
||||
b.fake.hang.Store(nil)
|
||||
|
||||
@@ -161,9 +161,9 @@ func appendLog(ctx context.Context, js jetstream.JetStream, cred process.Account
|
||||
return nil
|
||||
}
|
||||
|
||||
// emitBuildEnded says the builder's event build.ended of a done build, on the builder's own stream (design 47 G §379, A-96):
|
||||
// emitBuildEnded says the builder's event build.ended of a done or failed build (A-162), on the builder's own stream (design 47 G §379, A-96):
|
||||
// mesh.stream.<module>.event.build.ended.<module>.<fingerprint>, published where the log entry of the end is written. An
|
||||
// entry that is not a done build's end says none. The id makes a repeated end one event.
|
||||
// entry that is not a done or failed build's end says none. The id makes a repeated end one event.
|
||||
func emitBuildEnded(ctx context.Context, js jetstream.JetStream, cred process.Account, e builds.BuildLogEntry) error {
|
||||
body, ok := builds.BuildEndedOf(e)
|
||||
if !ok {
|
||||
|
||||
Reference in New Issue
Block a user