node-tools: a stopping tool runner answers the typed fault stopping (H-A-542)
A call the runner does not take once its stop began was answered nothing, so its caller's wait ended in a bare "timeout" and a build step's publish failed (main.440). It is now answered with error-kind stopping beside its words, on a tool's reply and a seat proof's alike; the calling runner keeps that kind and hands it to its bundle as the JSON-RPC error's data, so mesh-sdk's stdio tells it by its kind. A call cut at the drain bound stays unanswered (H-A-369). Builds: design 47 H2 H-A-542 (amends H-A-369)
This commit is contained in:
@@ -5,6 +5,7 @@ package main
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
@@ -237,7 +238,8 @@ func TestTheToolRunnerStartedByItsEntryServesABundleOverTheSeatListItReads(t *te
|
||||
}
|
||||
|
||||
// at its stop the runner drains (design 47 H2 §813 (12), H-A-353; the bound 2 s here for the setting's 30 s): a call of 1 s in
|
||||
// flight is answered, one of 6 s is cut at the bound, said, and its caller answered nothing; a call after the stop is answered nothing
|
||||
// flight is answered, one of 6 s is cut at the bound, said, and its caller answered nothing; a call after the stop is answered
|
||||
// the typed fault stopping (H-A-542)
|
||||
type answer struct {
|
||||
got string
|
||||
err error
|
||||
@@ -259,12 +261,13 @@ func TestTheToolRunnerStartedByItsEntryServesABundleOverTheSeatListItReads(t *te
|
||||
return nil
|
||||
})
|
||||
stop()
|
||||
// a call after the stop began is answered nothing, never refused, so the caller's kept call paces and meets the new runner
|
||||
// (H-A-369): until the drain began it is still answered
|
||||
// a call after the stop began is answered the typed fault stopping, never silence, so its caller asks again after a pause and
|
||||
// meets the new runner (H-A-369 as H-A-542 amends it): until the drain began it is still answered
|
||||
mt.Until(t, func() error {
|
||||
answered, err := asker.AskWithin("ledger.who", map[string]any{}, "", 500*time.Millisecond)
|
||||
if err == nil || err.Error() != "timeout" {
|
||||
return fmt.Errorf("a call after the stop was answered %s, %v; want no answer", answered.Result, err)
|
||||
var kinded interface{ ErrorKind() string }
|
||||
if !errors.As(err, &kinded) || kinded.ErrorKind() != "stopping" {
|
||||
return fmt.Errorf("a call after the stop was answered %s, %v; want the typed fault stopping", answered.Result, err)
|
||||
}
|
||||
return nil
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user