-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow more time in TestFileStoreNumPendingLargeNumBlks
#4515
Conversation
…ging on failure Signed-off-by: Neil Twigg <[email protected]>
@@ -133,6 +135,13 @@ func require_Len(t *testing.T, a, b int) { | |||
} | |||
} | |||
|
|||
func require_LessThan[T constraints.Ordered](t *testing.T, a, b T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In a future release when Go 1.22 is out we should change this to be cmp.Ordered
which would be included since Go 1.21? https://pkg.go.dev/cmp@master#Ordered
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes indeed!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
A generic test function was introduced in nats-io#4515 using `constraints.Ordered` from golang.org/x/exp/constaints. This unfortunately introduces further transitive dependencies on packages such as golang.org/x/tools which has versions with various breaking changes. This makes it more difficult to pull in nats-server in downstream projects. By inlining the trivial `ordered` definition, we can trim this dependency. An alternative to this change would be to downgrade the required version of golang.org/x/exp since the constraints package has been there (and unchanged) since 2022-02-02. Signed-off-by: Augusto Roman <[email protected]>
A generic test function was introduced in #4515 using `constraints.Ordered` from golang.org/x/exp/constaints. This unfortunately introduces further transitive dependencies on packages such as golang.org/x/tools which has versions with various breaking changes. This makes it more difficult to pull in nats-server in downstream projects. By inlining the trivial `ordered` definition, we can trim this dependency. An alternative to this change would be to downgrade the required version of golang.org/x/exp since the constraints package has been there (and unchanged) since 2022-02-02. Signed-off-by: Augusto Roman <[email protected]>
This should hopefully de-flake
TestFileStoreNumPendingLargeNumBlks
a bit. By adding a newrequire_LessThan
helper function, we also will produce a more meaningful log line that tells us what the bad values were if the test fails.Signed-off-by: Neil Twigg [email protected]