Commit Graph

9 Commits

Author SHA1 Message Date
Joseph Doherty
163667bbe2 feat: add JetStream cluster consumer replication tests (Go parity)
Add 60 tests in JsClusterConsumerReplicationTests covering consumer
creation, fetch/delivery, ack tracking, leader failover, state
consistency, and edge cases. Ported from Go jetstream_cluster_2_test.go.
2026-02-24 08:39:32 -05:00
Joseph Doherty
3862f009ba feat: add JetStream cluster meta-cluster governance tests (Go parity) 2026-02-24 07:54:00 -05:00
Joseph Doherty
c33e5e3009 feat: add JetStream cluster advanced and long-running tests (Go parity)
Adds two new test files covering Task 10 of the full Go parity plan:

JsClusterAdvancedTests.cs (27 tests):
- Large 7-node cluster with R5 stream
- Stream with 20+ subjects and wildcard '>' subject
- 1000-message publish to R3 and R1 streams
- Stream state accuracy after 1000 messages
- 10 streams with mixed replica counts
- Create/publish/delete/recreate cycle (3x)
- Consumer on 1000-message stream with batch fetch
- AckAll for all 1000 messages
- Stream info consistency after 50 interleaved ops
- Meta state after creating and deleting 10 streams
- 5 independent consumers with correct pending counts
- Consumer with wildcard filter subject
- Stream update adding subjects after publishes
- Stream purge then republish
- Fetch empty after purge
- Stream delete cascades consumer removal
- Node removal preserves data reads
- Node restart lifecycle markers
- Leader stepdown with monotonic sequence verification
- Stream info after stepdown with 1000 messages

JsClusterLongRunningTests.cs (15 tests, [Trait("Category", "LongRunning")]):
- 5000 messages in R3 stream maintain consistency
- 100 sequential fetches of 50 messages each
- 50 consumers on same stream all see all messages
- 20 streams in 5-node cluster all independent
- Publish-ack-fetch cycle 100 times
- 10 stepdowns during continuous publishing
- Alternating publish and stepdown (20 iterations)
- Create-publish-delete 20 streams sequentially
- Consumer ack tracking after 10 leader failovers
- Fetch with batch=1 iterated 500 times
- Mixed operations across 5 streams
- Rapid meta stepdowns (20) with version verification
- 10000 small messages in R1 stream
- Stream with max_messages=100 enforces limit after 1000 publishes
- Consumer on max-messages stream tracks correct pending

All 42 tests pass (27 advanced + 15 long-running).
2026-02-24 07:53:50 -05:00
Joseph Doherty
5a22fd3213 feat: add JetStream cluster stream replication and placement tests (Go parity)
Adds 97 tests across two new files covering stream replication semantics
(R1/R3 creation, replica group size, publish preservation, state accuracy,
purge, update, delete, max limits, subjects, wildcards, storage type) and
placement semantics (replica caps at cluster size, various cluster sizes,
concurrent creation, stepdown resilience, long names, re-create after delete).
2026-02-24 07:53:28 -05:00
Joseph Doherty
4fa0be2281 feat: add JetStreamClusterFixture for multi-node cluster tests (Go parity)
Adds a unified JetStreamClusterFixture consolidating the capabilities of all 7
per-suite fixtures (ClusterFormationFixture, ClusterStreamFixture, LeaderFailoverFixture, etc.)
into a single reusable helper for Tasks 6-10. Includes new Go-parity helpers
(WaitOnStreamLeaderAsync, WaitOnConsumerLeaderAsync, GetConsumerLeaderId,
StepDownMetaLeader, SimulateNodeRestart, RemoveNode) matching jetstream_helpers_test.go.
27 smoke tests verify all capabilities pass.
2026-02-24 07:36:32 -05:00
Joseph Doherty
3ff801865a feat: Waves 3-5 — FileStore, RAFT, JetStream clustering, and concurrency tests
Add comprehensive Go-parity test coverage across 3 subsystems:
- FileStore: basic CRUD, limits, purge, recovery, subjects, encryption,
  compression, MemStore (161 tests, 24 skipped for not-yet-implemented)
- RAFT: core types, wire format, election, log replication, snapshots
  (95 tests)
- JetStream Clustering: meta controller, stream/consumer replica groups,
  concurrency stress tests (90 tests)

Total: ~346 new test annotations across 17 files (+7,557 lines)
Full suite: 2,606 passing, 0 failures, 27 skipped
2026-02-23 22:55:41 -05:00
Joseph Doherty
f1353868af feat: Wave 6 batch 2 — accounts/auth, gateways, routes, JetStream API, JetStream cluster tests
Add comprehensive Go-parity test coverage across 5 subsystems:
- Accounts/Auth: isolation, import/export, auth mechanisms, permissions (82 tests)
- Gateways: connection, forwarding, interest mode, config (106 tests)
- Routes: connection, subscription, forwarding, config validation (78 tests)
- JetStream API: stream/consumer CRUD, pub/sub, features, admin (234 tests)
- JetStream Cluster: streams, consumers, failover, meta (108 tests)

Total: ~608 new test annotations across 22 files (+13,844 lines)
All tests pass individually; suite total: 2,283 passing, 3 skipped
2026-02-23 22:35:06 -05:00
Joseph Doherty
921554f410 feat: define StreamStore/ConsumerStore interfaces from Go store.go
Port IStreamStore, IConsumerStore, StoreMsg, StreamState, SimpleState,
ConsumerState, FileStoreConfig, StoreCipher, StoreCompression types.
Rename Models.StreamState → ApiStreamState to avoid namespace conflict.
2026-02-23 21:06:16 -05:00
Joseph Doherty
61b1a00800 feat: phase C jetstream depth test parity — 34 new tests across 7 subsystems
Stream lifecycle, publish/ack, consumer delivery, retention policy,
API endpoints, cluster formation, and leader failover tests ported
from Go nats-server reference. 1006 total tests passing.
2026-02-23 19:55:31 -05:00