Set defaultServerOptions port to -1 for random

Updated some tests based on this change but also missing defer
connection close or server shutdown.

Fixed how the OCSP run go routine would shutdown, which would
never complete because grWG was not decremented by this go routine
prior to invoking s.Shutdown()

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
This commit is contained in:
Ivan Kozlovic
2021-09-02 12:27:34 -06:00
parent 219a7c984c
commit a025ce7472
11 changed files with 207 additions and 176 deletions

View File

@@ -393,7 +393,7 @@ func TestNoRaceQueueSubWeightOrderMultipleConnections(t *testing.T) {
<-start
// Now create 100 identical queue subscribers on each connection.
for i := 0; i < 100; i++ {
if _, err := nc.QueueSubscribeSync("foo", "bar"); err != nil {
if _, err := nc.QueueSubscribe("foo", "bar", func(_ *nats.Msg) {}); err != nil {
return
}
}