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

Fix delay tests #36

Merged
merged 1 commit into from
Dec 20, 2023
Merged

Fix delay tests #36

merged 1 commit into from
Dec 20, 2023

Conversation

edeandrea
Copy link
Contributor

@edeandrea edeandrea commented Dec 19, 2023

Fix unit tests introduced by #31 which can now be exercised by #34.

@edeandrea
Copy link
Contributor Author

Stopwatch.elapsed(TimeUnit) loses precision if there are fractional units. From the Stopwatch.elapsed(TimeUnit) docs:

Returns the current elapsed time shown on this stopwatch, expressed in the desired time unit, with any fraction rounded down.

Note: the overhead of measurement can be more than a microsecond, so it is generally not useful to specify TimeUnit.NANOSECONDS precision here.

It is generally not a good idea to use an ambiguous, unitless long to represent elapsed time. Therefore, we recommend using elapsed() instead, which returns a strongly-typed Duration instance.

@edeandrea edeandrea changed the title Attempt to fix delay tests Fix delay tests Dec 19, 2023
@tomakehurst tomakehurst merged commit 97c103d into wiremock:main Dec 20, 2023
7 checks passed
@edeandrea edeandrea deleted the patch-3 branch December 20, 2023 15:04
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.

2 participants