Skip to content

Commit f80ec49

Browse files
committed
Possible Windows test fix
1 parent e971afd commit f80ec49

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

tests/test_minio_adapter.py

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,12 @@
3434
from servicex.minio_adapter import MinioAdapter
3535
from servicex.models import ResultFile
3636

37+
import asyncio
38+
3739
DOWNLOAD_PATCH_COUNTER = 0
3840

41+
_semaphore = asyncio.Semaphore(1)
42+
3943

4044
def mock_downloader(**args):
4145
global DOWNLOAD_PATCH_COUNTER
@@ -66,15 +70,16 @@ def minio_adapter(moto_services, moto_patch_session) -> MinioAdapter:
6670

6771
@fixture
6872
async def populate_bucket(request, minio_adapter):
69-
async with minio_adapter.minio.client(
70-
"s3", endpoint_url=minio_adapter.endpoint_host
71-
) as s3:
72-
await s3.create_bucket(Bucket=minio_adapter.bucket)
73-
await s3.put_object(
74-
Bucket=minio_adapter.bucket, Key=request.param, Body=b"\x01" * 10
75-
)
76-
yield
77-
await s3.delete_object(Bucket=minio_adapter.bucket, Key=request.param)
73+
async with _semaphore:
74+
async with minio_adapter.minio.client(
75+
"s3", endpoint_url=minio_adapter.endpoint_host
76+
) as s3:
77+
await s3.create_bucket(Bucket=minio_adapter.bucket)
78+
await s3.put_object(
79+
Bucket=minio_adapter.bucket, Key=request.param, Body=b"\x01" * 10
80+
)
81+
yield
82+
await s3.delete_object(Bucket=minio_adapter.bucket, Key=request.param)
7883

7984

8085
@fixture

0 commit comments

Comments
 (0)