Skip to content

Commit e46b626

Browse files
ygreeamarziali
authored andcommitted
Fix flaky test (#9648)
1 parent f17bf05 commit e46b626

File tree

1 file changed

+4
-17
lines changed

1 file changed

+4
-17
lines changed

dd-java-agent/instrumentation/resilience4j/resilience4j-reactor-2.0/src/test/groovy/StackedOperatorsTest.groovy

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,33 +8,30 @@ import io.github.resilience4j.retry.RetryConfig
88
import reactor.core.publisher.ConnectableFlux
99
import reactor.core.publisher.Flux
1010
import reactor.core.scheduler.Schedulers
11-
1211
import static datadog.trace.agent.test.utils.TraceUtils.runnableUnderTrace
12+
import spock.lang.RepeatUntilFailure
1313

1414
class StackedOperatorsTest extends InstrumentationSpecification {
1515

16+
@RepeatUntilFailure(maxAttempts = 100)
1617
def "test stacked operators retry(circuitbreaker)"() {
1718
setup:
1819
ConnectableFlux<String> connection = Flux
1920
.just("abc", "def")
20-
.map({ serviceCall(it)})
21+
.map({serviceCall(it)})
2122
.transformDeferred(CircuitBreakerOperator.of(CircuitBreaker.ofDefaults("C2")))
2223
.transformDeferred(RetryOperator.of(Retry.of("R1", RetryConfig.custom().maxAttempts(3).build())))
2324
.publishOn(Schedulers.boundedElastic())
2425
.publish()
2526
2627
when:
27-
connection.subscribe {
28-
runnableUnderTrace("child-" + it) {}
29-
}
30-
3128
runnableUnderTrace("parent", {
3229
connection.connect()
3330
})
3431
3532
then:
3633
assertTraces(1) {
37-
trace(6) {
34+
trace(4) {
3835
sortSpansByStart()
3936
span(0) {
4037
operationName "parent"
@@ -56,16 +53,6 @@ class StackedOperatorsTest extends InstrumentationSpecification {
5653
childOf span(1)
5754
errored false
5855
}
59-
span(4) {
60-
operationName "child-abc"
61-
childOf span(1)
62-
errored false
63-
}
64-
span(5) {
65-
operationName "child-def"
66-
childOf span(1)
67-
errored false
68-
}
6956
}
7057
}
7158
}

0 commit comments

Comments
 (0)