Skip to content

Failing unit test in Node 10+ (connection timeout) #75

@jancurn

Description

@jancurn

The unit test of the https-proxy-agent package fails on Node 10+:

  1) HttpsProxyAgent "http" module should work over an HTTP proxy:
     Error: Timeout of 2000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves.
  
  2) HttpsProxyAgent "http" module should work over an HTTPS proxy:
     Error: Timeout of 2000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves.
  
  3) HttpsProxyAgent "after all" hook:
     Error: Timeout of 2000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves.

I suspect this is related to the following change introduced in Node 10: nodejs/node#19981

Unfortunately, this issue makes it impossible to use web sockets over HTTPS proxy, since that depends on https-proxy-agent. For example, unit tests of https://github.com/apifytech/proxy-chain fail for this reason (see https://github.com/apifytech/proxy-chain/blob/master/test/server.js#L612)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions