# unit_tests

name: TestGenericSublistHasInterestStartingInRace
go_file: server/gsl/gsl_test.go
go_method: TestGenericSublistHasInterestStartingInRace
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
TestGenericSublistHasInterestStartingInRace tests that HasInterestStartingIn
is safe to call concurrently with modifications to the sublist.


name: TestNewAccountAndRequireNewAlwaysError
go_file: server/accounts_test.go
go_method: TestNewAccountAndRequireNewAlwaysError
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
Clients used to be able to ask that the account be forced to be new.
This was for dynamic sandboxes for demo environments but was never really used.
Make sure it always errors if set.


name: TestMultipleStreamImportsWithSameSubject
go_file: server/accounts_test.go
go_method: TestMultipleStreamImportsWithSameSubject
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
This should work with prefixes that are different but we also want it to just work with same subject
being imported from multiple accounts.


name: TestAccountImportDuplicateResponseDeliveryWithLeafnodes
go_file: server/accounts_test.go
go_method: TestAccountImportDuplicateResponseDeliveryWithLeafnodes
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
Test for a bug that would cause duplicate deliveries in certain situations when
service export/imports and leafnodes involved.
https://github.com/nats-io/nats-server/issues/3191


name: TestLeafTLSWindowsCertStore
go_file: server/certstore_windows_test.go
go_method: TestLeafTLSWindowsCertStore
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
TestLeafTLSWindowsCertStore tests the topology of two NATS Servers connected as leaf and hub with authentication of
leaf to hub via mTLS with leaf's certificate and signing key provisioned in the Windows certificate store.


name: TestServerTLSWindowsCertStore
go_file: server/certstore_windows_test.go
go_method: TestServerTLSWindowsCertStore
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
TestServerTLSWindowsCertStore tests the topology of a NATS server requiring TLS and gettings it own server
cert identity (as used when accepting NATS client connections and negotiating TLS) from Windows certificate store.


name: TestServerIgnoreExpiredCerts
go_file: server/certstore_windows_test.go
go_method: TestServerIgnoreExpiredCerts
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
TestServerIgnoreExpiredCerts tests if the server skips expired certificates in configuration, and finds non-expired ones


name: TestClientHeaderSupport
go_file: server/client_test.go
go_method: TestClientHeaderSupport
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
This test specifically is not testing how headers are encoded in a raw msg.
It wants to make sure the serve and clients agreement on when to use headers
is bi-directional and functions properly.


name: TestClientOutboundQueueCoalesce
go_file: server/client_test.go
go_method: TestClientOutboundQueueCoalesce
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
This test ensures that coalescing into the fixed-size output
queues works as expected. When bytes are queued up, they should
not overflow a buffer until the capacity is exceeded, at which
point a new buffer should be added.


name: TestFileStoreStoreLimitRemovePerf
go_file: server/filestore_test.go
go_method: TestFileStoreStoreLimitRemovePerf
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
This test is testing an upper level stream with a message or byte limit.
Even though this is 1, any limit would trigger same behavior once the limit was reached
and we were adding and removing.


name: TestFileStoreStreamDeleteDirNotEmpty
go_file: server/filestore_test.go
go_method: TestFileStoreStreamDeleteDirNotEmpty
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
We have reports that sometimes under load a stream could complain about a storage directory
not being empty.


name: TestFileStoreBadConsumerState
go_file: server/filestore_test.go
go_method: TestFileStoreBadConsumerState
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
We had a case where a consumer state had a redelivered record that had seq of 0.
This was causing the server to panic.


name: TestFileStorePurgeExKeepOneBug
go_file: server/filestore_test.go
go_method: TestFileStorePurgeExKeepOneBug
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
When messages span multiple blocks and we want to purge but keep some amount, say 1, we would remove all.
This is because we would not break out of iterator across more message blocks.
Issue #2622


name: TestFileStoreCompactReclaimHeadSpace
go_file: server/filestore_test.go
go_method: TestFileStoreCompactReclaimHeadSpace
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
For things like raft log when we compact and have a message block that could reclaim > 50% of space for block we want to do that.
https://github.com/nats-io/nats-server/issues/2936


name: TestFileStoreShortIndexWriteBug
go_file: server/filestore_test.go
go_method: TestFileStoreShortIndexWriteBug
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
When the N.idx file is shorter than the previous write we could fail to recover the idx properly.
For instance, with encryption and an expiring stream that has no messages, when a restart happens the decrypt will fail
since their are extra bytes, and this could lead to a stream sequence reset to zero.

NOTE: We do not use idx files anymore, but keeping test.


name: TestFileStoreEncryptedKeepIndexNeedBekResetBug
go_file: server/filestore_test.go
go_method: TestFileStoreEncryptedKeepIndexNeedBekResetBug
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
When we kept the empty block for tracking sequence, we needed to reset the bek
counter when encrypted for subsequent writes to be correct. The bek in place could
possibly still have a non-zero counter from previous writes.
Happens when all messages expire and the are flushed and then subsequent writes occur.


name: TestFileStoreRecalcFirstSequenceBug
go_file: server/filestore_test.go
go_method: TestFileStoreRecalcFirstSequenceBug
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
https://github.com/nats-io/nats-server/issues/4529
Run this wuth --race and you will see the unlocked access that probably caused this.


name: TestFileStoreFullStateMidBlockPastWAL
go_file: server/filestore_test.go
go_method: TestFileStoreFullStateMidBlockPastWAL
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
This tests we can successfully recover without having to rebuild the whole stream from a mid block index.db marker
when the updated block has a removed entry.
Make sure this does not cause a recover of the full state.


name: TestFileStoreNumPendingLastBySubject
go_file: server/filestore_test.go
go_method: TestFileStoreNumPendingLastBySubject
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
Since 2.10 we no longer have fss, and the approach for calculating NumPending would branch
based on the old fss metadata being present. This meant that calculating NumPending in >= 2.10.x
would load all blocks to complete. This test makes sure we do not do that anymore.


name: TestFileStoreCorruptPSIMOnDisk
go_file: server/filestore_test.go
go_method: TestFileStoreCorruptPSIMOnDisk
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
We had a bug that could cause internal memory corruption of the psim keys in memory
which could have been written to disk via index.db.


name: TestFileStoreMsgBlockFirstAndLastSeqCorrupt
go_file: server/filestore_test.go
go_method: TestFileStoreMsgBlockFirstAndLastSeqCorrupt
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
https://github.com/nats-io/nats-server/issues/5236
Unclear how the sequences get off here, this is just forcing the situation reported.


