-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix monitoring server connz idle time sorting (#4463)
- Changed how [`byIdle`](https://github.com/nats-io/nats-server/blob/887a4ae692292c4efd95539993b7d665fea78ec5/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`](https://github.com/nats-io/nats-server/blob/8a9f441c40c43e5a5786506174d810bc559748aa/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
- Loading branch information
Showing
3 changed files
with
150 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters