Skip to content

Commit 5d88269

Browse files
committed
De-flake TestLeafNodePermissionWithLiteralSubjectAndQueueInterest
Signed-off-by: Neil Twigg <[email protected]>
1 parent 3ff0a9d commit 5d88269

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

server/leafnode_test.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9965,7 +9965,13 @@ func TestLeafNodePermissionWithLiteralSubjectAndQueueInterest(t *testing.T) {
99659965
ncHub := natsConnect(t, hub.ClientURL(), nats.UserInfo("user", "pwd"))
99669966
defer ncHub.Close()
99679967

9968-
resp, err := ncHub.Request("my.subject", []byte("hello"), time.Second)
9969-
require_NoError(t, err)
9968+
var resp *nats.Msg
9969+
var err error
9970+
checkFor(t, 5*time.Second, time.Second, func() error {
9971+
// Make sure we don't fail the test on the first "no responders", might
9972+
// take time for the sub to propagate.
9973+
resp, err = ncHub.Request("my.subject", []byte("hello"), time.Second)
9974+
return err
9975+
})
99709976
require_Equal(t, "OK", string(resp.Data))
99719977
}

0 commit comments

Comments
 (0)