CultLib/tests/GameCult.Networking.Tests
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Meta Vens ce63ff88dc C#: a handler's fault ends the session without blaming the peer
The schema server's backstop ended every session with "session refused
a packet", including when the fault was the server's own: for example a
handler's response too large to send, or a refusal the handler did not
type. Decoding and handling are now two catches:
- A message that cannot be decoded is the peer's. The session ends with
  the refusal reason.
- A handler fault ends the session with "server could not handle a
  message".
The transport's EndRefusedPeer becomes EndPeerSession(peer, reason). It
reports whether it ended the session, so the log says when a response
that failed after its first fragment had already ended it over the send.
Before, the log reported that it ended a session that was already gone.

The comment said that ending the session matched cultmesh-py. It does
not: Python silently skips a malformed frame. The honest anchor is the
C# TCP schema server, whose ServePeerAsync ends the one peer whose
message fails to decode or handle. The comment now says so.

Pinned, each by a test that kills its mutant:
- a handler fault's goodbye carries the server's reason, not the refusal
  (mutant: the refusal reason);
- the post-fragment-0 path logs that the session had already ended
  (mutant: a constant outcome);
- EndPeerSession says no goodbye to a replaced peer's endpoint (mutant:
  the Ended check dropped);
- a refused peer's frames still queued are never handled (mutant: the
  queue purge dropped).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-30 20:19:29 +02:00
..
CultCachePublicationIsolationTests.cs Narrow the escaped-observer probe to what this base can show 2026-09-29 16:57:04 +02:00
CultNetCanonicalNumberTests.cs CultNet selection cut1 fix batch: R-I/K/D tests and R-A/R-M reflection fix 2026-09-22 09:39:36 +02:00
CultNetDocumentBindingResolverTests.cs Make generated and reflective document members one rule 2026-09-13 22:00:16 +02:00
CultNetDocumentRegistryVariantTests.cs CultNet: a withdrawn hop subscription is refused with a typed error and its rows are withdrawn 2026-09-29 10:12:20 +02:00
CultNetJournalTests.cs Dispose test: hold the writer in an earlier observer so Dispose must publish what it logged 2026-09-30 07:03:15 +02:00
CultNetOperationServerTests.cs Bind CultMesh authority identity to physical routes 2026-08-18 17:21:58 +02:00
CultNetPublicationOrderTests.cs Networking tests: order is data, so pin each change's own publication, not its delivery order 2026-09-29 23:52:14 +02:00
CultNetPublishesCommitsTests.cs Pin the single-owner publication cases Soul falsified 2026-09-29 13:21:39 +02:00
CultNetRudpConnectGenerationTests.cs Ack Cut 1d batch 2 (C#): an Ack does not retire a Connect awaiting its Accept; the fresh attempt jumps by the receive window less one 2026-09-30 09:53:06 +02:00
CultNetRudpOrderedDeliveryTests.cs Ack Cut 1 tests: three held frames, the Rust byte bound, reset reseeds 2026-09-30 00:20:04 +02:00
CultNetRudpSchemaServerPeerInputTests.cs C#: a handler's fault ends the session without blaming the peer 2026-09-30 20:19:29 +02:00
CultNetRudpSendFailureTests.cs C#: a handler's fault ends the session without blaming the peer 2026-09-30 20:19:29 +02:00
CultNetRudpSessionEndingTests.cs Ack Cut 1b tests: an ending does not forget what the peer sent 2026-09-30 00:24:19 +02:00
CultNetSchemaContractTests.cs Cut 4 Soul 4c: committed-unlogged wire writes, database serves only what it owns, typed unowned refusal 2026-09-30 06:14:49 +02:00
CultNetSchemaServerGroupTests.cs Share CultNet handlers across transports 2026-08-18 01:31:04 +02:00
CultNetSelectionEvaluatorTests.cs Land fix batch 3's R-O and R-Q: keyed length-prefixed cursors, replica-apply sequence gap 2026-09-22 20:04:22 +02:00
CultNetSelectionFixBatchTests.cs C#: a peer's undecodable message ends that peer's session, never the poll 2026-09-30 17:23:40 +02:00
CultNetSelectionPageTests.cs CultNet selection cut1 fix batch: R-I/K/D tests and R-A/R-M reflection fix 2026-09-22 09:39:36 +02:00
CultNetSelectionSurvivorTests.cs Correct one comment still naming the deleted To.SchemaId tiebreak 2026-09-23 09:21:52 +02:00
GameCult.Networking.Tests.csproj Add GameCult Mesh package home 2026-05-19 19:08:48 +01:00
MiniJsonSchemaValidator.cs Fix batch 4 (R-X, S-4/S-10): the error schema matches the wire, and the validator refuses a keyword it does not implement 2026-09-22 21:12:23 +02:00
NetworkingTests.cs Ack Cut 3: a server's new generation does not inherit acknowledged bytes 2026-09-30 14:46:38 +02:00
README.md JSON backing store, I/O fixes, Networking Security 2026-04-18 13:01:24 +01:00
SelectionParityVectorTests.cs R-AO: shared vector for two-in-target shared-key resolution 2026-09-23 07:18:11 +02:00
SelectionWireParityTests.cs R-AZ: mirror the all-absent Edge vector into the C# parity test 2026-09-23 09:08:42 +02:00
SoulP4cProbeTests.cs Cut 4 Soul 4d: a skipped entry is relayed as the primary sent it; probes, wire cases and the closed-enum rule committed 2026-09-30 08:03:09 +02:00
SoulP4dProbeTests.cs Cut 4 Soul 4d: a skipped entry is relayed as the primary sent it; probes, wire cases and the closed-enum rule committed 2026-09-30 08:03:09 +02:00
SoulP4ProbeTests.cs Journal fixes: hole floor on restart, one log exception per call, no shape guard, no stray shard-0 logging 2026-09-30 02:48:49 +02:00
SoulPub3Tests.cs Soul probes: commit the pass-3 P-tests and the Cut 4 probes as recovered 2026-09-30 02:38:50 +02:00

GameCult.Networking.Tests

GameCult.Networking.Tests contains NUnit tests for the networking library.

Scope

The tests currently cover:

  • AES-GCM encrypt/decrypt round-trips in Secret
  • signed session-token validation
  • signed session-token tamper detection
  • signed session-token expiry handling

Run

dotnet test tests\GameCult.Networking.Tests\GameCult.Networking.Tests.csproj

Adding New Tests

Typical future areas to expand include:

  • client reconnect and verify flows
  • login and registration integration tests
  • malformed message handling
  • rate-limiting behavior under concurrency