kcp
kcp copied to clipboard
:seedling: Allow launching components from (sharded-)test-server with delve
Summary
When debugging e2e tests for shared and sharded setups, I struggled a bit with figuring out what was going on on the server side of the e2e tests. Tests I could launch via dlv
to debug them, but for the KCP server/cache/front-proxy side I needed to attach to the running processes or similar.
I added a new environment variable RUN_DELVE
to the test framework to launch the various processes not from binaries or from go run
, but from dlv debug
directly. The workflow is like this:
-
Launch
test-server
orsharded-test-server
:$ RUN_DELVE=1 ./bin/sharded-test-server 2>&1 | tee kcp.log
-
Wait for
dlv-cache.sock
to appear, connect to it viadlv connect unix:dlv-cache.sock
, set your breakpoints for the cache server and then hitc
to start the cache server. -
Repeat (2) with
dlv-kcp-0.sock
anddlv-front-proxy.sock
. -
The setup is running now, proceed with your e2e test or other options and wait for one of the connected delve clients to hit a breakpoint.
Same thing for test-server
, just with a single socket showing up.
This will
Related issue(s)
Fixes #
Release Notes
NONE