kcp icon indicating copy to clipboard operation
kcp copied to clipboard

:seedling: Allow launching components from (sharded-)test-server with delve

Open embik opened this issue 6 months ago • 1 comments

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:

  1. Launch test-server or sharded-test-server:

    $ RUN_DELVE=1 ./bin/sharded-test-server 2>&1 | tee kcp.log
    
  2. Wait for dlv-cache.sock to appear, connect to it via dlv connect unix:dlv-cache.sock, set your breakpoints for the cache server and then hit c to start the cache server.

  3. Repeat (2) with dlv-kcp-0.sock and dlv-front-proxy.sock.

  4. 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

embik avatar Jul 30 '24 09:07 embik