From f466ab4c02a6c88ef1ed693637cc6957dec1e85f Mon Sep 17 00:00:00 2001 From: Trent Mick Date: Wed, 20 Oct 2021 14:30:22 -0700 Subject: [PATCH] hapi test: use localhost rather than '0.0.0.0' default to match client request address This is a workaround for https://github.com/nodejs/node/issues/40537 --- test/instrumentation/modules/hapi/shared.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/test/instrumentation/modules/hapi/shared.js b/test/instrumentation/modules/hapi/shared.js index 1e21f38719..36ac6fbba8 100644 --- a/test/instrumentation/modules/hapi/shared.js +++ b/test/instrumentation/modules/hapi/shared.js @@ -7,7 +7,8 @@ module.exports = (moduleName) => { captureExceptions: false, logLevel: 'fatal', metricsInterval: 0, - centralConfig: false + centralConfig: false, + cloudProvider: 'none' }) var isHapiIncompat = require('../../../_is_hapi_incompat') @@ -48,7 +49,7 @@ module.exports = (moduleName) => { agent.captureError = originalCaptureError var server = startServer(function (err, port) { - t.error(err) + t.error(err, 'no error from startServer') http.get('http://localhost:' + port + '/captureError?foo=bar') }) }) @@ -523,7 +524,7 @@ module.exports = (moduleName) => { }) function makeServer (opts) { - var server = new Hapi.Server() + var server = new Hapi.Server({ host: 'localhost' }) if (semver.satisfies(pkg.version, '<17')) { server.connection(opts) }