From 872fda179e247fb8e1bcc3cf2af3d892788a2e2f Mon Sep 17 00:00:00 2001 From: Noah Stapp Date: Tue, 15 Oct 2024 08:54:42 -0400 Subject: [PATCH] PYTHON-4574 - FaaS detection logic mistakenly identifies EKS as AWS Lambda (#1908) --- test/asynchronous/test_client.py | 16 ++++++++++++++++ test/test_client.py | 16 ++++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/test/asynchronous/test_client.py b/test/asynchronous/test_client.py index faa23348c..c6b6416c1 100644 --- a/test/asynchronous/test_client.py +++ b/test/asynchronous/test_client.py @@ -2019,6 +2019,22 @@ class TestClient(AsyncIntegrationTest): None, ) + async def test_handshake_09_container_with_provider(self): + await self._test_handshake( + { + ENV_VAR_K8S: "1", + "AWS_LAMBDA_RUNTIME_API": "1", + "AWS_REGION": "us-east-1", + "AWS_LAMBDA_FUNCTION_MEMORY_SIZE": "256", + }, + { + "container": {"orchestrator": "kubernetes"}, + "name": "aws.lambda", + "region": "us-east-1", + "memory_mb": 256, + }, + ) + def test_dict_hints(self): self.db.t.find(hint={"x": 1}) diff --git a/test/test_client.py b/test/test_client.py index be1994dd9..8e3d9c8b8 100644 --- a/test/test_client.py +++ b/test/test_client.py @@ -1977,6 +1977,22 @@ class TestClient(IntegrationTest): None, ) + def test_handshake_09_container_with_provider(self): + self._test_handshake( + { + ENV_VAR_K8S: "1", + "AWS_LAMBDA_RUNTIME_API": "1", + "AWS_REGION": "us-east-1", + "AWS_LAMBDA_FUNCTION_MEMORY_SIZE": "256", + }, + { + "container": {"orchestrator": "kubernetes"}, + "name": "aws.lambda", + "region": "us-east-1", + "memory_mb": 256, + }, + ) + def test_dict_hints(self): self.db.t.find(hint={"x": 1})