-
Notifications
You must be signed in to change notification settings - Fork 10
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
How to ensure the readiness of the Azure Service Bus Emulator? #35
Comments
First of all, it's great to know you're already working on this, @HofmeisterAn . Unfortunately, I came across the same issue with the queue intermittently existing or not existing. I think the problem is more frequent when running in the pipeline. https://github.com/NelsonBN/demo-servicebus-emulator-dotnet/actions Maybe because when running locally in debug mode or with all the test tools of Visual Studio, the process is slower, giving the queues enough time to be ready. The best solution I've found so far is using a delay. https://github.com/NelsonBN/demo-servicebus-emulator-dotnet/blob/5a6f138882a8b1e619826d750d9ab843e402934b/tests/Demo.Tests/Config/IntegrationTestsFactory.cs#L72 I've added logs to ensure the container is ready before creating a message, but the only logs I see are: It would be really important to have either a health check endpoint or, for example, for the message "Emulator Service is Successfully Up!" to only appear when the queues and topics are actually ready to be used. |
@HofmeisterAn ; Currently there is no internal health check present in both EH and SB Emulator and the log line is supposed to signal readiness. The log line signaling the Emulator is ready to receive requests is off by few seconds (ideally 0.5s) due to internal design of the Emulator. We are tracking this as an active bug for future release along with a health check API. Suggestion by @NelsonBN is one way out till this issue is patched. |
The emulator is based on : Platform:CBL-Mariner/Linux,X64 Which is a Linux distribution created by Microsoft’s Linux System Group which is the same team at Microsoft which created the Linux kernel used for Windows Subsystem for Linux version 2, or WSL2.
Problem with this Microsoft gift are os doesn't have a package manageros doesn't have /bin/bash or /bin/shThat why even the simple RUN doesn't work
workaround Using busybox to get some useful binaries
|
Hi 👋 the Testcontainers community recently asked about an Azure Service Bus Emulator module, and it seems like many developers are looking forward to it. I decided to look into it and started working on adding the module. I set up a configuration similar to the referenced Docker Compose file, and the emulator container starts up fine without any errors 👍.
However, I ran into an issue. When I send a message to channel
queue.1
, I get an error.At first, I thought my setup might be incorrect or that I needed to configure the client specifically for the local environment. But after trying all sorts of things, I realized that simply waiting a bit longer before sending the message makes the test succeed.
The module currently uses log message
Emulator Service is Successfully Up!
to detect and indicate readiness. The problem is that if I send the message right after the log message appears, the test fails. But if I wait just a little longer, the test works. It seems like the log message is being written before the service is actually ready to process requests.Do you have any guidance on how to detect if the service is ready to process requests?
Steps to reproduce:
git clone -b feature/add-azure-service-bus-emulator [email protected]:testcontainers/testcontainers-dotnet.git
cd testcontainers-dotnet
ServiceBusContainerTest
testThe text was updated successfully, but these errors were encountered: