`TestMQTTQoS2InflightMsgsDeliveredAfterUnsubscribe` was flaky on
TravisCI.
At this point it was there to illustrate a design issue with MQTT 3.1.1
QoS support, and much of it is disabled since it'd be failing anyway.
Disabling the test until it can be _fully_ applicable/enabled.
- Use Go 1.21 in nightlies
- Both rand.Seed and rand.Read are both deprecated, remove its use to
fix staticcheck errors
```go
server/client.go:95:2: SA1019: rand.Seed has been deprecated since Go 1.20 and an alternative
has been available since Go 1.0: As of Go 1.20 there is no reason to call Seed with a random value.
Programs that call Seed with a known value to get a specific sequence of results should use
New(NewSource(seed)) to obtain a local random generator. (staticcheck)
server/jetstream_test.go:20399:2: SA1019: rand.Read has been deprecated since Go 1.20
because it shouldn't be used: For almost all use cases, crypto/rand.Read is more appropriate. (staticcheck)
```
In +Go 1.20, the x509.HostnameError changed to be wrapped in a
tls.CertificateVerificationError so sometimes the name would not
be reset.
This would make the `TestGatewayTLSMixedIPAndDNS` test flake sometimes.
Signed-off-by: Waldemar Quevedo <wally@nats.io>
- [x] Branch rebased on top of current main (`git pull --rebase origin
dev`)
- [x] Changes squashed to a single commit (described
[here](http://gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html))
- [ ] Build is green in Travis CI
### Changes proposed in this pull request:
Removed `qos2` reference from the MQTT outgoing stream name and
subjects.
Rationale: As I was reviewing the documentation and thinking how to move
forward with MQTT, I am inclined to use the `$MQTT_out` stream and
session-specific consumers (as opposed to subscription-specific) for all
QOS-related packet delivery and PI persistence. I think I will be able
to repurpose it "as is", so proposing the generic name change.
Since these (stream, consumer, subscriptions) are newly introduced in
https://github.com/nats-io/nats-server/pull/4349 and have not yet been
released, this is a safe change.
This uses `TempDir` in more tests. Some were trying to manage the
directory manually, others were just not managing a directory at all.
There may be more that need doing.
Signed-off-by: Neil Twigg <neil@nats.io>
- [X] Link to issue, e.g. `Resolves #NNN`
- [X] Branch rebased on top of current main (`git pull --rebase origin
main`)
- [X] Changes squashed to a single commit (described
[here](http://gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html))
- [X] Build is green in Travis CI
- [X] You have certified that the contribution is your original work and
that you license the work to the project under the [Apache 2
license](https://github.com/nats-io/nats-server/blob/main/LICENSE)
Resolves#4459
Allows the user to set the deduplication window duration to 0s when the
stream has sources defined. Remember that if the stream in question is
also listening on subjects as well as sourcing the deduplication window
is the same for sourced and listened messages.
---------
Signed-off-by: Jean-Noël Moyne <jnmoyne@gmail.com>
- Changed how [`byIdle`](887a4ae692/server/monitor_sort_opts.go (L97))
struct compares the idle times (was subtracting the start time from the last activity time).
- Added tests for `byIdle`.
- Changed and simplified the test
[`TestConnzSortedByIdle`](8a9f441c40/server/monitor_test.go (L1185))
(No need for the clients to publish and subscribe if we are manually
changing the client's `last` time, and we only need to test the sorting
order). Also the test was not catching the problem because the clients
`start` time was the same, now every client has a different start time.
Resolves#4462