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: improve `UV_THREADPOOL_SIZE` tests on `.env` · nodejs/node@41644ee

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • test
    • fixtures/dotenv
      • uv-threadpool.env
    • node-api/test_uv_threadpool_size
      • node-options.js
    • parallel
      • test-dotenv-node-options.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎test/fixtures/dotenv/uv-threadpool.env‎

Copy file name to clipboard
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
UV_THREADPOOL_SIZE=4
Collapse file

‎test/node-api/test_uv_threadpool_size/node-options.js‎

Copy file name to clipboard
+31Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
'use strict';
2+
3+
const common = require('../../common');
4+
const assert = require('assert');
5+
const path = require('path');
6+
const { spawnSync } = require('child_process');
7+
8+
if (process.config.variables.node_without_node_options) {
9+
common.skip('missing NODE_OPTIONS support');
10+
}
11+
12+
const uvThreadPoolPath = '../../fixtures/dotenv/uv-threadpool.env';
13+
14+
// Should update UV_THREADPOOL_SIZE
15+
let filePath = path.join(__dirname, `./build/${common.buildType}/test_uv_threadpool_size`);
16+
if (common.isWindows) {
17+
filePath = filePath.replaceAll('\\', '\\\\');
18+
}
19+
const code = `
20+
const { test } = require('${filePath}');
21+
const size = parseInt(process.env.UV_THREADPOOL_SIZE, 10);
22+
require('assert').strictEqual(size, 4);
23+
test(size);
24+
`.trim();
25+
const child = spawnSync(
26+
process.execPath,
27+
[ `--env-file=${uvThreadPoolPath}`, '--eval', code ],
28+
{ cwd: __dirname, encoding: 'utf-8' },
29+
);
30+
assert.strictEqual(child.stderr, '');
31+
assert.strictEqual(child.status, 0);
Collapse file

‎test/parallel/test-dotenv-node-options.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-dotenv-node-options.js
-13Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -62,17 +62,4 @@ describe('.env supports NODE_OPTIONS', () => {
6262
assert.strictEqual(child.code, 0);
6363
});
6464

65-
it('should update UV_THREADPOOL_SIZE', async () => {
66-
const code = `
67-
require('assert').strictEqual(process.env.UV_THREADPOOL_SIZE, '5')
68-
`.trim();
69-
const child = await common.spawnPromisified(
70-
process.execPath,
71-
[ `--env-file=${relativePath}`, '--eval', code ],
72-
{ cwd: __dirname },
73-
);
74-
assert.strictEqual(child.stderr, '');
75-
assert.strictEqual(child.code, 0);
76-
});
77-
7865
});

0 commit comments

Comments
0 (0)
You are visitor 01402503 — 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.