GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — test: deflake inspector async hook setup · nodejs/node@94599e7

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • test/parallel
    • test-inspector-async-hook-setup-at-signal.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎test/parallel/test-inspector-async-hook-setup-at-signal.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-inspector-async-hook-setup-at-signal.js
+6-3Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ function waitUntilDebugged() {
3333
3434
// This function is called by the inspector client (session)
3535
function setupTimeoutWithBreak() {
36-
clearInterval(waiting);
3736
process._rawDebug('Debugger ready, setting up timeout with a break');
3837
setTimeout(() => { debugger; }, 50);
3938
}
@@ -46,16 +45,20 @@ async function waitForInitialSetup(session) {
4645

4746
async function setupTimeoutForStackTrace(session) {
4847
console.error('[test]', 'Setting up timeout for async stack trace');
48+
// Async hook setup is deferred when requested from a V8 interrupt. Let the
49+
// event loop finish that setup before creating the timeout whose stack we test.
4950
await session.send([
5051
{ 'method': 'Runtime.evaluate',
51-
'params': { expression: 'setupTimeoutWithBreak()' } },
52+
'params': {
53+
expression: 'clearInterval(waiting); setImmediate(setupTimeoutWithBreak)',
54+
} },
5255
{ 'method': 'Debugger.resume' },
5356
]);
5457
}
5558

5659
async function checkAsyncStackTrace(session) {
5760
console.error('[test]', 'Verify basic properties of asyncStackTrace');
58-
const paused = await session.waitForBreakOnLine(23, '[eval]');
61+
const paused = await session.waitForBreakOnLine(22, '[eval]');
5962
assert(paused.params.asyncStackTrace,
6063
`${Object.keys(paused.params)} contains "asyncStackTrace" property`);
6164
assert(paused.params.asyncStackTrace.description, 'Timeout');

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.