From 3969a4beeac718675ef124b03f0f6fbfe2712a8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CJan-Kazlouski-elastic=E2=80=9C?= Date: Fri, 4 Sep 2026 18:34:45 +0300 Subject: [PATCH 1/2] test(s3): mock AWS client in close-with-session test Stop test_close_with_client_session from making real ListBuckets calls. Assert close() tears down the AsyncExitStack instead. Co-authored-by: Cursor --- app/connectors_service/tests/sources/test_s3.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/app/connectors_service/tests/sources/test_s3.py b/app/connectors_service/tests/sources/test_s3.py index 9eb01f897..4d8e50e61 100644 --- a/app/connectors_service/tests/sources/test_s3.py +++ b/app/connectors_service/tests/sources/test_s3.py @@ -494,14 +494,16 @@ async def test_get_content_with_clienterror(): @pytest.mark.asyncio async def test_close_with_client_session(): """Test close method of S3DataSource with client session""" - async with create_s3_source() as source: - source.session = aioboto3.Session() - await source.s3_client.client() - - await source.close() - with pytest.raises(ClientError): - await source.ping() + with ( + mock.patch("aiobotocore.client.AioBaseClient", S3Object), + mock.patch( + "contextlib.AsyncExitStack.aclose", new_callable=mock.AsyncMock + ) as aclose_mock, + ): + await source.s3_client.client() + await source.close() + aclose_mock.assert_awaited_once() @pytest.mark.parametrize( From ecb8975fa00022bb2279e973123a622829d1388d Mon Sep 17 00:00:00 2001 From: Elastic Machine Date: Fri, 4 Sep 2026 15:43:26 +0000 Subject: [PATCH 2/2] Update NOTICE.txt --- app/connectors_service/NOTICE.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/connectors_service/NOTICE.txt b/app/connectors_service/NOTICE.txt index f24893e0b..1c0ba0ae1 100644 --- a/app/connectors_service/NOTICE.txt +++ b/app/connectors_service/NOTICE.txt @@ -1750,7 +1750,7 @@ SOFTWARE. anyio -4.14.2 +4.15.0 MIT The MIT License (MIT) @@ -4241,7 +4241,7 @@ Apache Software License google-auth -2.57.0 +2.57.1 Apache Software License Apache License Version 2.0, January 2004