Skip to content

Conversation

@Vampire
Copy link
Member

@Vampire Vampire commented Jun 5, 2025

No description provided.

@Vampire Vampire force-pushed the vampire/fix-retry-docs branch from 0fbb1a3 to ad388ae Compare June 5, 2025 09:38
Copy link
Member Author

Vampire commented Jun 5, 2025

This stack of pull requests is managed by Graphite. Learn more about stacking.

@codecov
Copy link

codecov bot commented Jun 5, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.06%. Comparing base (6db37a3) to head (989e118).

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #2174      +/-   ##
============================================
- Coverage     82.07%   82.06%   -0.01%     
+ Complexity     4756     4755       -1     
============================================
  Files           465      465              
  Lines         14871    14871              
  Branches       1878     1878              
============================================
- Hits          12205    12204       -1     
  Misses         1978     1978              
- Partials        688      689       +1     
Files with missing lines Coverage Δ
spock-core/src/main/java/spock/lang/Retry.java 100.00% <ø> (ø)

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Vampire Vampire force-pushed the vampire/fix-retry-docs branch 2 times, most recently from 592f7a9 to a8dd99c Compare June 5, 2025 14:46
In addition, an optional `condition` closure can be used to determine if a feature should be retried.
It also provides special support for data driven features, offering to either retry all iterations or just the failing ones.
In its standard mode it only retries the feature method execution, but this can be changed using `mode` to
also run setup and cleanup on retries. Even in this mode, the retry is only triggered if the feature method is failing
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@leonard84 is this actually the intended and expected behavior?
That only expected failures in the feature method trigger a retry I mean.
I do some UI tests using Geb with Marathon driver and it happens sometimes on GHA that the application cannot be started and thus the driver throws an exception.

This is done in an iteration interceptor before calling proceed, the iteration interceptor is within the retry iteration interceptor due to using global retry extension. But as the error happens there and not during feature method invocation, it does not cause a retry.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is the current behavior. I'm not opposed to letting it cover setup as well.

Though if I'm not mistaken, you'll have problems covering cleanup without the method executions appearing in the results.

@Vampire Vampire force-pushed the vampire/fix-retry-docs branch from a8dd99c to e11ba73 Compare August 25, 2025 12:57
@Vampire Vampire force-pushed the vampire/fix-retry-docs branch from e11ba73 to 801f260 Compare October 9, 2025 16:44
@Vampire Vampire force-pushed the vampire/fix-retry-docs branch 7 times, most recently from 48c6bdc to 3022569 Compare October 22, 2025 00:28
@Vampire Vampire added this to the 2.4 milestone Oct 23, 2025
@Vampire Vampire force-pushed the vampire/fix-retry-docs branch 6 times, most recently from 3a690d8 to 6efbe05 Compare October 24, 2025 14:45
enum Mode {
/**
* Retry the iterations individually.
* Retry only the feature method execution, setup and cleanup are not running on retries.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we also the the same sentence as in the docu

Suggested change
* Retry only the feature method execution, setup and cleanup are not running on retries.
* Retry only the feature method execution, setup and cleanup are not running on retries.
* If the setup or cleanup is failing, the test fails immediately.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it makes sense here.

The sentence in the docs is about the SETUP_FEATURE_CLEANUP mode below and there I already added the sentence like in the docs.

In the ITERATION mode setup and cleanup are not part of the retry, so why should we additionally mention that the test fails if they are failing, they are not affected in any way by the retry anyway in that mode.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Besides that it is anyway questionable whether this is actually the intended behavior, thus my question above to @leonard84

@Vampire Vampire force-pushed the vampire/fix-retry-docs branch 4 times, most recently from 1b03137 to 1d6da54 Compare October 28, 2025 17:51
In addition, an optional `condition` closure can be used to determine if a feature should be retried.
It also provides special support for data driven features, offering to either retry all iterations or just the failing ones.
In its standard mode it only retries the feature method execution, but this can be changed using `mode` to
also run setup and cleanup on retries. Even in this mode, the retry is only triggered if the feature method is failing
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is the current behavior. I'm not opposed to letting it cover setup as well.

Though if I'm not mistaken, you'll have problems covering cleanup without the method executions appearing in the results.

@Vampire Vampire force-pushed the vampire/fix-retry-docs branch from 1d6da54 to 8423afe Compare October 28, 2025 19:45
@Vampire Vampire force-pushed the vampire/fix-retry-docs branch from 8423afe to 989e118 Compare October 29, 2025 04:14
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

Successfully merging this pull request may close these issues.

4 participants