Skip to content

Conversation

@MattKotsenas
Copy link
Contributor

What does this PR do?

The Kusto wait strategy uses the default encoding. For .NET Framework, this resolves to Windows-1252, which causes the Kusto emulator to return a 415 Media Type not Supported error. In .NET Core, it is UTF-8.

This allows .NET Framework tests to run by setting the encoding to always be UTF-8.

Why is it important?

Required to use Testcontainers in a .NET Framework app. Otherwise, the Testcontainer waits forever.

The Kusto wait strategy uses the default encoding. For .NET Framework, this resolves to Windows-1252, which causes the Kusto emulator to return a 415 Media Type not Supported error. In .NET Core, it is UTF-8.

This allows .NET Framework tests to run by setting the encoding to always be UTF-8.
@netlify
Copy link

netlify bot commented Nov 9, 2025

Deploy Preview for testcontainers-dotnet ready!

Name Link
🔨 Latest commit eb4016d
🔍 Latest deploy log https://app.netlify.com/projects/testcontainers-dotnet/deploys/691072f176cac50008363d59
😎 Deploy Preview https://deploy-preview-1567--testcontainers-dotnet.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@coderabbitai
Copy link

coderabbitai bot commented Nov 9, 2025

Summary by CodeRabbit

  • Bug Fixes
    • Fixed character encoding handling for Kusto emulator requests to ensure proper data transmission and compatibility.

Walkthrough

The Kusto emulator HTTP request encoding was changed from the platform default (Encoding.Default) to UTF-8 for the JSON payload used in POST requests; the JSON content itself and all other logic remain unchanged.

Changes

Cohort / File(s) Summary
HTTP request encoding standardization
src/Testcontainers.Kusto/KustoBuilder.cs
Replaced Encoding.Default with Encoding.UTF8 when creating StringContent for Kusto emulator POST requests. No other logic or public signatures changed.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

  • Single-line, single-file change limited to encoding parameter.
  • Files to spot-check: src/Testcontainers.Kusto/KustoBuilder.cs.

Poem

🐰 In bytes I hop from default to UTF-8,

The JSON travels tidy, uniform and neat,
No more surprises from platform skies,
A smaller jump, yet ever wise —
🥕 code snug, and tests complete.

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description check ✅ Passed The PR description covers the mandatory sections (What and Why) with clear technical context about the encoding issue and its impact on .NET Framework compatibility.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Title check ✅ Passed The title clearly and concisely summarizes the main change: fixing the Kusto wait strategy to use UTF-8 encoding instead of default encoding, which directly addresses the issue described in the PR objectives.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@HofmeisterAn HofmeisterAn changed the title Set Kusto wait encoding to UTF8 fix: Set Kusto wait strategy encoding to UTF-8 Nov 9, 2025
@HofmeisterAn HofmeisterAn added the bug Something isn't working label Nov 9, 2025
Copy link
Collaborator

@HofmeisterAn HofmeisterAn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! That's something we should update across the whole repo.

@HofmeisterAn HofmeisterAn merged commit bfa1fb9 into testcontainers:develop Nov 9, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants