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

Inspector profiling can't be stopped or viewed after script finishes running #14432

Closed
not-an-aardvark opened this issue Jul 23, 2017 · 1 comment · Fixed by #14463
Closed
Assignees
Labels
inspector Issues and PRs related to the V8 inspector protocol

Comments

@not-an-aardvark
Copy link
Contributor

  • Version: Node 8.2.1, Chrome 59.0.3071.115
  • Platform: macOS Sierra (10.12.5)
  • Subsystem: inspector

When using the Profiler to measure performance in Chrome, it seems to be impossible to stop the profiler and view the data after the script has finished running.

Reproduction:

  1. Create a file (chrome-inspector-test.js) that runs for 5 seconds and then exits:

    'use strict';
    
    const fiveSecondsFromNow = Date.now() + 5000;
    
    while (Date.now() < fiveSecondsFromNow) {
      // do nothing
    }
  2. Run it with node --inspect-brk chrome-inspector-test.js

  3. Go to chrome://inspect in Chrome

  4. Under "Remote Target" and "chrome-inspector-test.js", click "inspect".

  5. In the new window, go to the "Profiler" tab and click "Start".

  6. Wait for more than 5 seconds.

  7. Click "Stop".

Expected behavior: After clicking "Stop", the profile should stop recording, and it should be possible to see the performance data.

Actual behavior: After clicking "Stop", the devtools window gets stuck looking like this. It's not possible to switch tabs. Profile 1 still appears to be recording, and it doesn't seem to be possible to stop it. The Node process is still running, and has printed "Waiting for the debugger to disconnect...".

If the test is repeated and "Stop" is clicked after fewer than 5 seconds (i.e. while the script is still running), profiling works as expected: the profile stops recording, and it's possible to see the performance data.

@not-an-aardvark not-an-aardvark added the inspector Issues and PRs related to the V8 inspector protocol label Jul 23, 2017
@not-an-aardvark not-an-aardvark changed the title Inspector profiling can't be stopped or viewed after script finished running Inspector profiling can't be stopped or viewed after script finishes running Jul 23, 2017
@mscdex
Copy link
Contributor

mscdex commented Jul 23, 2017

/cc @nodejs/v8-inspector

@eugeneo eugeneo self-assigned this Jul 24, 2017
addaleax pushed a commit that referenced this issue Jul 27, 2017
Fixes: #14432
PR-URL: #14463
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
inspector Issues and PRs related to the V8 inspector protocol
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants