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

Retry does not work for some cases in latest rspec #72

Open
allenwq opened this issue Mar 24, 2017 · 10 comments
Open

Retry does not work for some cases in latest rspec #72

allenwq opened this issue Mar 24, 2017 · 10 comments
Labels

Comments

@allenwq
Copy link

allenwq commented Mar 24, 2017

The example given in the readme does not work in rspec 3.5 :

it 'should randomly succeed', :retry => 3 do
  expect(rand(2)).to eq(1)
end

When the expectation does not match, seems rspec does not treat it as an exception anymore. so example.exception will still be nil and this line will pass: https://github.com/NoRedInk/rspec-retry/blob/master/lib/rspec/retry.rb#L116

However, if it's a real exception like below, the retry works at expected:

it 'should randomly succeed', :retry => 3 do
  raise Network:Timeout
end
@michaelglass
Copy link
Contributor

will look into this one. Thank you!

@willnet
Copy link

willnet commented Sep 27, 2017

I encountered same behavior with aggregate_failures.

When I turn off aggregate_failures, it works as expected.

@philipfong
Copy link

Fwiw, I was not able to reproduce this in RSpec 3.6.0.

@fujimura
Copy link

Reproduced this in RSpec 3.8.0.

@coorasse
Copy link

I can confirm that it does not work when aggregate_failures is enabled.

@michaelglass
Copy link
Contributor

My focus has moved away from Ruby, so I'm not going to get to look at this. Happy to accept any PRs and / or share maintainer responsibility if anyone else has the cycles.

@iSarCasm
Copy link

iSarCasm commented Jul 9, 2019

@michaelglass this was discussed here: rspec/rspec-core#2289
I found that rspec-retry is based on simple example.exception check which is not enough when aggregate_failures is on. I am able to monkey-patch successfully in my project and can open a PR during the week.

@MaicolBen
Copy link

@iSarCasm were you able to monkey-patch it? can you post at least the code here?

@joao-esteves
Copy link

@michaelglass this was discussed here: rspec/rspec-core#2289
I found that rspec-retry is based on simple example.exception check which is not enough when aggregate_failures is on. I am able to monkey-patch successfully in my project and can open a PR during the week.

@iSarCasm were you able to monkey-patch it? can you post at least the code here?

Bumping to ask if someone can fix this or provide alternatives. I have no retries when using :aggregate_failures, which I'm using to not repeat requests over multiple its.

@michaelglass
Copy link
Contributor

I no longer have write access to the repo and will no longer maintain it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

9 participants