name: TestFileStoreDmapBlockRecoverAfterCompact
go_file: server/filestore_test.go
go_method: TestFileStoreDmapBlockRecoverAfterCompact
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
This test is for deleted interior message tracking after compaction from limits based deletes, meaning no tombstones.
Bug was that dmap would not be properly be hydrated after the compact from rebuild. But we did so in populateGlobalInfo.
So this is just to fix a bug in rebuildState tracking gaps after a compact.


name: TestGatewaySendReplyAcrossGateways
go_file: server/gateway_test.go
go_method: TestGatewaySendReplyAcrossGateways
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
This test uses a single account and makes sure that when
a reply subject is prefixed with $GR it comes back to
the origin cluster and delivered to proper reply subject
there, but also to subscribers on that reply subject
on the other cluster.


name: TestGatewayPingPongReplyAcrossGateways
go_file: server/gateway_test.go
go_method: TestGatewayPingPongReplyAcrossGateways
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
This test will have a requestor on cluster A and responder
on cluster B, but when the responder sends the response,
it will also have a reply subject to receive a response
for the response.


name: TestJetStreamAtomicBatchPublishProposeOne
go_file: server/jetstream_batching_test.go
go_method: TestJetStreamAtomicBatchPublishProposeOne
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
Test a batch within a single proposal, optionally combined with messages unrelated
to the batch but within the same proposal.


name: TestJetStreamAtomicBatchPublishProposeMultiple
go_file: server/jetstream_batching_test.go
go_method: TestJetStreamAtomicBatchPublishProposeMultiple
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
Test a batch spanning multiple proposals, optionally combined with messages unrelated
to the batch but within the same first/last proposal.


name: TestJetStreamAtomicBatchPublishContinuousBatchesStillMoveAppliedUp
go_file: server/jetstream_batching_test.go
go_method: TestJetStreamAtomicBatchPublishContinuousBatchesStillMoveAppliedUp
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
Test a continuous flow of batches spanning multiple append entries can still move applied up.
Also, test a server can become leader if the previous leader left it with a partial batch.


name: TestJetStreamAtomicBatchPublishPartiallyAppliedBatchOnRecovery
go_file: server/jetstream_batching_test.go
go_method: TestJetStreamAtomicBatchPublishPartiallyAppliedBatchOnRecovery
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
Test a batch that's committed but only partially applied, and the server gets hard killed.
Upon recovery the server should skip the messages that were already applied but store the
messages that weren't applied yet.


name: BenchmarkJetStreamConsumeFilteredContiguous
go_file: server/jetstream_benchmark_test.go
go_method: BenchmarkJetStreamConsumeFilteredContiguous
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
BenchmarkJetStreamConsumeFilteredContiguous verifies the fix in
https://github.com/nats-io/nats-server/pull/7015 and should
capture future regressions.


name: TestJetStreamClusterQueueSubConsumer
go_file: server/jetstream_cluster_1_test.go
go_method: TestJetStreamClusterQueueSubConsumer
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
This test creates a queue consumer for the delivery subject,
and make sure it connects to the server that is not the leader
of the stream. A bug was not stripping the $JS.ACK reply subject
correctly, which means that ack sent on the reply subject was
dropped by the route.


name: TestJetStreamClusterConsumerAckSyncReporting
go_file: server/jetstream_cluster_1_test.go
go_method: TestJetStreamClusterConsumerAckSyncReporting
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
This is to test follower ack fill logic when pending not empty.
There was a bug that would update p.Sequence in the stores (mem & file)
that would cause the logic to fail. Redeliveries were required to trigger.


name: TestJetStreamClusterConsumerAckOutOfBounds
go_file: server/jetstream_cluster_1_test.go
go_method: TestJetStreamClusterConsumerAckOutOfBounds
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
Make sure if we received acks that are out of bounds, meaning past our
last sequence or before our first that they are ignored and errored if applicable.


name: TestJetStreamClusterAccountStatsForReplicatedStreams
go_file: server/jetstream_cluster_1_test.go
go_method: TestJetStreamClusterAccountStatsForReplicatedStreams
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
This is for when we are still using $SYS for NRG replication but we want to make sure
we track this in something visible to the end user.


name: TestJetStreamClusterSingleLeafNodeEnablingJetStream
go_file: server/jetstream_cluster_2_test.go
go_method: TestJetStreamClusterSingleLeafNodeEnablingJetStream
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
When a leafnode enables JS on an account that is not enabled on the remote cluster account this should fail
Accessing a jet stream in a different availability domain requires the client provide a damain name, or
the server having set up appropriate defaults (default_js_domain. tested in leafnode_test.go)


name: TestJetStreamClusterDuplicateRoutesDisruptJetStreamMetaGroup
go_file: server/jetstream_cluster_2_test.go
go_method: TestJetStreamClusterDuplicateRoutesDisruptJetStreamMetaGroup
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
If the config files have duplicate routes this can have the metagroup estimate a size for the system
which prevents reaching quorum and electing a meta-leader.


name: TestJetStreamClusterMemoryConsumerCompactVsSnapshot
go_file: server/jetstream_cluster_2_test.go
go_method: TestJetStreamClusterMemoryConsumerCompactVsSnapshot
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
We were compacting to keep the raft log manageable but not snapshotting, which meant that restarted
servers could complain about no snapshot and could not sync after that condition.
Changes also address https://github.com/nats-io/nats-server/issues/2936


name: TestJetStreamClusterHAssetsEnforcement
go_file: server/jetstream_cluster_3_test.go
go_method: TestJetStreamClusterHAssetsEnforcement
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
We noticed that ha_assets enforcement seemed to not be upheld when assets created in a rapid fashion.


name: TestJetStreamClusterParallelStreamCreationDupeRaftGroups
go_file: server/jetstream_cluster_3_test.go
go_method: TestJetStreamClusterParallelStreamCreationDupeRaftGroups
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
In addition to test above, if streams were attempted to be created in parallel
it could be that multiple raft groups would be created for the same asset.


name: TestJetStreamClusterDirectGetStreamUpgrade
go_file: server/jetstream_cluster_3_test.go
go_method: TestJetStreamClusterDirectGetStreamUpgrade
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
Reported by a customer manually upgrading their streams to support direct gets.
Worked if single replica but not in clustered mode.


name: TestJetStreamClusterInterestPolicyStreamForConsumersToMatchRFactor
go_file: server/jetstream_cluster_3_test.go
go_method: TestJetStreamClusterInterestPolicyStreamForConsumersToMatchRFactor
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
For interest (or workqueue) based streams its important to match the replication factor.
This was the case but now that more control over consumer creation is allowed its possible
to create a consumer where the replication factor does not match. This could cause
instability in the state between servers and cause problems on leader switches.


name: TestJetStreamClusterCurrentVsHealth
go_file: server/jetstream_cluster_3_test.go
go_method: TestJetStreamClusterCurrentVsHealth
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
TestJetStreamClusterCurrentVsHealth is designed to show the
difference between "current" and "healthy" when async publishes
outpace the rate at which they can be applied.


name: TestJetStreamClusterActiveActiveSourcedStreams
go_file: server/jetstream_cluster_3_test.go
go_method: TestJetStreamClusterActiveActiveSourcedStreams
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
Several users and customers use this setup, but many times across leafnodes.
This should be allowed in same account since we are really protecting against
multiple pub acks with cycle detection.


name: TestJetStreamClusterWALBuildupOnNoOpPull
go_file: server/jetstream_cluster_3_test.go
go_method: TestJetStreamClusterWALBuildupOnNoOpPull
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
TestJetStreamClusterWALBuildupOnNoOpPull tests whether or not the consumer
RAFT log is being compacted when the stream is idle but we are performing
lots of fetches. Otherwise the disk usage just spirals out of control if
there are no other state changes to trigger a compaction.


name: TestJetStreamClusterStreamMaxAgeScaleUp
go_file: server/jetstream_cluster_3_test.go
go_method: TestJetStreamClusterStreamMaxAgeScaleUp
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
Found in https://github.com/nats-io/nats-server/issues/3848
When Max Age was specified and stream was scaled up, new replicas
were expiring messages much later than the leader.


name: TestJetStreamClusterConsumerAckFloorDrift
go_file: server/jetstream_cluster_3_test.go
go_method: TestJetStreamClusterConsumerAckFloorDrift
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
If a consumer has not been registered (possible in heavily loaded systems with lots of assets)
it could miss the signal of a message going away. If that message was pending and expires the
ack floor could fall below the stream first sequence. This test will force that condition and
make sure the system resolves itself.


name: TestJetStreamClusterConsumerInfoForJszForFollowers
go_file: server/jetstream_cluster_3_test.go
go_method: TestJetStreamClusterConsumerInfoForJszForFollowers
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
The consumer info() call does not take into account whether a consumer
is a leader or not, so results would be very different when asking servers
that housed consumer followers vs leaders.


name: TestJetStreamClusterStreamScaleUpNoGroupCluster
go_file: server/jetstream_cluster_3_test.go
go_method: TestJetStreamClusterStreamScaleUpNoGroupCluster
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
Some older streams seem to have been created or exist with no explicit cluster setting.
For server <= 2.9.16 you could not scale the streams up since we could not place them in another cluster.


name: TestJetStreamClusterLeafnodePlusDaisyChainSetup
go_file: server/jetstream_cluster_3_test.go
go_method: TestJetStreamClusterLeafnodePlusDaisyChainSetup
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
This test mimics a user's setup where there is a cloud cluster/domain, and one for eu and ap that are leafnoded into the
cloud cluster, and one for cn that is leafnoded into the ap cluster.
We broke basic connectivity in 2.9.17 from publishing in eu for delivery in cn on same account which is daisy chained through ap.
We will also test cross account delivery in this test as well.


name: TestLongKVPutWithServerRestarts
go_file: server/jetstream_cluster_long_test.go
go_method: TestLongKVPutWithServerRestarts
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
TestLongKVPutWithServerRestarts overwrites values in a replicated KV bucket for a fixed amount of time.
Also restarts a random server at fixed interval.
The test fails if updates fail for a continuous interval of time, or if a server fails to restart and catch up.


name: TestLongNRGChainOfBlocks
go_file: server/jetstream_cluster_long_test.go
go_method: TestLongNRGChainOfBlocks
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
This is a RaftChainOfBlocks test that randomly starts and stops nodes to exercise recovery and snapshots.


name: TestJetStreamConsumerUnpinNoMessages
go_file: server/jetstream_consumer_test.go
go_method: TestJetStreamConsumerUnpinNoMessages
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
This tests if Unpin works correctly when there are no pending messages.
It checks if the next pinned client will be different than the first one
after new messages is published.


name: TestJetStreamConsumerUnpinPickDifferentRequest
go_file: server/jetstream_consumer_test.go
go_method: TestJetStreamConsumerUnpinPickDifferentRequest
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
In some scenarios, if the next waiting request is the same as the old pinned, it could be picked as a new pin.
This test replicates that behavior and checks if the new pin is different than the old one.


name: TestJetStreamConsumerFilterSubject
go_file: server/jetstream_consumer_test.go
go_method: TestJetStreamConsumerFilterSubject
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
This test is in support fo clients that want to match on subject, they
can set the filter subject always. We always store the subject so that
should the stream later be edited to expand into more subjects the consumer
still gets what was actually requested


name: TestJetStreamConsumerCleanupWithRetentionPolicy
go_file: server/jetstream_consumer_test.go
go_method: TestJetStreamConsumerCleanupWithRetentionPolicy
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
We had a report of a consumer delete crashing the server when in interest retention mode.
This I believe is only really possible in clustered mode, but we will force the issue here.


name: TestJetStreamConsumerPullConsumerFIFO
go_file: server/jetstream_consumer_test.go
go_method: TestJetStreamConsumerPullConsumerFIFO
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
Originally pull consumers were FIFO with respect to the request, not delivery of messages.
We have changed to have the behavior be FIFO but on an individual message basis.
So after a message is delivered, the request, if still outstanding, effectively
goes to the end of the queue of requests pending.


name: TestJetStreamConsumerPullCrossAccountsAndLeafNodes
go_file: server/jetstream_consumer_test.go
go_method: TestJetStreamConsumerPullCrossAccountsAndLeafNodes
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
This tests account export/import replies across a LN connection with account import/export
on both sides of the LN.


name: TestJetStreamConsumerPullOneShotBehavior
go_file: server/jetstream_consumer_test.go
go_method: TestJetStreamConsumerPullOneShotBehavior
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
This test is to explicitly test for all combinations of pull consumer behavior.
 1. Long poll, will be used to emulate push. A request is only invalidated when batch is filled, it expires, or we lose interest.
 2. Batch 1, will return no messages or a message. Works today.
 3. Conditional wait, or one shot. This is what the clients do when the do a fetch().
    They expect to wait up to a given time for any messages but will return once they have any to deliver, so parital fills.
 4. Try, which never waits at all ever.


name: TestJetStreamLeafNodeAndMirrorResyncAfterConnectionDown
go_file: server/jetstream_leafnode_test.go
go_method: TestJetStreamLeafNodeAndMirrorResyncAfterConnectionDown
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
This will test that when a mirror or source construct is setup across a leafnode/domain
that it will recover quickly once the LN is re-established regardless
of backoff state of the internal consumer create.


name: TestJetStreamLeafNodeAndMirrorResyncAfterLeafEstablished
go_file: server/jetstream_leafnode_test.go
go_method: TestJetStreamLeafNodeAndMirrorResyncAfterLeafEstablished
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
This test will test a 3 node setup where we have a hub node, a gateway node, and a satellite node.
This is specifically testing re-sync when there is not a direct Domain with JS match for the first
hop connect LN that is signaling.

		  HUB <---- GW(+JS/DOMAIN) -----> SAT1
		   ^
		   |
	       +------- GW(-JS/NO DOMAIN) --> SAT2

The Gateway node will solicit the satellites but will act as a LN hub.


name: TestStreamSourcingScalingSourcingManyBenchmark
go_file: server/jetstream_sourcing_scaling_test.go
go_method: TestStreamSourcingScalingSourcingManyBenchmark
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
This test is being skipped by CI as it takes too long to run and is meant to test the scalability of sourcing
rather than being a unit test.


name: TestJetStreamSuperClusterCrossClusterConsumerInterest
go_file: server/jetstream_super_cluster_test.go
go_method: TestJetStreamSuperClusterCrossClusterConsumerInterest
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
Test that consumer interest across gateways and superclusters is properly identitifed in a remote cluster.


name: TestJetStreamSuperClusterGetNextRewrite
go_file: server/jetstream_super_cluster_test.go
go_method: TestJetStreamSuperClusterGetNextRewrite
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
Issue reported with superclusters and leafnodes where first few get next requests for pull subscribers
have the wrong subject.


name: TestJetStreamSuperClusterStateOnRestartPreventsConsumerRecovery
go_file: server/jetstream_super_cluster_test.go
go_method: TestJetStreamSuperClusterStateOnRestartPreventsConsumerRecovery
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
We had a scenario where a consumer would not recover properly on restart due to
the cluster state not being set properly when checking source subjects.


name: TestJetStreamRedeliverAndLateAck
go_file: server/jetstream_test.go
go_method: TestJetStreamRedeliverAndLateAck
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
We want to make sure that for pull based consumers that if we ack
late with no interest the redelivery attempt is removed and we do
not get the message back.


name: TestJetStreamSingleInstanceRemoteAccess
go_file: server/jetstream_test.go
go_method: TestJetStreamSingleInstanceRemoteAccess
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
This will be testing our ability to conditionally rewrite subjects for last mile
when working with JetStream. Consumers receive messages that have their subjects
rewritten to match the original subject. NATS routing is all subject based except
for the last mile to the client.


name: TestJetStreamStoreDirectoryFix
go_file: server/jetstream_test.go
go_method: TestJetStreamStoreDirectoryFix
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
From 2.2.2 to 2.2.3 we fixed a bug that would not consistently place a jetstream directory
under the store directory configured. However there were some cases where the directory was
created that way and therefore 2.2.3 would start and not recognize the existing accounts,
streams and consumers.


name: TestJetStreamAccountImportBasics
go_file: server/jetstream_test.go
go_method: TestJetStreamAccountImportBasics
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
This is for the basics of importing the ability to send to a stream and consume
from a consumer that is pull based on push based on a well known delivery subject.


name: TestJetStreamAccountImportJSAdvisoriesAsService
go_file: server/jetstream_test.go
go_method: TestJetStreamAccountImportJSAdvisoriesAsService
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
This tests whether we are able to aggregate all JetStream advisory events
from all accounts into a single account. Config for this test uses
service imports and exports as that allows for gathering all events
without having to know the account name and without separate entries
for each account in aggregate account config.
This test fails as it is not receiving the api audit event ($JS.EVENT.ADVISORY.API).


name: TestJetStreamAccountImportJSAdvisoriesAsStream
go_file: server/jetstream_test.go
go_method: TestJetStreamAccountImportJSAdvisoriesAsStream
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
This tests whether we are able to aggregate all JetStream advisory events
from all accounts into a single account. Config for this test uses
stream imports and exports as that allows for gathering all events
as long as there is a separate stream import entry for each account
in aggregate account config.


name: TestJetStreamExpireAllWhileServerDown
go_file: server/jetstream_test.go
go_method: TestJetStreamExpireAllWhileServerDown
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
Got a report of streams that expire all messages while the server is down report errors when clients reconnect
and try to send new messages.


name: TestJetStreamMaxMsgsPerSubjectWithDiscardNew
go_file: server/jetstream_test.go
go_method: TestJetStreamMaxMsgsPerSubjectWithDiscardNew
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
Test that we properly enforce per subject msg limits when DiscardNew is set.
DiscardNew should only apply to stream limits, subject based limits should always be DiscardOld.


name: TestJetStreamFlowControlStall
go_file: server/jetstream_test.go
go_method: TestJetStreamFlowControlStall
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
Under load testing for K3S and the KINE interface we saw some stalls.
These were caused by a dynamic that would not send a second FC item with one
pending, but when we sent the next message and got blocked, if that msg would
exceed the outstanding FC we would become stalled.


name: TestJetStreamDirectMsgGetNext
go_file: server/jetstream_test.go
go_method: TestJetStreamDirectMsgGetNext
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
This allows support for a get next given a sequence as a starting.
This allows these to be chained together if needed for sparse streams.


name: TestJetStreamKVReductionInHistory
go_file: server/jetstream_test.go
go_method: TestJetStreamKVReductionInHistory
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
Make sure when we downgrade history to a smaller number that the account info
is properly updated and all keys are still accessible.
There was a bug calculating next first that was not taking into account the dbit slots.


name: TestJetStreamFlowControlCrossAccountFanOut
go_file: server/jetstream_test.go
go_method: TestJetStreamFlowControlCrossAccountFanOut
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
Test that flow control works correctly when a stream sources from two
different external accounts. Each account's $JS.FC.> service import
causes FC replies to fan out to all accounts, but only the correct
account's consumer handles the reply. This verifies the fan-out
doesn't prevent FC from completing.


name: TestJetStreamTPMKeyBadPassword
go_file: server/jetstream_tpm_test.go
go_method: TestJetStreamTPMKeyBadPassword
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
Warning: Running this test too frequently will considerably slow down
these tests and eventually lock out the TPM.

Depending on the environment this varies from 10 failures per day with
a 24 hour lockout (Dell) to 32 failures per day with a 10
minute healing time (decrementing one failure every 10 minutes).


name: TestJWTAccountServiceImportAuthSwitch
go_file: server/jwt_test.go
go_method: TestJWTAccountServiceImportAuthSwitch
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
This will test that we can switch from a public export to a private
one and back with export claims to make sure the claim update mechanism
is working properly.


name: TestJWTAccountLimitsMaxConnsAfterExpired
go_file: server/jwt_test.go
go_method: TestJWTAccountLimitsMaxConnsAfterExpired
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
This test ensures that connected clients are properly evicted
(no deadlock) if the max conns of an account has been lowered
and the account is being updated (following expiration during
a lookup).


name: TestLeafNodeHttpProxyValidationProgrammatic
go_file: server/leafnode_proxy_test.go
go_method: TestLeafNodeHttpProxyValidationProgrammatic
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
TestLeafNodeProxyValidationProgrammatic tests proxy validation when configuring server programmatically


name: TestLeafNodeBasicAuthFailover
go_file: server/leafnode_test.go
go_method: TestLeafNodeBasicAuthFailover
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
This test ensures that we can connect using proper user/password
to a LN URL that was discovered through the INFO protocol.
We also check that the password doesn't leak to debug/trace logs.


name: TestLeafNodeLoopDetectedOnAcceptSide
go_file: server/leafnode_test.go
go_method: TestLeafNodeLoopDetectedOnAcceptSide
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
Make sure that if the node that detects the loop (and sends the error and
close the connection) is the accept side, the remote node (the one that solicits)
properly use the reconnect delay.


name: TestLeafNodeLoopDetectedDueToReconnect
go_file: server/leafnode_test.go
go_method: TestLeafNodeLoopDetectedDueToReconnect
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
This test will simulate that the accept side does not detect the connection
has been closed early enough. The soliciting side will attempt to reconnect
and we should not be getting the "loop detected" error.


name: TestLeafNodeWSNoBufferCorruption
go_file: server/leafnode_test.go
go_method: TestLeafNodeWSNoBufferCorruption
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
This test was showing an issue if one set maxBufSize to very small value,
such as maxBufSize = 10. With such small value, we would get a corruption
in that LMSG would arrive with missing bytes. We are now always making
a copy when dealing with messages that are bigger than maxBufSize.


name: Benchmark_MemStoreLoadNextMsgFiltered
go_file: server/memstore_test.go
go_method: Benchmark_MemStoreLoadNextMsgFiltered
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
This benchmark populates a memstore and then measures
the time it takes to load the entire store using
LoadNextMsg repeatedly until the store returns ErrStoreEOF.


name: TestMonitorIpqzWithGenerics
go_file: server/monitor_test.go
go_method: TestMonitorIpqzWithGenerics
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
When we converted ipq to use generics we still were using sync.Map. Currently you can not convert
any or any to a generic parameterized type. So this stopped working and panics.
Copyright 2013-2024 The NATS Authors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Make sure that we do not run the http server for monitoring unless asked.
https://github.com/nats-io/nats-server/issues/2170
Just the ever increasing subs part.
Helper to map to connection name
getConnsIdleDurations returns a slice of parsed idle durations from a connection info slice.
sortedDurationsDesc checks if a time.Duration slice is sorted in descending order.
getIdleDurations returns a slice of idle durations from a connection info list up until now time.
sortedDurationsAsc checks if a time.Duration slice is sorted in ascending order.
Tests handle root
Make sure options for ConnInfo like subs=1, authuser, etc do not cause a race.
Make sure a bad client that is disconnected right away has proper values.
Make sure a bad client that tries to connect plain to TLS has proper values.
Create a connection to test ConnInfo
Benchmark our Connz generation. Don't use HTTP here, just measure server endpoint.
Helper function to check that a JS cluster is formed
https://github.com/nats-io/nats-server/issues/4144
createCallbackURL adds a callback query parameter for JSONP requests.
stripCallback removes the JSONP callback function from the response.
Returns the JSON body without the wrapping callback function.
If there's no callback function, the data is returned as is.
expectHealthStatus makes 1 regular and 1 JSONP request to the URL and checks the
HTTP status code, Content-Type header and health status string.
checkHealthStatus checks the health status from a JSON response.
checkHealthzEndpoint makes requests to the /healthz endpoint and checks the health status.
When we converted ipq to use generics we still were using sync.Map. Currently you can not convert
any or any to a generic parameterized type. So this stopped working and panics.


name: TestMQTTQoS2InflightMsgsDeliveredAfterUnsubscribe
go_file: server/mqtt_test.go
go_method: TestMQTTQoS2InflightMsgsDeliveredAfterUnsubscribe
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
- [MQTT-3.10.4-3] If a Server deletes a Subscription It MUST complete the
delivery of any QoS 1 or QoS 2 messages which it has started to send to the
Client.

Test flow:
  - Subscribe to foo, publish 3 QoS2 messages.
  - After one is PUBCOMP-ed, and one is PUBREC-ed, Unsubscribe.
  - See that the remaining 2 are fully delivered.


name: TestMQTTConsumerReplicasOverride
go_file: server/mqtt_test.go
go_method: TestMQTTConsumerReplicasOverride
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
This was ill-advised since the messages stream is currently interest policy.
Interest policy streams require consumers match the replica count.
Will leave her for now to make sure we do not override.


name: TestMQTTSubjectWildcardStart
go_file: server/mqtt_test.go
go_method: TestMQTTSubjectWildcardStart
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
Issue https://github.com/nats-io/nats-server/issues/3924
The MQTT Server MUST NOT match Topic Filters starting with a wildcard character (# or +),
with Topic Names beginning with a $ character [MQTT-4.7.2-1]


name: TestNoRaceAccountAddServiceImportRace
go_file: server/norace_1_test.go
go_method: TestNoRaceAccountAddServiceImportRace
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
This test is same than TestAccountAddServiceImportRace but running
without the -race flag, it would capture more easily the possible
duplicate sid, resulting in less than expected number of subscriptions
in the account's internal subscriptions map.


name: TestNoRaceQueueAutoUnsubscribe
go_file: server/norace_1_test.go
go_method: TestNoRaceQueueAutoUnsubscribe
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
Similar to the routed version. Make sure we receive all of the
messages with auto-unsubscribe enabled.


name: TestNoRaceJetStreamServiceImportAccountSwapIssue
go_file: server/norace_1_test.go
go_method: TestNoRaceJetStreamServiceImportAccountSwapIssue
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
We used to swap accounts on an inbound message when processing service imports.
Until JetStream this was kinda ok, but with JetStream we can have pull consumers
trying to access the clients account in another Go routine now which causes issues.
This is not limited to the case above, its just the one that exposed it.
This test is to show that issue and that the fix works, meaning we no longer swap c.acc.


name: TestNoRaceJetStreamSlowRestartWithManyExpiredMsgs
go_file: server/norace_1_test.go
go_method: TestNoRaceJetStreamSlowRestartWithManyExpiredMsgs
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
Report of slow restart for a server that has many messages that have expired while it was not running.


name: TestNoRaceJetStreamSuperClusterAccountConnz
go_file: server/norace_1_test.go
go_method: TestNoRaceJetStreamSuperClusterAccountConnz
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
We will use JetStream helpers to create supercluster but this test is about exposing the ability to access
account scoped connz with subject interest filtering.


name: TestNoRaceJetStreamOrderedConsumerMissingMsg
go_file: server/norace_1_test.go
go_method: TestNoRaceJetStreamOrderedConsumerMissingMsg
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
This test was from Ivan K. and showed a bug in the filestore implementation.
This is skipped by default since it takes >40s to run.


name: TestNoRaceJetStreamClusterInterestPolicyAckNone
go_file: server/norace_1_test.go
go_method: TestNoRaceJetStreamClusterInterestPolicyAckNone
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
Issue #2488 - Bad accounting, can not reproduce the stalled consumers after last several PRs.
Issue did show bug in ack logic for no-ack and interest based retention.


name: TestNoRaceJetStreamLastSubjSeqAndFilestoreCompact
go_file: server/norace_1_test.go
go_method: TestNoRaceJetStreamLastSubjSeqAndFilestoreCompact
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
There was a bug in the filestore compact code that would cause a store
with JSExpectedLastSubjSeq to fail with "wrong last sequence: 0"


name: TestNoRaceJetStreamClusterStreamReset
go_file: server/norace_1_test.go
go_method: TestNoRaceJetStreamClusterStreamReset
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
Make sure when we try to hard reset a stream state in a cluster that we also re-create the consumers.


name: TestNoRaceJetStreamClusterStreamSeqMismatchIssue
go_file: server/norace_1_test.go
go_method: TestNoRaceJetStreamClusterStreamSeqMismatchIssue
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
Trying to recreate an issue rip saw with KV and server restarts complaining about
mismatch for a few minutes and growing memory.


name: TestNoRaceJetStreamConsumerFileStoreConcurrentDiskIO
go_file: server/norace_1_test.go
go_method: TestNoRaceJetStreamConsumerFileStoreConcurrentDiskIO
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
This is related to an issue reported where we were exhausting threads by trying to
cleanup too many consumers at the same time.
https://github.com/nats-io/nats-server/issues/2742


name: TestNoRaceJetStreamStreamInfoSubjectDetailsLimits
go_file: server/norace_1_test.go
go_method: TestNoRaceJetStreamStreamInfoSubjectDetailsLimits
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
Test that we can receive larger messages with stream subject details.
Also test that we will fail at some point and the user can fall back to
an orderedconsumer like we do with watch for KV Keys() call.


name: TestNoRaceJetStreamClusterDirectAccessAllPeersSubs
go_file: server/norace_1_test.go
go_method: TestNoRaceJetStreamClusterDirectAccessAllPeersSubs
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
Test that all peers have the direct access subs that participate in a queue group,
but only when they are current and ready. So we will start with R1, add in messages
then scale up while also still adding messages.


name: TestNoRaceEncodeConsumerStateBug
go_file: server/norace_1_test.go
go_method: TestNoRaceEncodeConsumerStateBug
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
Bug when we encode a timestamp that upon decode causes an error which causes server to panic.
This can happen on consumer redelivery since they adjusted timstamps can be in the future, and result
in a negative encoding. If that encoding was exactly -1 seconds, would cause decodeConsumerState to fail
and the server to panic.


name: TestNoRaceJetStreamClusterConsumerInfoSpeed
go_file: server/norace_1_test.go
go_method: TestNoRaceJetStreamClusterConsumerInfoSpeed
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
ConsumerInfo seems to being called quite a bit more than we had anticipated.
Under certain circumstances, since we reset num pending, this can be very costly.
We will use the fast path to alleviate that performance bottleneck but also make
sure we are still being accurate.


name: TestNoRaceJetStreamConsumerCreateTimeNumPending
go_file: server/norace_1_test.go
go_method: TestNoRaceJetStreamConsumerCreateTimeNumPending
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
Test for consumer create when the subject cardinality is high and the
consumer is filtered with a wildcard that forces linear scans.
We have an optimization to use in memory structures in filestore to speed up.
Only if asking to scan all (DeliverAll).


name: TestNoRaceJetStreamClusterF3Setup
go_file: server/norace_1_test.go
go_method: TestNoRaceJetStreamClusterF3Setup
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
This is to test a publish slowdown and general instability experienced in a setup similar to this.
We have feeder streams that are all sourced to an aggregate stream. All streams are interest retention.
We want to monitor the avg publish time for the sync publishers to the feeder streams, the ingest rate to
the aggregate stream, and general health of the consumers on the aggregate stream.
Target publish rate is ~2k/s with publish time being ~40-60ms but remaining stable.
We can also simulate max redeliveries that create interior deletes in streams.


name: TestNoRaceJetStreamClusterDifferentRTTInterestBasedStreamSetup
go_file: server/norace_1_test.go
go_method: TestNoRaceJetStreamClusterDifferentRTTInterestBasedStreamSetup
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
We test an interest based stream that has a cluster with a node with asymmetric paths from
the stream leader and the consumer leader such that the consumer leader path is fast and
replicated acks arrive sooner then the actual message. This path was considered, but also
categorized as very rare and was expensive as it tried to forward a new stream msg delete
proposal to the original stream leader. It now will deal with the issue locally and not
slow down the ingest rate to the stream's publishers.


name: TestNoRaceRoutePoolAndPerAccountConfigReload
go_file: server/norace_1_test.go
go_method: TestNoRaceRoutePoolAndPerAccountConfigReload
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
This test, which checks that messages are not duplicated when pooling or
per-account routes are reloaded, would cause a DATA RACE that is not
specific to the changes for pooling/per_account. For this reason, this
test is located in the norace_test.go file.


name: TestNoRaceClientOutboundQueueMemory
go_file: server/norace_1_test.go
go_method: TestNoRaceClientOutboundQueueMemory
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
This test ensures that outbound queues don't cause a run on
memory when sending something to lots of clients.


name: TestNoRaceLargeStreamCatchups
go_file: server/norace_2_test.go
go_method: TestNoRaceLargeStreamCatchups
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
When a catchup takes a long time and the ingest rate is high enough to cause us
to drop append entries and move our first past out catchup window due to max bytes or max msgs, etc.


name: TestNoRaceFileStoreMsgLimitsAndOldRecoverState
go_file: server/norace_2_test.go
go_method: TestNoRaceFileStoreMsgLimitsAndOldRecoverState
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
Under certain scenarios an old index.db with a stream that has msg limits set will not restore properly
due to an old index.db and compaction after the index.db took place which could lose per subject information.


name: TestAuthorizationConfig
go_file: server/opts_test.go
go_method: TestAuthorizationConfig
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
Test highly depends on contents of the config file listed below. Any changes to that file
may very well break this test.


name: TestProcessConfigString
go_file: server/opts_test.go
go_method: TestProcessConfigString
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
TestProcessConfigString duplicates the previous test, but uses the (*Options).ProcessConfigString
instead of the ProcessConfigFile function.


name: TestNewServerFromConfigFunctionality
go_file: server/opts_test.go
go_method: TestNewServerFromConfigFunctionality
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
TestNewServerFromConfigFunctionality tests the NewServerFromConfig() function
to ensure it properly processes config files and creates servers correctly.


name: TestNewServerFromConfigVsLoadConfig
go_file: server/opts_test.go
go_method: TestNewServerFromConfigVsLoadConfig
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
TestNewServerFromConfigVsLoadConfig tests that NewServerFromConfig produces
equivalent results to the traditional LoadConfig approach.


name: TestNRGSimpleElection
go_file: server/raft_test.go
go_method: TestNRGSimpleElection
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
TestNRGSimpleElection tests that a simple election succeeds. It is
simple because the group hasn't processed any entries and hasn't
suffered any interruptions of any kind, therefore there should be
no way that the conditions for granting the votes can fail.


name: TestNRGLeaderTransfer
go_file: server/raft_test.go
go_method: TestNRGLeaderTransfer
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
TestNRGLeaderTransfer verifies that a Raft group correctly transfers
leadership to a chosen preferred node when the current leader steps down.


name: TestNRGChainOfBlocksRunInLockstep
go_file: server/raft_test.go
go_method: TestNRGChainOfBlocksRunInLockstep
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
This is a RaftChainOfBlocks test where a block is proposed and then we wait for all replicas to apply it before
proposing the next one.
The test may fail if:
  - Replicas hash diverge
  - One replica never applies the N-th block applied by the rest
  - The given number of blocks cannot be applied within some amount of time


name: TestNRGChainOfBlocksStopAndCatchUp
go_file: server/raft_test.go
go_method: TestNRGChainOfBlocksStopAndCatchUp
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
This is a RaftChainOfBlocks test where one of the replicas is stopped before proposing a short burst of blocks.
Upon resuming the replica, we check it is able to catch up to the rest.
The test may fail if:
  - Replicas hash diverge
  - One replica never applies the N-th block applied by the rest
  - The given number of blocks cannot be applied within some amount of time


name: TestNRGProposeRemovePeerLeader
go_file: server/raft_test.go
go_method: TestNRGProposeRemovePeerLeader
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
Test outline:
  - In a R3 cluster, PeerRemove the leader and block on of
    the followers.
  - Verify that the membership change can't make progress,
    the leader should not count its own ack towards quorum.
  - Release the previously blocked follower and expect the
    membership change to take place.


name: TestConfigReloadNoConfigFile
go_file: server/reload_test.go
go_method: TestConfigReloadNoConfigFile
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
Ensure Reload returns an error when attempting to reload a server that did
not start with a config file.


name: TestConfigReloadUnsupported
go_file: server/reload_test.go
go_method: TestConfigReloadUnsupported
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
Ensure Reload returns an error when attempting to change an option which
does not support reloading.


name: TestConfigReloadUnsupportedHotSwapping
go_file: server/reload_test.go
go_method: TestConfigReloadUnsupportedHotSwapping
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
This checks that if we change an option that does not support hot-swapping
we get an error. Using `listen` for now (test may need to be updated if
server is changed to support change of listen spec).


name: TestConfigReloadRotateTLS
go_file: server/reload_test.go
go_method: TestConfigReloadRotateTLS
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
Ensure Reload supports TLS config changes. Test this by starting a server
with TLS enabled, connect to it to verify, reload config using a different
key pair and client verification enabled, ensure reconnect fails, then
ensure reconnect succeeds when the client provides a cert.


name: TestConfigReloadEnableTLS
go_file: server/reload_test.go
go_method: TestConfigReloadEnableTLS
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
Ensure Reload supports enabling TLS. Test this by starting a server without
TLS enabled, connect to it to verify, reload config with TLS enabled, ensure
reconnect fails, then ensure reconnect succeeds when using secure.


name: TestConfigReloadDisableTLS
go_file: server/reload_test.go
go_method: TestConfigReloadDisableTLS
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
Ensure Reload supports disabling TLS. Test this by starting a server with
TLS enabled, connect to it to verify, reload config with TLS disabled,
ensure reconnect fails, then ensure reconnect succeeds when connecting
without secure.


name: TestConfigReloadRotateUserAuthentication
go_file: server/reload_test.go
go_method: TestConfigReloadRotateUserAuthentication
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
Ensure Reload supports single user authentication config changes. Test this
by starting a server with authentication enabled, connect to it to verify,
reload config using a different username/password, ensure reconnect fails,
then ensure reconnect succeeds when using the correct credentials.


name: TestConfigReloadEnableUserAuthentication
go_file: server/reload_test.go
go_method: TestConfigReloadEnableUserAuthentication
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
Ensure Reload supports enabling single user authentication. Test this by
starting a server with authentication disabled, connect to it to verify,
reload config using with a username/password, ensure reconnect fails, then
ensure reconnect succeeds when using the correct credentials.


name: TestConfigReloadDisableUserAuthentication
go_file: server/reload_test.go
go_method: TestConfigReloadDisableUserAuthentication
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
Ensure Reload supports disabling single user authentication. Test this by
starting a server with authentication enabled, connect to it to verify,
reload config using with authentication disabled, then ensure connecting
with no credentials succeeds.


name: TestConfigReloadRotateTokenAuthentication
go_file: server/reload_test.go
go_method: TestConfigReloadRotateTokenAuthentication
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
Ensure Reload supports token authentication config changes. Test this by
starting a server with token authentication enabled, connect to it to
verify, reload config using a different token, ensure reconnect fails, then
ensure reconnect succeeds when using the correct token.


name: TestConfigReloadEnableTokenAuthentication
go_file: server/reload_test.go
go_method: TestConfigReloadEnableTokenAuthentication
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
Ensure Reload supports enabling token authentication. Test this by starting
a server with authentication disabled, connect to it to verify, reload
config using with a token, ensure reconnect fails, then ensure reconnect
succeeds when using the correct token.


name: TestConfigReloadDisableTokenAuthentication
go_file: server/reload_test.go
go_method: TestConfigReloadDisableTokenAuthentication
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
Ensure Reload supports disabling single token authentication. Test this by
starting a server with authentication enabled, connect to it to verify,
reload config using with authentication disabled, then ensure connecting
with no token succeeds.


name: TestConfigReloadRotateUsersAuthentication
go_file: server/reload_test.go
go_method: TestConfigReloadRotateUsersAuthentication
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
Ensure Reload supports users authentication config changes. Test this by
starting a server with users authentication enabled, connect to it to
verify, reload config using a different user, ensure reconnect fails, then
ensure reconnect succeeds when using the correct credentials.


name: TestConfigReloadEnableUsersAuthentication
go_file: server/reload_test.go
go_method: TestConfigReloadEnableUsersAuthentication
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
Ensure Reload supports enabling users authentication. Test this by starting
a server with authentication disabled, connect to it to verify, reload
config using with users, ensure reconnect fails, then ensure reconnect
succeeds when using the correct credentials.


name: TestConfigReloadDisableUsersAuthentication
go_file: server/reload_test.go
go_method: TestConfigReloadDisableUsersAuthentication
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
Ensure Reload supports disabling users authentication. Test this by starting
a server with authentication enabled, connect to it to verify,
reload config using with authentication disabled, then ensure connecting
with no credentials succeeds.


name: TestConfigReloadChangePermissions
go_file: server/reload_test.go
go_method: TestConfigReloadChangePermissions
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
Ensure Reload supports changing permissions. Test this by starting a server
with a user configured with certain permissions, test publish and subscribe,
reload config with new permissions, ensure the previous subscription was
closed and publishes fail, then ensure the new permissions succeed.


name: TestConfigReloadEnableClusterAuthorization
go_file: server/reload_test.go
go_method: TestConfigReloadEnableClusterAuthorization
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
Ensure Reload supports enabling route authorization. Test this by starting
two servers in a cluster without authorization, ensuring messages flow
between them, then reloading with authorization and ensuring messages no
longer flow until reloading with the correct credentials.


name: TestConfigReloadDisableClusterAuthorization
go_file: server/reload_test.go
go_method: TestConfigReloadDisableClusterAuthorization
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
Ensure Reload supports disabling route authorization. Test this by starting
two servers in a cluster with authorization, ensuring messages flow
between them, then reloading without authorization and ensuring messages
still flow.


name: TestConfigReloadClusterRoutes
go_file: server/reload_test.go
go_method: TestConfigReloadClusterRoutes
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
Ensure Reload supports changing cluster routes. Test this by starting
two servers in a cluster, ensuring messages flow between them, then
reloading with a different route and ensuring messages flow through the new
cluster.


name: TestConfigReloadClusterRemoveSolicitedRoutes
go_file: server/reload_test.go
go_method: TestConfigReloadClusterRemoveSolicitedRoutes
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
Ensure Reload supports removing a solicited route. In this case from A->B
Test this by starting two servers in a cluster, ensuring messages flow between them.
Then stop server B, and have server A continue to try to connect. Reload A with a config
that removes the route and make sure it does not connect to server B when its restarted.


name: TestConfigReloadMaxConnections
go_file: server/reload_test.go
go_method: TestConfigReloadMaxConnections
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
Ensure Reload supports changing the max connections. Test this by starting a
server with no max connections, connecting two clients, reloading with a
max connections of one, and ensuring one client is disconnected.


name: TestConfigReloadMaxPayload
go_file: server/reload_test.go
go_method: TestConfigReloadMaxPayload
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
Ensure reload supports changing the max payload size. Test this by starting
a server with the default size limit, ensuring publishes work, reloading
with a restrictive limit, and ensuring publishing an oversized message fails
and disconnects the client.


name: TestConfigReloadRotateFiles
go_file: server/reload_test.go
go_method: TestConfigReloadRotateFiles
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
Ensure reload supports rotating out files. Test this by starting
a server with log and pid files, reloading new ones, then check that
we can rename and delete the old log/pid files.


name: TestConfigReloadNotPreventedByGateways
go_file: server/reload_test.go
go_method: TestConfigReloadNotPreventedByGateways
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
As of now, config reload does not support changes for gateways.
However, ensure that if a gateway is defined, one can still
do reload as long as we don't change the gateway spec.


name: TestRoutePoolWithOlderServerConnectAndReconnect
go_file: server/routes_test.go
go_method: TestRoutePoolWithOlderServerConnectAndReconnect
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
This test will make sure that a server with pooling does not
keep trying to connect to a non pooled (for instance old) server.
Will also make sure that if the old server is simply accepting
connections, and restarted, the server with pooling will connect.


name: TestServerJsonMarshalNestedStructsPanic
go_file: server/server_test.go
go_method: TestServerJsonMarshalNestedStructsPanic
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
This is a test that guards against using goccy/go-json.
At least until it's fully compatible with std encoding/json, and we've thoroughly tested it.
This is just one bug (at the time of writing) that results in a panic.
https://github.com/goccy/go-json/issues/519


name: TestSublistRemoteQueueSubscriptions
go_file: server/sublist_test.go
go_method: TestSublistRemoteQueueSubscriptions
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
Remote subscriptions for queue subscribers will be weighted such that a single subscription
is received, but represents all of the queue subscribers on the remote side.


name: TestSubjectTreeInsertLongerLeafSuffixWithTrailingNulls
go_file: server/stree/stree_test.go
go_method: TestSubjectTreeInsertLongerLeafSuffixWithTrailingNulls
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
This bug requires the trailing suffix contain repeating nulls \x00
and the second subject be longer with more nulls.


name: TestLoadJetStreamEncryptionKeyFromTPMBasic
go_file: server/tpm/js_ek_tpm_test.go
go_method: TestLoadJetStreamEncryptionKeyFromTPMBasic
status: not_started
created_at: 2026-02-26 12:04:36
updated_at: 2026-02-26 12:04:36
description:
TestLoadJetStreamEncryptionKeyFromTPMBasic tests the basic functionality.
The first pass will create the keys and generate the js encryption key.
the second pass will read the keys from disk, decrypt with the TPM (unseal),
and return the same key.


