You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In version 4.7.0, we noticed that the reuse hash could change depending on the order of dictionary values. This has been fixed to ensure that dictionary values are processed in a consistent order when generating the reuse hash. As a result, the reuse hash will likely change again with 4.8.0.
Wait strategies now default to the Running mode. This mode expects the container to remain running throughout startup. If the container exits unexpectedly, Testcontainers will throw a ContainerNotRunningException that includes the exit code and container logs.
The container startup callback now includes an additional overload that provides the actual container configuration. If you implement IContainerBuilder<TBuilderEntity, TContainerEntity>, you need to add the container configuration (e.g., IContainerConfiguration) as a third generic type constraint to IContainerBuilder.
IContainerBuilder.WithResourceMapping and IContainer.CopyAsync now include two new optional arguments: uid and gid. If you do not need to specify those, use named arguments for the existing parameters: fileMode or ct.
Examine the package change in Directory.Packages.props
Search for Testcontainers usage in TUnit codebase
Analyze breaking changes impact
Review security implications
Assess performance considerations
Check test coverage implications
Provide final recommendations
Code Quality and Best Practices ✅
The dependency update itself is clean and follows the centralized package management pattern using Directory.Packages.props. The change is minimal and correctly updates only the Testcontainers.Kafka version.
Potential Bugs or Issues ⚠️
Breaking Changes Impact:
Wait Strategy Changes: The release notes indicate wait strategies now default to "Running" mode, which throws ContainerNotRunningException if containers exit unexpectedly.
Impact on TUnit: Found usage in KafkaUI.cs:23 with custom wait strategy UntilMessageIsLogged(".*Started KafkaUiApplication.*"). This should continue working but may have different error handling behavior.
Reuse Hash Changes: The reuse hash generation has been made consistent, which will likely break existing container reuse setups.
Impact on TUnit: May cause containers to be recreated instead of reused, potentially increasing test execution time on first run after upgrade.
API Changes: New parameters added to WithResourceMapping and CopyAsync methods (uid/gid).
Impact on TUnit: Current code doesn't use these methods, so no breaking changes detected.
Startup Callback Changes: New overload requiring configuration type parameter.
Impact on TUnit: No startup callbacks found in current usage, so no impact.
Security Concerns ✅
The update includes security improvements through better container lifecycle management
No security vulnerabilities introduced by the dependency update
Container isolation and cleanup remain robust
Performance Considerations ⚠️
Positive: Better container lifecycle management may improve resource cleanup
Negative: Hash changes will invalidate container reuse on first run, causing slower initial test execution
The "Running" mode wait strategy may provide faster failure detection for problematic containers
Test Coverage ✅
Current Testcontainers usage in TUnit is primarily in example/demo projects:
Usage patterns are simple and should remain compatible
No complex scenarios that would be affected by the breaking changes
Recommendations
✅ APPROVE - This is a low-risk dependency update with the following considerations:
Expected Behavior Changes:
Container reuse will be broken on first run (containers will be recreated)
More aggressive container failure detection due to "Running" mode wait strategies
Monitor After Merge:
Watch for increased test execution time on first CI run
Verify no unexpected container exit failures in integration tests
Future Considerations:
If using container reuse extensively, the hash change is a one-time impact
The improved error handling should provide better debugging for container issues
The codebase uses Testcontainers in a straightforward manner without relying on the affected advanced features. The breaking changes primarily impact complex container orchestration scenarios not present in TUnit's current usage.
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
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 PR contains the following updates:
4.7.0->4.8.0Release Notes
testcontainers/testcontainers-dotnet (Testcontainers.Kafka)
v4.8.0Compare Source
What's Changed
Thank you to all the contributors 🙌.
In version
4.7.0, we noticed that the reuse hash could change depending on the order of dictionary values. This has been fixed to ensure that dictionary values are processed in a consistent order when generating the reuse hash. As a result, the reuse hash will likely change again with4.8.0.Wait strategies now default to the
Runningmode. This mode expects the container to remain running throughout startup. If the container exits unexpectedly, Testcontainers will throw aContainerNotRunningExceptionthat includes the exit code and container logs.The container startup callback now includes an additional overload that provides the actual container configuration. If you implement
IContainerBuilder<TBuilderEntity, TContainerEntity>, you need to add the container configuration (e.g.,IContainerConfiguration) as a third generic type constraint toIContainerBuilder.IContainerBuilder.WithResourceMappingandIContainer.CopyAsyncnow include two new optional arguments:uidandgid. If you do not need to specify those, use named arguments for the existing parameters:fileModeorct.🚀 Features
WithTarget(string)to image builder (#1534) @HofmeisterAn🐛 Bug Fixes
db.runCommand({hello:1})do detect readiness (#1548) @HofmeisterAn📖 Documentation
IContainerBuilder.WithAutoRemovecode comment (#1546) @hojmark🧹 Housekeeping
UntilPortIsAvailable(int)(#1528) @HofmeisterAnConfiguration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Enabled.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR has been generated by Renovate Bot.