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

Unit test in client module fails on some systems because it runs too fast (1.6.x) #1950

Closed
miklish opened this issue Nov 1, 2023 · 2 comments

Comments

@miklish
Copy link
Collaborator

miklish commented Nov 1, 2023

PR: #1951

The com.networknt.client.Http2ClientPoolTest.testResponseTime fails in the client module since the test is able to complete in less than 1 ms on some systems. Since the speed (in ms) is casted to a long, this sub-1ms runtime is converted to 0L, which causes the following check to fail:

Assert.assertTrue(ar.result().getResponseTime() > 0);

Solution is to change this line of code to:

Assert.assertTrue(ar.result().getResponseTime() >= 0);

In the same module, an identical check is made in the Http2ClientPoolTest.testResponseTime() unit test. This is also fixed to allow a time of 0L.

@miklish
Copy link
Collaborator Author

miklish commented Nov 1, 2023

@stevehu FYI: A PR has been created to fix this

PR: #1951

@stevehu
Copy link
Contributor

stevehu commented Nov 1, 2023

Merged and built OK on my local. Thanks for the fix.

@stevehu stevehu closed this as completed Nov 1, 2023
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

No branches or pull requests

2 participants