Skip to content

test(proxy): add adversarial DAP scenario fixture - #545

Merged
debugmcpdev merged 2 commits into
debugmcp:mainfrom
debugmcpdev:test/adversarial-dap-fixture
Aug 28, 2026
Merged

test(proxy): add adversarial DAP scenario fixture#545
debugmcpdev merged 2 commits into
debugmcp:mainfrom
debugmcpdev:test/adversarial-dap-fixture

Conversation

@debugmcpdev

Copy link
Copy Markdown
Collaborator

Summary

  • add a deterministic TCP DAP scenario fixture behind the existing internal ProxyConfig.adapterCommand seam
  • cover dropped and delayed responses, event ordering, junk-stream resynchronization, duplicate responses, controlled connection closure, and adapters that never listen
  • make the proxy initialization deadline injectable for resilience tests while retaining the 30-second production default
  • document the fixture and its JSON scenario controls

Closes #511

Validation

  • pnpm run build
  • pnpm run lint
  • pnpm run test:unit (4,272 passed)
  • pnpm run test:integration (28 passed, 5 skipped)
  • pnpm run check:personal-paths
  • pnpm run check:all-personal-paths
  • git diff --check
  • node --check tests/fixtures/adversarial-adapter/server.mjs

The new integration suite drives the compiled proxy bootstrap, worker IPC, adapter process manager, real loopback TCP socket, MinimalDapClient, and shared DAP framing decoder. It verifies:

  • recovery when initialized arrives but the initialize response is absent
  • stage-aware diagnostics when launch is the stalled request
  • recovery from junk immediately followed by a valid response, while tolerating delayed events and a duplicate response
  • prompt failure on a mid-frame socket close
  • distinct diagnostics when the adapter spawned but never established its listening socket

Dogfooding

Used the source dev proxy to debug the new fixture itself with the JavaScript adapter. A statement breakpoint in the scenario dispatcher exposed the raw request and selected rule; locals and expression evaluation confirmed the delay, junk-prefix, and duplicate-response controls before stepping and continuing. A raw TCP request then received the fixture's adversarial output. The only shutdown warning reproduced the already-known #527 behavior covered by #542; no new unique defect was found.

Signed-off-by: JF <john.franklin@gmail.com>
@codecov

codecov Bot commented Aug 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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.

Test fixture: scriptable adversarial adapter for e2e failure-path coverage (drop/delay/corrupt chosen DAP frames)

2 participants