diff --git a/lib/_http_client.js b/lib/_http_client.js index a9ee686c69a67f..15f566b57c1d84 100644 --- a/lib/_http_client.js +++ b/lib/_http_client.js @@ -458,12 +458,6 @@ function parserOnIncomingClient(res, shouldKeepAlive) { var socket = this.socket; var req = socket._httpMessage; - // propagate "domain" setting... - if (req.domain && !res.domain) { - debug('setting "res.domain"'); - res.domain = req.domain; - } - debug('AGENT incoming response!'); if (req.res) { diff --git a/lib/timers.js b/lib/timers.js index db43a7491de72f..68631e8aebf7fd 100644 --- a/lib/timers.js +++ b/lib/timers.js @@ -576,7 +576,6 @@ Timeout.prototype.unref = function() { this._handle.owner = this; this._handle[kOnTimeout] = unrefdHandle; this._handle.start(delay); - this._handle.domain = this.domain; this._handle.unref(); } return this; diff --git a/test/parallel/test-domain-timers.js b/test/parallel/test-domain-timers.js index fe7247b2a92c95..f9857a991af880 100644 --- a/test/parallel/test-domain-timers.js +++ b/test/parallel/test-domain-timers.js @@ -30,13 +30,19 @@ timeoutd.on('error', common.mustCall(function(e) { assert.strictEqual(e.message, 'Timeout UNREFd', 'Domain should catch timer error'); clearTimeout(timeout); -})); +}, 2)); +let t; timeoutd.run(function() { setTimeout(function() { throw new Error('Timeout UNREFd'); }, 0).unref(); + + t = setTimeout(function() { + throw new Error('Timeout UNREFd'); + }, 0); }); +t.unref(); const immediated = domain.create();