Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Development] Documentation for local debugging using dlv #183

Open
11 tasks
Olshansk opened this issue Aug 28, 2022 · 3 comments · May be fixed by #945
Open
11 tasks

[Development] Documentation for local debugging using dlv #183

Olshansk opened this issue Aug 28, 2022 · 3 comments · May be fixed by #945
Assignees
Labels
infra Core infrastructure - not protocol related tooling tooling to support development, testing et al

Comments

@Olshansk
Copy link
Member

Objective

Document how to use the dlv debugger in LocalNet.

Origin Document

The LocalNet CLI and logging are useful, but we need to be able to step through the code in unit tests and in a dev environment

Goals

  • Anyone who spins up a V1 LocalNet should be able to easily use the debugger, regardless of whether they have experience with it in the past
  • Support vscode and Goland as a first iteration

Deliverables

  • Documentation on how to use the dlv debugger using vscode
  • Documentation on how to use the dlv debugger using Goland
  • A gif or video with an example of how the debugger works
  • Modifications to the supporting tooling (config files, docker-compose files, etc if necessary)

Non-goals / Non-deliverables

  • Modifying the core protocol implementation
  • Enabling debugging in DevNet
  • Introducing any new telemetry to the codebase

General issue deliverables

  • Update the appropriate CHANGELOG
  • Update any relevant READMEs (local and/or global)
  • Update any relevant global documentation & references
  • If applicable, update the source code tree explanation
  • If applicable, add or update a state, sequence or flowchart diagram using mermaid

[Optional] Testing Methodology


Creator: @Olshansk
Co-Owners: @andrewnguyen22

@Olshansk Olshansk added priority:medium infra Core infrastructure - not protocol related tooling tooling to support development, testing et al labels Aug 28, 2022
@Olshansk Olshansk self-assigned this Aug 28, 2022
@Olshansk Olshansk moved this to Up Next in V1 Dashboard Sep 4, 2022
@Olshansk Olshansk changed the title [Development] Documentation for local debugging [Development] Documentation for local debugging using dlv Sep 7, 2022
@jessicadaugherty jessicadaugherty moved this from Up Next to Backlog in V1 Dashboard Oct 5, 2022
@Olshansk
Copy link
Member Author

Olshansk commented Mar 6, 2023

Copy pasting an idea from @bryanchriswhite to be documented in the docs in the future.

Screenshot 2023-03-06 at 3 25 42 PM

If anyone else finds themselves debugging a  flickering / flaky test, may I recommend this guide which blew my mind: 🤯 http://choly.ca/post/debugging-go-with-rr/

TLDR; `go test -c ... + rr + dlv`:
1. go test -c ... builds a test binary which can be run by another program or script
2. rr runs in a loop (with the test) until produces a failure once. 
3. The captured execution trace can then be replayed deterministically and debugged with dlv. 🤙 

@Olshansk Olshansk moved this from Backlog to Up Next in V1 Dashboard Jun 14, 2023
@Olshansk
Copy link
Member Author

Olshansk commented Jul 24, 2023

@red-0ne Are you down to take on this ticket given the other work you've been doing?

@red-0ne
Copy link

red-0ne commented Jul 25, 2023

Yes, dlv in unit tests are already working and helpful, would love to document it and take a look at the LocalNet scenario 👍

@red-0ne red-0ne linked a pull request Jul 27, 2023 that will close this issue
20 tasks
@red-0ne red-0ne moved this from Up Next to In Progress in V1 Dashboard Aug 4, 2023
@red-0ne red-0ne moved this from In Progress to In Review in V1 Dashboard Aug 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
infra Core infrastructure - not protocol related tooling tooling to support development, testing et al
Projects
Status: In Review
Development

Successfully merging a pull request may close this issue.

2 participants