@@ -31,24 +31,28 @@ class RetryInterceptor implements IMethodInterceptor {
31
31
if (attempts > retryMax) {
32
32
throw t
33
33
}
34
- invocation. spec. cleanupMethods. each {
35
- try {
36
- if (it. reflection) {
37
- ReflectionUtil . invokeMethod(invocation. target, it. reflection)
34
+ invocation. spec. specsBottomToTop. each { spec ->
35
+ spec. cleanupMethods. each {
36
+ try {
37
+ if (it. reflection) {
38
+ ReflectionUtil . invokeMethod(invocation. target, it. reflection)
39
+ }
40
+ } catch (Throwable t2) {
41
+ LOG . warn(" Retry caught failure ${ attempts + 1} / ${ retryMax + 1} while cleaning up" , t2)
38
42
}
39
- } catch (Throwable t2) {
40
- LOG . warn(" Retry caught failure ${ attempts + 1} / ${ retryMax + 1} while cleaning up" , t2)
41
43
}
42
44
}
43
- invocation. spec. setupMethods. each {
44
- try {
45
- if (it. reflection) {
46
- ReflectionUtil . invokeMethod(invocation. target, it. reflection)
45
+ invocation. spec. specsTopToBottom. each { spec ->
46
+ spec. setupMethods. each {
47
+ try {
48
+ if (it. reflection) {
49
+ ReflectionUtil . invokeMethod(invocation. target, it. reflection)
50
+ }
51
+ } catch (Throwable t2) {
52
+ // increment counter, since this is the start of the re-run
53
+ attempts++
54
+ LOG . info(" Retry caught failure ${ attempts + 1} / ${ retryMax + 1} while setting up" , t2)
47
55
}
48
- } catch (Throwable t2) {
49
- // increment counter, since this is the start of the re-run
50
- attempts++
51
- LOG . info(" Retry caught failure ${ attempts + 1} / ${ retryMax + 1} while setting up" , t2)
52
56
}
53
57
}
54
58
0 commit comments