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: use spawnSyncAndAssert in nested async stack overflow test · nodejs/node@9f214f5

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • test/parallel
    • test-async-hooks-stack-overflow-nested-async.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎test/parallel/test-async-hooks-stack-overflow-nested-async.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-async-hooks-stack-overflow-nested-async.js
+6-11Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
require('../common');
99
const assert = require('assert');
10-
const { spawnSync } = require('child_process');
10+
const { spawnSyncAndAssert } = require('../common/child_process');
1111

1212
if (process.argv[2] === 'child') {
1313
const { createHook } = require('async_hooks');
@@ -64,17 +64,12 @@ if (process.argv[2] === 'child') {
6464
}
6565
} else {
6666
// Parent process - spawn the child and check exit code
67-
const result = spawnSync(
67+
spawnSyncAndAssert(
6868
process.execPath,
6969
[__filename, 'child'],
70-
{ encoding: 'utf8', timeout: 30000 }
70+
{ encoding: 'utf8', timeout: 30000 },
71+
{
72+
stdout: /SUCCESS: try-catch caught the stack overflow/,
73+
},
7174
);
72-
73-
// Should exit successfully (try-catch worked)
74-
assert.strictEqual(result.status, 0,
75-
`Expected exit code 0, got ${result.status}.\n` +
76-
`stdout: ${result.stdout}\n` +
77-
`stderr: ${result.stderr}`);
78-
// Verify the error was handled by try-catch
79-
assert.match(result.stdout, /SUCCESS: try-catch caught the stack overflow/);
8075
}

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.