T1c verb-timeout-console: mesh_call waits the timeout its verb's definition names and says it
The console's surface holds the runner's seat definitions; a seat verb's call waits its `timeout`, and a timeout's text names the bound waited, not a fixed 30s. Builds: design 47 H §760, H-A-43 Claude-Session: https://claude.ai/code/session_01JG73KHUnBze48rdua8u2sy
This commit is contained in:
@@ -8,6 +8,7 @@ import (
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"git.novox.be/novox/mesh-sdk/go/seatdef"
|
||||
"git.novox.be/novox/mesh-sdk/go/stateobjects"
|
||||
"github.com/nats-io/nats.go"
|
||||
"github.com/nats-io/nats.go/jetstream"
|
||||
@@ -74,6 +75,27 @@ func TestARefusalIsSaidOnlyForTheBussOwn(t *testing.T) {
|
||||
// the grammar's example, the handshake's instructions and a timeout's remedy named the controller's verbs.
|
||||
func TestATimeoutIsNotAFailure(t *testing.T) {
|
||||
got := whyItFailed("seat:mesh-delivery.deliveries", errors.New("timeout"))
|
||||
// Design 47 H §760: mesh_call waits the `timeout` the verb's definition names and a timeout says that bound; a verb naming none,
|
||||
// a module's tool and a surface holding no definitions wait and say the runner's own 30s.
|
||||
forty := 40
|
||||
s := &Surface{Definitions: func() map[string]seatdef.Definition {
|
||||
return map[string]seatdef.Definition{"mesh-broker": {Verbs: []seatdef.Verb{{Name: "rates", Timeout: &forty}, {Name: "plain"}}}}
|
||||
}}
|
||||
for _, row := range []struct {
|
||||
t target
|
||||
want string
|
||||
}{
|
||||
{target{Address: "mesh-broker.rates", Seat: true, Tool: Tool{Module: "mesh-broker", Name: "rates"}}, "within 40s"},
|
||||
{target{Address: "mesh-broker.plain", Seat: true, Tool: Tool{Module: "mesh-broker", Name: "plain"}}, "within 30s"},
|
||||
{target{Address: "mesh-broker.rates", Tool: Tool{Module: "mesh-broker", Name: "rates"}}, "within 30s"},
|
||||
} {
|
||||
if said := s.callFailed(row.t, errors.New("timeout")); !strings.Contains(said, row.want) {
|
||||
t.Errorf("%s: a timeout says %q, want it to say %q", row.t.Address, said, row.want)
|
||||
}
|
||||
}
|
||||
if said := (&Surface{}).callFailed(target{Seat: true, Tool: Tool{Module: "mesh-broker", Name: "rates"}}, errors.New("timeout")); !strings.Contains(said, "within 30s") {
|
||||
t.Errorf("a surface that holds no definitions says %q, want 30s", said)
|
||||
}
|
||||
for _, want := range []string{"not a failure", "may already have done"} {
|
||||
if !strings.Contains(got, want) {
|
||||
t.Errorf("a seat's timeout does not say %q: %s", want, got)
|
||||
|
||||
Reference in New Issue
Block a user