Change RunDefaultContainerAndStopOnCleanup to use the interface testing.TB#48
Merged
oleg-nenashev merged 1 commit intowiremock:mainfrom May 4, 2025
Merged
Conversation
This probably shouldn't require a version bump since these functions will still accept a *testing.T as their argument. This allows test-containers to be used in benchmark setup code which can be useful when trying to benchmark http client code.
Contributor
Author
|
I have an in-mem caching http client I need to benchmark -- just the first request goes over the wire during setup. I could mock or inject at a more granular level, but then the profiling is less realistic. |
oleg-nenashev
approved these changes
May 4, 2025
Member
oleg-nenashev
left a comment
There was a problem hiding this comment.
Works on my machine, and thanks!
I plan some potentially planning to do some breaking changes in the next release too, so it should be fine in any case
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This allows test-containers to be used in benchmark setup code.
While it's generally recommended to isolate the code one is benchmarking, profiling the end to end logic of a handler can still reveal bottlenecks and extra memory allocations.
This change is backwards compatible, as *testing.T is an implementation of testing.TB.
References
Submitter checklist
#help-contributingor a project-specific channel like#wiremock-java