cultmesh-ts: sendOnly tests use one fake server per publish (the reused one threw on the second connect and hung the run); spec names send-only and the presence publisher
Some checks failed
CultMesh QUIC native / Build win32-x64 (pull_request) Has been skipped
CultMesh QUIC native / Build linux-x64 (pull_request) Has been skipped
CultMesh QUIC native / Release native binaries (pull_request) Has been skipped
CultMesh QUIC native / Verify committed binaries match SHA256SUMS (pull_request) Has been cancelled
CultMesh portability and performance / ubuntu-latest reactive semantics and leases (pull_request) Has been cancelled
Some checks failed
CultMesh QUIC native / Build win32-x64 (pull_request) Has been skipped
CultMesh QUIC native / Build linux-x64 (pull_request) Has been skipped
CultMesh QUIC native / Release native binaries (pull_request) Has been skipped
CultMesh QUIC native / Verify committed binaries match SHA256SUMS (pull_request) Has been cancelled
CultMesh portability and performance / ubuntu-latest reactive semantics and leases (pull_request) Has been cancelled
The hang was the fake server, not the writer: it is bound to one connection id, and two publishes in one test sent a second connect it rejected from inside the socket handler. The unacknowledged-send test also scripted an admit, whose reply piggybacks the put's ack. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
0caef4d564
commit
206dbe142b
2 changed files with 15 additions and 9 deletions
|
|
@ -61,7 +61,7 @@ A write settles as exactly one of:
|
|||
|
||||
## Changes to what #55 to #58 shipped
|
||||
|
||||
Those clients complete *successfully* when the window ends with no refusal. Under this spec that case is `unconfirmed`. The TypeScript one-shot writer (#62) already reports it so; the C# and Rust clients of #55 to #58 keep the window-success until their conformance work lands, and callers of those must not read it as admission.
|
||||
Those clients complete *successfully* when the window ends with no refusal. Under this spec that case is `unconfirmed`. The TypeScript one-shot writer (#62) already reports it so: it resolves `admitted` only on a `write_admitted` carrying the put's id, and no other frame, a put echoed under the same id included, ever counts as admission. A caller whose server cannot answer a write yet (Odin, until it is receipt-capable) opts into the explicit send-only mode per call (`sendOnly: true`), which resolves the distinct outcome `sent` once the transport has acknowledged the put and never `admitted`; the Idunn presence publisher uses it. Receipts and send-only are both opt-in, neither is the default. The C# and Rust clients of #55 to #58 keep the window-success until their conformance work lands, and callers of those must not read it as admission.
|
||||
|
||||
## Vectors
|
||||
|
||||
|
|
|
|||
|
|
@ -176,14 +176,17 @@ test("a server that does not advertise receipts and echoes the put's id back has
|
|||
});
|
||||
|
||||
test("a silent server never yields admitted, in either mode: the default is unconfirmed, sendOnly is the distinct outcome sent", async () => {
|
||||
const server = await fakeServer(nextConnection, { advertise: false, answer: "silence" });
|
||||
const dflt = await fakeServer(nextConnection, { advertise: false, answer: "silence" });
|
||||
try {
|
||||
await assert.rejects(publish(server, { resultWindowMs: 200 }), CultMeshRudpWriteUnconfirmedError);
|
||||
const outcome = await publish(server, { sendOnly: true });
|
||||
await assert.rejects(publish(dflt, { resultWindowMs: 200 }), CultMeshRudpWriteUnconfirmedError);
|
||||
} finally { dflt.close(); }
|
||||
const sendOnly = await fakeServer(nextConnection, { advertise: false, answer: "silence" });
|
||||
try {
|
||||
const outcome = await publish(sendOnly, { sendOnly: true });
|
||||
assert.equal(outcome, "sent");
|
||||
assert.notEqual(outcome, "admitted");
|
||||
assert.deepEqual(server.seen, ["cultnet.document_put_raw.v0", "cultnet.document_put_raw.v0"], "sendOnly sends no hello");
|
||||
} finally { server.close(); }
|
||||
assert.deepEqual(sendOnly.seen, ["cultnet.document_put_raw.v0"], "sendOnly sends no hello");
|
||||
} finally { sendOnly.close(); }
|
||||
});
|
||||
|
||||
test("only a write_admitted resolves admitted, and sendOnly does not wait for or act on an answer", async () => {
|
||||
|
|
@ -197,15 +200,18 @@ test("only a write_admitted resolves admitted, and sendOnly does not wait for or
|
|||
} finally { refusing.close(); }
|
||||
});
|
||||
|
||||
test("sendOnly fails local_send_failed when the send is never acknowledged, and cannot be combined with writeReceipts", async () => {
|
||||
const server = await fakeServer(nextConnection, { advertise: true, answer: "admit", ack: false });
|
||||
test("sendOnly fails local_send_failed when the send is never acknowledged", async () => {
|
||||
const server = await fakeServer(nextConnection, { advertise: true, answer: "silence", ack: false });
|
||||
try {
|
||||
await assert.rejects(publish(server, { sendOnly: true, flushTimeoutMs: 300 }), (error: unknown) =>
|
||||
error instanceof CultMeshRudpWriteUnconfirmedError && error.reason === "local_send_failed");
|
||||
await assert.rejects(publish(server, { sendOnly: true, writeReceipts: true }), TypeError);
|
||||
} finally { server.close(); }
|
||||
});
|
||||
|
||||
test("sendOnly cannot be combined with writeReceipts", async () => {
|
||||
await assert.rejects(publish({ endpoint: "rudp://127.0.0.1:9" }, { sendOnly: true, writeReceipts: true }), TypeError);
|
||||
});
|
||||
|
||||
test("without writeReceipts no hello is sent and the receipt frames are never asked for", async () => {
|
||||
const server = await fakeServer(nextConnection, { advertise: true, answer: "silence" });
|
||||
try {
|
||||
|
|
|
|||
Loading…
Reference in a new issue