| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1 @@ | |||
| 1 | + UV_THREADPOOL_SIZE=4 | ||
| Original file line number | Diff line number | Diff 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); | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -62,17 +62,4 @@ describe('.env supports NODE_OPTIONS', () => { | |||
| 62 | 62 | assert.strictEqual(child.code, 0); | |
| 63 | 63 | }); | |
| 64 | 64 | ||
| 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 | - | ||
| 78 | 65 | }); | |
| Back | FazBrowse Home | New Git URL |
0 commit comments