Skip to content

Commit

Permalink
test: add dns memory error test
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Trivikram Kamat <[email protected]>
  • Loading branch information
Trott authored and BridgeAR committed Apr 30, 2018
1 parent a158d41 commit 0deb27b
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions test/parallel/test-dns-memory-error.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// Flags: --expose-internals
'use strict';

// Check that if libuv reports a memory error on a DNS query, that the memory
// error is passed through and not replaced with ENOTFOUND.

require('../common');

const assert = require('assert');
const errors = require('internal/errors');

const { UV_EAI_MEMORY } = process.binding('uv');
const memoryError = errors.dnsException(UV_EAI_MEMORY, 'fhqwhgads');

assert.strictEqual(memoryError.code, 'EAI_MEMORY');

0 comments on commit 0deb27b

Please sign in to comment.