package process import ( "testing" "github.com/nats-io/nats.go" ) // novox/hq issue 1192 (taken into this round, release 2's reviewer): Connect reconnects without limit, as // the tool runner does, so a process outlives a bus restart instead of giving up after the client // library's default of 60 attempts. Checked without a live bus: the option list Connect dials with is // applied to a scratch nats.Options and MaxReconnect read back. func TestConnectOptionsReconnectWithoutLimit(t *testing.T) { c := &Conn{account: Account{Node: "novox", Module: "mesh-mail", User: "novox.mesh-mail.send", Password: "pw"}} var o nats.Options for _, opt := range c.options(nil) { if opt == nil { continue } if err := opt(&o); err != nil { t.Fatal(err) } } if o.MaxReconnect != -1 { t.Errorf("MaxReconnect: %d, want -1 (no limit)", o.MaxReconnect) } }