From f3dbc6b49c08883ac24b5faf09d03d621c1ad95f Mon Sep 17 00:00:00 2001 From: Enrico Donnici Date: Tue, 19 Nov 2024 08:40:20 +0100 Subject: [PATCH] Speed Up Trace Uploads in GHA (#19078) * Run the master PR on pull requests for testing * Log less while replaying traces. * Fix response printing. * Better fix for ResponseNotReady * Set the agent log level to "warn" for uploading traces. * Remove testing code. --- .ddev/ci/scripts/traces.py | 6 +++--- .github/workflows/submit-traces.yml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.ddev/ci/scripts/traces.py b/.ddev/ci/scripts/traces.py index 0d4ff11917563..0210b9bc73caa 100644 --- a/.ddev/ci/scripts/traces.py +++ b/.ddev/ci/scripts/traces.py @@ -40,10 +40,10 @@ def replay(*, record_file: str, port: int) -> None: record = json.loads(line) path = record['path'] body = b64decode(record['body']) - - print(f'PUT {path} {len(body)} bytes: ', end='') conn.request('PUT', path, body=body, headers=record['headers']) - print(conn.getresponse().read().decode('utf-8')) + response = conn.getresponse() + response.read() # Needs to be done to prevent ResponseNotReady. + print(response.status, response.reason) def main(): diff --git a/.github/workflows/submit-traces.yml b/.github/workflows/submit-traces.yml index c972794b20284..865471add95d9 100644 --- a/.github/workflows/submit-traces.yml +++ b/.github/workflows/submit-traces.yml @@ -21,7 +21,7 @@ jobs: DD_API_KEY: "${{ secrets.DD_API_KEY }}" DD_HOSTNAME: "none" DD_INSIDE_CI: "true" - DD_LOG_LEVEL: "trace" + DD_LOG_LEVEL: "warn" steps: - uses: actions/checkout@v4