Skip to content

Commit 0deb27b

Browse files
TrottBridgeAR
authored andcommitted
test: add dns memory error test
Add test that confirms that when libuv reports a memory error on a DNS query, that the memory error is passed through and not replaced with ENOTFOUND. PR-URL: #20317 Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
1 parent a158d41 commit 0deb27b

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed
+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Flags: --expose-internals
2+
'use strict';
3+
4+
// Check that if libuv reports a memory error on a DNS query, that the memory
5+
// error is passed through and not replaced with ENOTFOUND.
6+
7+
require('../common');
8+
9+
const assert = require('assert');
10+
const errors = require('internal/errors');
11+
12+
const { UV_EAI_MEMORY } = process.binding('uv');
13+
const memoryError = errors.dnsException(UV_EAI_MEMORY, 'fhqwhgads');
14+
15+
assert.strictEqual(memoryError.code, 'EAI_MEMORY');

0 commit comments

Comments
 (0)