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

XUnit crashes on constrcution of AdminClient in debug #2388

Open
plachor opened this issue Dec 23, 2024 · 0 comments
Open

XUnit crashes on constrcution of AdminClient in debug #2388

plachor opened this issue Dec 23, 2024 · 0 comments

Comments

@plachor
Copy link

plachor commented Dec 23, 2024

Description

Possibly related issue: #2357, when:

  • bootstrap server is invalid
  • and you construct admin client specifying log handler
  • and you start debug
  • plus you are on linux (Ubuntu)
    than this test will crash xunit:
Exit code is 0

Last runner error: Process /usr/share/dotnet/dotnet:1045272 exited with code '0'.

--- EXCEPTION #1/1 [LoggerException]
Message = “Process /usr/share/dotnet/dotnet:1045272 exited with code '0'.”
StackTraceString = “
  at JetBrains.Util.ILoggerEx.LogMessage(ILogger logger, LoggingLevel level, String message) in LogMessage.il:line IL_002E mvid 6007
     at JetBrains.Util.ILoggerEx.Error(ILogger logger, String message) in Error.il:line IL_0000 mvid 6007
     at JetBrains.ReSharper.UnitTestFramework.Execution.TestRunner.TestRunnerRunStrategy.AnalyseProcessCrash(ProcessExitedUnexpectedlyException ex, IUnitTestRun run) in AnalyseProcessCrash.il:line IL_006B mvid 6F31

If you run

How to reproduce

using Confluent.Kafka;
using Microsoft.Extensions.Logging;
using NSubstitute;
using Xunit;

namespace ReproductionNamespace;

public class Reproduction
{
    [Fact]
    public void FailingOnDebug()
    {
        var logger = Substitute.For<ILogger<Reproduction>>();
        var adminClientBuilder = new AdminClientConfig();
        adminClientBuilder.BootstrapServers = "kafkainvalid:9092";
        
        // On debug this will crash xunit test runner
        var client = new AdminClientBuilder(config: adminClientBuilder)
            .SetLogHandler((_, message) => logger.LogError("a: {message}", message))
            .Build();
    } 
}

Dropping SetLogHandler or providing valid bootstrap server or running without debug works normally.
This is not reproducible on Windows host.

Checklist

Please provide the following information:

  • [Y] A complete (i.e. we can run it), minimal program demonstrating the problem. No need to supply a project file.
  • [2.6.1 ] Confluent.Kafka nuget version.
  • [-] Apache Kafka version.
  • [Y ] Client configuration.
  • [Linux] Operating system.
  • [N] Provide logs (with "debug" : "..." as necessary in configuration).
  • [N] Provide broker log excerpts.
  • [Y/N/?] Critical issue.
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

No branches or pull requests

1 participant