Skip to content

Conversation

@thomhurst
Copy link
Owner

This PR contains the following updates:

Package Type Update Change
Testcontainers.Kafka (source) nuget minor 4.7.0 -> 4.8.0

Release Notes

testcontainers/testcontainers-dotnet (Testcontainers.Kafka)

v4.8.0

Compare 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 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.

⚠️ Breaking Changes

🚀 Features

🐛 Bug Fixes

📖 Documentation

🧹 Housekeeping


Configuration

📅 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.


  • If you want to rebase/retry this PR, check this box

This PR has been generated by Renovate Bot.

@thomhurst thomhurst added dependencies Pull requests that update a dependency file MINOR renovate-bot labels Oct 19, 2025
@thomhurst thomhurst enabled auto-merge (squash) October 19, 2025 14:39
@claude
Copy link
Contributor

claude bot commented Oct 19, 2025

Claude finished @thomhurst's task —— View job


PR Review: Testcontainers.Kafka 4.7.0 → 4.8.0

Review Tasks:

  • 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:

  1. 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.
  2. 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.
  3. 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.
  4. 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:

  • TUnit.Example.Asp.Net.TestProject - Kafka, PostgreSQL, Redis containers
  • 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:

  1. 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
  2. Monitor After Merge:

    • Watch for increased test execution time on first CI run
    • Verify no unexpected container exit failures in integration tests
  3. 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.


@thomhurst thomhurst merged commit 351242b into main Oct 19, 2025
12 of 13 checks passed
@thomhurst thomhurst deleted the renovate/testcontainers.kafka-4.x branch October 19, 2025 15:02
This was referenced Oct 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file MINOR renovate-bot

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants