G sessions: the runner serves a bundle's put and get sessions and states put-sessions
A value over buscalls.ChunkBytes is put by mesh/objects.put-chunk (written into the module's store as each chunk is taken, sealed on the last, dropped at its bound or a disorder) and got by mesh/objects.get-chunk after a chunked answer, for a state's object and a sent object alike; the 8 MiB BundleObjectMost cap is gone with the stateobjects constant. Builds: design 47 G §518, §345, §457, §490, §620, §622, A-21, A-25 Claude-Session: https://claude.ai/code/session_01NcbgfGKaxw984XyAPfLm4h
This commit is contained in:
@@ -3,6 +3,7 @@ package bus_test
|
||||
import (
|
||||
"context"
|
||||
"errors"
|
||||
"io"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
@@ -70,6 +71,23 @@ func TestABundleReachesItsOwnBoundObjectsAndStreamsOnly(t *testing.T) {
|
||||
if err != nil || got == nil || string(got.Data) != "what was put" || got.Info.Name != "a" {
|
||||
t.Fatalf("read back %+v, %v", got, err)
|
||||
}
|
||||
// Design 47 G §518: a value over one chunk is streamed into the store and read back out of it, its description kept.
|
||||
big := strings.Repeat("0123456789", 120<<10)
|
||||
info, err := conn.ObjectsPutStream(ctx, "m", buscalls.ObjectsNameRequest{Objects: "files", Name: "big"}, "streamed", strings.NewReader(big))
|
||||
if err != nil || info.Size != uint64(len(big)) || info.Description != "streamed" {
|
||||
t.Fatalf("streamed put %+v, %v", info, err)
|
||||
}
|
||||
opened, rd, found, err := conn.ObjectsOpen(ctx, "m", buscalls.ObjectsNameRequest{Objects: "files", Name: "big"})
|
||||
if err != nil || !found || opened.Size != uint64(len(big)) {
|
||||
t.Fatalf("opened %+v %v %v", opened, found, err)
|
||||
}
|
||||
if back, _ := io.ReadAll(rd); string(back) != big {
|
||||
t.Fatalf("read back %d bytes, want %d", len(back), len(big))
|
||||
}
|
||||
_ = rd.Close()
|
||||
if err := conn.ObjectsDelete("m", buscalls.ObjectsNameRequest{Objects: "files", Name: "big"}); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if listed, err := conn.ObjectsList("m", buscalls.ObjectsRequest{Objects: "files"}); err != nil || len(listed.Objects) != 1 {
|
||||
t.Fatalf("listed %+v, %v", listed, err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user