T1: the seat settle applies a delayed nak with the bus's own delay (ADR 0664 §1, issue 1748)
Claude-Session: https://claude.ai/code/session_01JG73KEq4zoDfM9WtYpcQgZ
This commit is contained in:
@@ -202,6 +202,17 @@ func TestABundlePullsAndSettlesThroughItsModulesBus(t *testing.T) {
|
||||
if _, err := elsewhere.Seat("settle", json.RawMessage(`{"id":"`+p.ID+`","fate":"ack"}`), nil); err == nil {
|
||||
t.Fatal("another module settled the pulled ask")
|
||||
}
|
||||
// Issue 1748: a settle with the fate nak-after and no delay settles nothing; with a delay the ask comes again.
|
||||
if _, err := building.Seat("settle", json.RawMessage(`{"id":"`+p.ID+`","fate":"nak-after"}`), nil); err == nil {
|
||||
t.Fatal("a delayed nak without a delay was accepted")
|
||||
}
|
||||
if _, err := building.Seat("settle", json.RawMessage(`{"id":"`+p.ID+`","fate":"nak-after","delay_ms":100}`), nil); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
raw, err = building.Seat("pull", json.RawMessage(`{"worker":"SEAT_NODE_BUILD_GO_DELIVERY_worker","wait_ms":2000}`), nil)
|
||||
if err != nil || json.Unmarshal(raw, &p) != nil || p.Delivered != 2 {
|
||||
t.Fatalf("the ask given again after its delay = %s, %v", raw, err)
|
||||
}
|
||||
if _, err := building.Seat("settle", json.RawMessage(`{"id":"`+p.ID+`","fate":"ack"}`), nil); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user