Skip to content

[Bug]: EventHub configuration produce errors #1429

@scrocquesel-ml150

Description

@scrocquesel-ml150

Testcontainers version

4.4.0

Using the latest Testcontainers version?

Yes

Host OS

Linux

Host arch

x86

.NET version

8

Docker version

N/A

Docker info

N/A

What happened?

var configuration = EventHubsServiceConfiguration
            .Create()
            .WithEntity("test", 2, [Azure.Messaging.EventHubs.Consumer.EventHubConsumerClient.DefaultConsumerGroupName]);

        var builder = new EventHubsBuilder()
            .WithAcceptLicenseAgreement(true)
            .WithConfigurationBuilder(configuration);

        _eventHubsContainer = builder.Build();

        await _eventHubsContainer.StartAsync();
  1. The default namespace name produce a "Recoverable validation failed" logs but this does not fail. We should change the default name to the valid one "emulatorns1".
  2. The emulator create a "$default" group and do not allow to specify it in the config. But the configuration validate that we must pass at least one consumer group which is not necessary if we use the default one.
  3. When the container stop due to a a bad configuration, testcontainer still wait for it to be ready.

Relevant log output

warn: HostHelper[0]
      Recoverable validation failed on user config:Expected string to be "emulatorns1" with a length of 11 because NamespaceName is non-modifiable.Only supported emulatorns1, but "ns-1" has a length of 4, differs near "ns-" (index 0).
Unhandled exception. FluentAssertions.Execution.AssertionFailedException: Expected string not to be equivalent to "$default" because Consumer group $default is internally created., but they are.

Additional information

I can push a PR for the first two points.
Some guidance on how should the wait strategy be modified so it detect the container has stopped is welcome.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions