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