Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
bschelling opened this issue Dec 9, 2024 · 0 comments
Open

Comments

@bschelling
Copy link

bschelling commented Dec 9, 2024

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant