-
-
Notifications
You must be signed in to change notification settings - Fork 36.5k
debugger: wait for target startup before initialization #64304
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,14 +5,18 @@ common.skipIfInspectorDisabled(); | |
|
|
||
| const fixtures = require('../common/fixtures'); | ||
| const startCLI = require('../common/debugger'); | ||
| const tmpdir = require('../common/tmpdir'); | ||
|
|
||
| const assert = require('assert'); | ||
| const fs = require('fs'); | ||
| const path = require('path'); | ||
|
|
||
| const cli = startCLI([fixtures.path('debugger/empty.js')]); | ||
| tmpdir.refresh(); | ||
|
|
||
| const rootDir = path.resolve(__dirname, '..', '..'); | ||
| const cli = startCLI( | ||
| [fixtures.path('debugger/empty.js')], | ||
| [], | ||
| { cwd: tmpdir.path }, | ||
| ); | ||
|
Comment on lines
+15
to
+19
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Archkon It appears to be needed only for the If it is needed for stress validation, it can remain only in the stress-test branch or workflow.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
Sorry, something went wrong.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Archkon The linked run still executes this test 1000 times. Normal CI executes it only once, so the Also, please leave this thread unresolved while this concern is still under discussion. |
||
|
|
||
| (async () => { | ||
| await cli.waitForInitialBreak(); | ||
|
|
@@ -25,7 +29,7 @@ const rootDir = path.resolve(__dirname, '..', '..'); | |
| await cli.command('profiles[0].save()'); | ||
| assert.match(cli.output, /Saved profile to .*node\.cpuprofile/); | ||
|
|
||
| const cpuprofile = path.resolve(rootDir, 'node.cpuprofile'); | ||
| const cpuprofile = tmpdir.resolve('node.cpuprofile'); | ||
| const data = JSON.parse(fs.readFileSync(cpuprofile, 'utf8')); | ||
| assert.strictEqual(Array.isArray(data.nodes), true); | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Archkon
Thanks for working on this!
Could you clarify why the timeout needs to be increased? If waitForDebugger() addresses the race condition, I would expect the timeout increase to be unnecessary.
Also, I think keeping the original timeout would make the stress test results more convincing, since otherwise it’s difficult to tell whether the improvement comes from waitForDebugger() or simply from the increased timeout.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Archkon
Thanks for clarifying. If
Debugger.pausedwas emitted but not received by the JavaScript layer within 15 seconds, could you share a failing run or trace showing that?Because the current stress runs include both changes, it is difficult to tell whether
waitForDebugger()alone resolves the issue.