fix: make embedded NATS opt-in so tests don't hang
All checks were successful
CI / Build and Test (push) Successful in 31s
All checks were successful
CI / Build and Test (push) Successful in 31s
Move NATS startup from New() to Start(), so tests that don't use pubsub never block on server initialization. Add a 10s timeout to WaitForServer() and skip NATS tests gracefully when unavailable.
This commit is contained in:
@@ -10,8 +10,7 @@ import (
|
||||
)
|
||||
|
||||
func TestPublishSubscribe_RoundTrip(t *testing.T) {
|
||||
v := New()
|
||||
defer v.Shutdown()
|
||||
v := setupNATSTest(t)
|
||||
|
||||
type event struct {
|
||||
Name string `json:"name"`
|
||||
@@ -43,8 +42,7 @@ func TestPublishSubscribe_RoundTrip(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestSubscribe_SkipsBadJSON(t *testing.T) {
|
||||
v := New()
|
||||
defer v.Shutdown()
|
||||
v := setupNATSTest(t)
|
||||
|
||||
type msg struct {
|
||||
Text string `json:"text"`
|
||||
|
||||
Reference in New Issue
Block a user