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

Go test profiling: run test with race detector #3269

Open
firelizzard18 opened this issue Mar 21, 2024 · 1 comment
Open

Go test profiling: run test with race detector #3269

firelizzard18 opened this issue Mar 21, 2024 · 1 comment

Comments

@firelizzard18
Copy link
Contributor

Is your feature request related to a problem? Please describe.
Interpreting the output of go test -race is somewhat cumbersome. It would be really nice if the extension's test support detected race warnings and displayed them somehow.

Describe the solution you'd like

  1. Provide a user action for running a test or tests with the race detector.
    • Option: When the user executes the "Go Test: Profile" context menu action on a test, add "Race detector" to the list of actions.
    • Option: A separate context menu action under "Go Test: Profile".
    • Option: A configuration option to always run tests with -race, or just reuse test flags.
  2. Run the test with -race.
  3. Parse the WARNING: DATA RACE sections out of the output.
  4. Present races to the user.
    • Option: Use the profile viewer: Add the test run as a "profile", with the races as children of it, and the write and previous write as children of each race.
    • Option: Can we reuse the diagnostics that are used for presenting error messages? This has the advantage of being integrated into vscode, showing the code location, and making it easy to show the full stack, but has the disadvantage of not clearly associating the two writes with each other (as in I can't think of a good way to do that).

Describe alternatives you've considered
Using the race detector manually.

@firelizzard18
Copy link
Contributor Author

@hyangah This idea just popped into my head. Thoughts? The mechanical side - pulling the race warnings out of the output stream and parsing them - wouldn't be too difficult. It's the UX side where I'm kind of stuck.

@gopherbot gopherbot added this to the Untriaged milestone Mar 21, 2024
@adonovan adonovan modified the milestones: Untriaged, vscode-go/backlog Mar 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants