Skip to content

PollyError: [Polly] Request failed due to an unknown error. TIMEOUT #503

@bschelling

Description

@bschelling

Description

I'm unable to set the timeout correctly. Polly quits recording an URL which takes about 8 seconds to load
with the message
PollyError: [Polly] Request failed due to an unknown error.

I tried to set the timeout using the following code

 polly =   polly = new Polly(recordingName, {
    adapters: ['node-http'],
    persister: 'fs',
....
})

  const {server} = polly;
  server.timeout(15000);
  return polly;

Commenting out the following line in "@pollyjs/adapter-node-http/dist/cjs/pollyjs-adapter-node-http.js"
fixes my problem, but that's obviously not the right thing to do....

    const responsePromise = new promise$1((resolve, reject) => {
      request.once('response', resolve);
      request.once('error', reject);
     // request.once('timeout', reject); -> it works if I comment out this line
    }); // Write the request body

Environment

Node.js v20.11.0
darwin 22.6.0
10.2.4
1.22.19

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions