testcontainers / testcontainers/testcontainers-python

Bug: Azurite unable to run create_container

Open
#761 7 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
2.3k
Forks
386
Avg merge
4h 40m
Merged PRs (30d)
1

Description

Describe the bug

when using a Blob Service Client on a Azurite container, an azure blob storage container cannot be created, thus testing that requires containers cannot continue. E.g. get_blob_client and upload_blob requires a container.

To Reproduce

Provide a self-contained code snippet that illustrates the bug or unexpected behavior. Ideally, send a Pull Request to illustrate with a test that illustrates the problem.

The last line here just hangs indefinitely, unable to proceed further

from azure.storage.blob import BlobServiceClient
from testcontainers.azurite import AzuriteContainer

with AzureContainer() as azurite_container:
    connection_string = azurite_container.get_connection_string()
    service_client = BlobServiceClient.from_connection_string(connection_string)
    service_client.create_container(name="test")

Runtime environment

  • M2 Pro, sonoma 14.7
  • Python 3.12.3
  • Docker 4.37.2
  • Testcontainers 4.9.0 (via poetry)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the AzuriteContainer entry point and reproduce the hang using BlobServiceClient.create_container as shown. Check the container connection string and startup behavior first; done means create_container returns successfully so subsequent get_blob_client and upload_blob operations can proceed, with a regression test covering the reproduction.

Written by the indexing model from the issue text.

Assessment

Tech stack
azure, docker, python
Domain
cloud, testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.