Skip to content

test(ffe): frame mocked CDN responses for fetch clients#7329

Draft
leoromanovsky wants to merge 1 commit into
mainfrom
leo.romanovsky/ffe-frame-agentless-mock-responses
Draft

test(ffe): frame mocked CDN responses for fetch clients#7329
leoromanovsky wants to merge 1 commit into
mainfrom
leo.romanovsky/ffe-frame-agentless-mock-responses

Conversation

@leoromanovsky

Copy link
Copy Markdown
Contributor

Motivation

Node.js built-in fetch rejects close-delimited HTTP response bodies when the connection terminates without an explicit framing signal. The agentless UFC mock merged in #7315 returned JSON bodies without Content-Length, so otherwise valid Node system tests failed while decoding the response.

Changes

  • Add Content-Length to mocked UFC configuration responses.
  • Add Content-Length to the mock's JSON status and error responses.
  • Verify the advertised configuration length in the fixture self-test.

Decisions

  • Keep this follow-up limited to standards-compliant HTTP response framing; the JSON:API payload, dd_env query contract, authentication checks, and request tracking remain unchanged.
  • Validate framing in the fixture's own TEST_THE_TEST scenario so SDK system tests can rely on the controlled CDN surface.

Validation

uv run --python 3.12 pytest -q -S TEST_THE_TEST tests/test_the_test/test_mock_ffe_agentless_backend.py
3 passed in 2.34s

Required by DataDog/dd-trace-js#9397.

@github-actions

Copy link
Copy Markdown
Contributor

CODEOWNERS have been resolved as:

tests/test_the_test/test_mock_ffe_agentless_backend.py                  @DataDog/feature-flagging-and-experimentation-sdk @DataDog/system-tests-core
utils/docker_fixtures/_mock_ffe_agentless_backend.py                    @DataDog/feature-flagging-and-experimentation-sdk @DataDog/system-tests-core

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant