question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Enhancement: add support for .retry(n)

See original GitHub issue

In a perfect world, there would be no ECONREST or ENOTFOUND, or 504, but in the real-world, especially when performing functional/integration tests while another team might be running load tests on a shared test environment, it would be really helpful to not bail at the first sign of trouble.

This enhancement request is for the addition of a ‘.retry(n)’ request option.

i.e.

request(http://mydomain.com)
    .post('something_wonderful')
    .set('User-Agent', 'tester-testtown-testington')
    .send(data)
    .retry(3)
    .end(function(error, res) {

      if (error) throw error;
      callback(null, res);
    });

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:8

github_iconTop GitHub Comments

3reactions
kristerkaricommented, Oct 11, 2014

Actually, it would be nice Supertest allowed Superagent plugins to be set up by the user. I’m not sure if that can currently be done without changes to Supertest code.

0reactions
nhnicwallercommented, Aug 8, 2019

Was this issue closed because there are no plans to add retry support for supertest?

Read more comments on GitHub >

github_iconTop Results From Across the Web

add support for .retry(n) · Issue #167 · ladjs/supertest - GitHub
This enhancement request is for the addition of a '.retry(n)' request option. i.e.. request(http://mydomain.com) .post('something_wonderful') .
Read more >
Best practices for retry pattern - Medium
Retries are a core resiliency pattern which help enhance service availability by re-attempting failed operations.
Read more >
c# - Cleanest way to write retry logic? - Stack Overflow
I needed a method that supports cancellation, while I was at it, I added support for returning intermediate failures.
Read more >
Proper Retry in JavaScript - Solutional
Let's create a simple code to verify that assumption. First we create some functions, which help us in testing. const request = (failuresCount) ......
Read more >
Auto Retry failed CI jobs (#3442) · Issues - GitLab.org
I would like to be able to specify retry_count in gitlab-ci.yml which will retry failing builds N times. It should be something pretty...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found