Title: debugger: preserve probe failure attribution by trivikr · Pull Request #64102 · nodejs/node · GitHub
Open Graph Title: debugger: preserve probe failure attribution by trivikr · Pull Request #64102 · nodejs/node
X Title: debugger: preserve probe failure attribution by trivikr · Pull Request #64102 · nodejs/node
Description: parallel/test-debugger-probe-failure-process-exit can be flaky when a
probe expression exits the target while Debugger.evaluateOnCallFrame is
pending.
An older overlapping CDP request can clear the shared inFlight state before
the probe evaluation failure is recorded. When that happens, the failure is
reported as if the probe never ran, leaving it in pending, instead of
recording the expected failed probe hit.
This PR keeps the CDP in-flight context local to each callCdp() invocation
and passes it explicitly into failure reporting. Also it clears this.inFlight only if
the finishing call still owns the current in-flight state.
Refs: https://github.com/nodejs/reliability/issues?q="test-debugger-probe-failure-process-exit"
Example
not ok 636 parallel/test-debugger-probe-failure-process-exit
---
duration_ms: 628.15400
severity: fail
exitcode: 1
stack: |-
[process 631511]: --- stderr ---
INSPECT_PROBE 631511: child stderr: "Debugger listening on ws://127.0.0.1:40237/395b9597-9abd-4a28-bb14-0a569e12a20b\nFor help, see: https://nodejs.org/learn/getting-started/debugging\n"
INSPECT_PROBE 631511: CDP -> Runtime.enable
INSPECT_PROBE 631511: child stderr: "Debugger attached.\n"
INSPECT_PROBE 631511: CDP <- Runtime.enable (success)
INSPECT_PROBE 631511: CDP -> Debugger.enable
INSPECT_PROBE 631511: CDP <- Debugger.enable (success)
INSPECT_PROBE 631511: CDP -> Debugger.setBreakpointByUrl
INSPECT_PROBE 631511: CDP <- Debugger.setBreakpointByUrl (success)
INSPECT_PROBE 631511: breakpoint set: id=2:7:0:^(.*[\/\\])?probe-exits-during-probe\.js$ urlRegex=^(.*[\/\\])?probe-exits-during-probe\.js$ locations=[]
INSPECT_PROBE 631511: CDP -> Runtime.runIfWaitingForDebugger
INSPECT_PROBE 631511: CDP <- Runtime.runIfWaitingForDebugger (success)
INSPECT_PROBE 631511: scriptParsed: scriptId=88 url=file:///home/iojs/build/workspace/node-test-commit-linuxone/test/fixtures/debugger/probe-exits-during-probe.js, length=130
INSPECT_PROBE 631511: paused: finished=0, reason=Break on start hitBreakpoints=[]
INSPECT_PROBE 631511: CDP -> Debugger.resume
INSPECT_PROBE 631511: paused: finished=0, reason=other hitBreakpoints=["2:7:0:^(.*[\\/\\\\])?probe-exits-during-probe\\.js$"]
INSPECT_PROBE 631511: CDP -> Debugger.evaluateOnCallFrame, probe=0
INSPECT_PROBE 631511: CDP <- Debugger.resume (success)
INSPECT_PROBE 631511: child stderr: "Waiting for the debugger to disconnect...\n"
INSPECT_PROBE 631511: disconnect sentinel detected, resetting client
INSPECT_PROBE 631511: CDP <- Debugger.evaluateOnCallFrame error: ERR_DEBUGGER_ERROR
INSPECT_PROBE 631511: recordInspectorFailure "Target process exited during probe evaluation": inFlight=null, lastProbeIndex=null, cdpError=undefined
INSPECT_PROBE 631511: finish: exitCode=1, terminal=error
[process 631511]: --- stdout ---
{"v":2,"probes":[{"expr":"exitDuringProbe()","target":{"suffix":"probe-exits-during-probe.js","line":8}}],"results":[{"event":"error","pending":[0],"error":{"code":"probe_failure","message":"Target process exited during probe evaluation before probes: probe-exits-during-probe.js:8. If the failure repeats, review the probe expression.","stderr":""}}]}
[process 631511]: status = 1, signal = null
/home/iojs/build/workspace/node-test-commit-linuxone/test/common/child_process.js:112
throw error;
^
Error: - stdout did not match expectation, checker throws:
AssertionError [ERR_ASSERTION]: Expected values to be strictly deep-equal:
+ actual - expected
... Skipped lines
{
probes: [
{
expr: 'exitDuringProbe()',
target: {
...
error: {
- message: 'Probe evaluation did not complete'
- },
- event: 'hit',
- hit: 1,
- location: {
- column: 1,
- line: 8,
- url: 'file:///home/iojs/build/workspace/node-test-commit-linuxone/test/fixtures/debugger/probe-exits-during-probe.js'
- },
- probe: 0
- },
- {
- error: {
code: 'probe_failure',
+ message: 'Target process exited during probe evaluation before probes: probe-exits-during-probe.js:8. If the failure repeats, review the probe expression.',
- details: {
- lastCdpMethod: 'Debugger.evaluateOnCallFrame'
- },
- message: 'Target process exited during probe evaluation. If the failure repeats, review the probe expression.',
- probe: 0,
stderr: ''
},
event: 'error',
+ pending: [
+ 0
+ ]
- pending: []
}
],
v: 2
}
at assertProbeJson (/home/iojs/build/workspace/node-test-commit-linuxone/test/common/debugger-probe.js:65:10)
at stdout (/home/iojs/build/workspace/node-test-commit-linuxone/test/parallel/test-debugger-probe-failure-process-exit.js:25:5)
at checkOutput (/home/iojs/build/workspace/node-test-commit-linuxone/test/common/child_process.js:52:7)
at expectSyncExit (/home/iojs/build/workspace/node-test-commit-linuxone/test/common/child_process.js:129:32)
at spawnSyncAndExit (/home/iojs/build/workspace/node-test-commit-linuxone/test/common/child_process.js:143:10)
at Object.
Open Graph Description: parallel/test-debugger-probe-failure-process-exit can be flaky when a probe expression exits the target while Debugger.evaluateOnCallFrame is pending. An older overlapping CDP request can clear the...
X Description: parallel/test-debugger-probe-failure-process-exit can be flaky when a probe expression exits the target while Debugger.evaluateOnCallFrame is pending. An older overlapping CDP request can clear the...
Opengraph URL: https://github.com/nodejs/node/pull/64102
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:c76ba936-f2e7-fd00-c926-dd672e9fa1f9 |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | E0CC:DCE25:F2AC74:15FFD80:6A4CCDDB |
| html-safe-nonce | 0b4621c500009c6905fd4ed983a636e40c9260d60ab456cde65aef304420529b |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMENDOkRDRTI1OkYyQUM3NDoxNUZGRDgwOjZBNENDRERCIiwidmlzaXRvcl9pZCI6IjU0ODUyNTQ4NTg5NTE2NzUzNTUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 5ba65b1d8d6f1f5d497775eb8e41c4da9747c2ed9756248a27def1ebb7c4a7ed |
| hovercard-subject-tag | pull_request:3923551901 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/nodejs/node/pull/64102/files |
| twitter:image | https://avatars.githubusercontent.com/u/16024985?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/16024985?s=400&v=4 |
| og:image:alt | parallel/test-debugger-probe-failure-process-exit can be flaky when a probe expression exits the target while Debugger.evaluateOnCallFrame is pending. An older overlapping CDP request can clear the... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | ee8a9d18044a05fe2d57b9ae797da38c8be34effb03f015f7c42e94770d28a1b |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/nodejs/node git https://github.com/nodejs/node.git |
| octolytics-dimension-user_id | 9950313 |
| octolytics-dimension-user_login | nodejs |
| octolytics-dimension-repository_id | 27193779 |
| octolytics-dimension-repository_nwo | nodejs/node |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 27193779 |
| octolytics-dimension-repository_network_root_nwo | nodejs/node |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | f84814acc6f036583fd43463f5847a846243d2a4 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width