Files
mesh-sdk/go/process/reconnect_test.go
T
jochen cfa20f05ad
mesh/merge-gate head cfa20f05ad6d merged into trunk c8bd1370828a — pass, with a note: builds mesh-sdk (+41 dependent(s)) → ace, g14, novox, shanks; no bus …
mesh/repo-check head cfa20f05ad6d merged into trunk c8bd1370828a — pass: its merge-check.sh passed, each part in its toolchain: merge-check.sh (typescript)…
mesh/delivery delivered
Reconnect without limit, as the tool runner does, so a process outlives a bus restart (issue 1192, review round 1 finding 5)
2026-10-19 04:52:10 +02:00

28 lines
866 B
Go

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)
}
}