Skip to content
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

Merged
merged 1 commit into from
Sep 12, 2023

Conversation

neilalexander
Copy link
Member

This should hopefully de-flake TestFileStoreNumPendingLargeNumBlks a bit. By adding a new require_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]

@neilalexander neilalexander requested a review from a team as a code owner September 12, 2023 10:04
@@ -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) {
Copy link
Member

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

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes indeed!

Copy link
Member

@wallyqs wallyqs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@neilalexander neilalexander merged commit d5fe492 into dev Sep 12, 2023
2 checks passed
@neilalexander neilalexander deleted the neil/largenumblks branch September 12, 2023 14:08
Copy link
Member

@derekcollison derekcollison left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

misterpickypants added a commit to augustoroman/nats-server that referenced this pull request Oct 25, 2023
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]>
derekcollison added a commit that referenced this pull request Oct 25, 2023
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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants