test: use NATS in coderdtest by default (#27343)

Closes GRU-70

Enables NATS as the pubsub for `coderdtest` unless specifically overwritten by the test case.
This commit is contained in:
Spike Curtis
2026-07-21 11:19:23 +02:00
committed by GitHub
parent 3227cac217
commit 9bd4cf2a2a
5 changed files with 31 additions and 12 deletions
+6
View File
@@ -721,6 +721,12 @@ func New(ctx context.Context, options *Options) (_ *API, err error) {
return nil, xerrors.Errorf("mount scim routes: %w", mountScimError)
}
// The NATS pubsub, if enabled, used the Replica Manager for clustering. It's a layering violation if the pubsub
// for the Replica Manager *is* the NATS pubsub, because then we have a dependency loop.
if _, isNats := options.ReplicaSyncPubsub.(*nats.Pubsub); isNats {
return nil, xerrors.Errorf("replica sync pubsub cannot be the NATS pubsub")
}
// We always want to run the replica manager even if we don't have DERP
// enabled, since it's used to detect other coder servers for licensing,
// and NATS clustering for HA pubsub.