Skip to content

Commit

Permalink
Sls 3243 net timeout (#167)
Browse files Browse the repository at this point in the history
* add wrong url

* set timeout different from 5s extension timeout

* add: dockerfile to simulate unreachable dd

* reset original dockerfile
  • Loading branch information
alexgallotta authored Sep 11, 2023
1 parent 9b4e509 commit cfdca5b
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 1 deletion.
2 changes: 1 addition & 1 deletion local_tests/invoke.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
NB_INVOKE=$1

# Start the container
dockerId=$(docker run -d -p 9000:8080 -p 127.0.0.1:8124:8124 datadog/extension-local-tests)
dockerId=$(docker run -d -e AWS_LAMBDA_FUNCTION_TIMEOUT=7 -p 9000:8080 -p 127.0.0.1:8124:8124 datadog/extension-local-tests)

# Curl it!
i=0
Expand Down
29 changes: 29 additions & 0 deletions local_tests/python-timeout.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
FROM public.ecr.aws/lambda/python:3.9

# Add Datadog library
COPY python /opt/python

# Copy customer code
COPY func.py /var/task/

# Copy both the datadog extension and the recorder one
RUN mkdir -p /opt/extensions
COPY recorder-extension /opt/extensions/
COPY datadog-agent /opt/extensions/

# Make sure that the extension will send the payload to the man in the middle
# (recorder extension is listenning on 3333)
ENV DD_API_KEY=NO_NEED_TO_BE_VALID
# ENV DD_APM_DD_URL=http://127.0.0.1:3333
# ENV DD_DD_URL=http://127.0.0.1:3333
ENV DD_SITE=wrongurl.com:123
ENV DD_LAMBDA_HANDLER=func.handler
# ENV DD_LOGS_CONFIG_LOGS_DD_URL=127.0.0.1:3333
# ENV DD_LOGS_CONFIG_LOGS_NO_SSL=true
ENV DD_LOG_LEVEL=DEBUG
ENV DD_MERGE_XRAY_TRACES=false
ENV DD_SERVICE=integration-test-service
ENV DD_TRACE_ENABLED=true
ENV DD_LOCAL_TEST=1

CMD [ "datadog_lambda.handler.handler" ]

0 comments on commit cfdca5b

Please sign in to comment.