Running set of unittests fail on line that should never fail
See original GitHub issueWhen running our whole suite of unittests in IntelliJ with only two @SpringBootTest
classes a number of tests fail with the same sort of stack trace. These are just normal unittests without any application context, but they do use classes from Spring Cloud Gateway. No mocking is done around
Sleuth. Running these failed tests they work just fine. So I guess there’s some leftover context?
It’s hard to describe and I don’t see an easy way to create a reproducible example. However this happens every time since the upgrade to Hoxton.SR3. Reverting to Hoxton.SR2 resolves the problem.
The funny thing is that on line 90 in ReactorSleuth
the following comment is attached: should never happen, but don't break.
Running through maven there’s no issue, which apparently disables assertions.
java.lang.AssertionError
at org.springframework.cloud.sleuth.instrument.reactor.ReactorSleuth.lambda$scopePassingSpanOperator$0(ReactorSleuth.java:90)
at reactor.core.publisher.FluxLift.subscribeOrReturn(FluxLift.java:42)
at reactor.core.publisher.Flux.subscribe(Flux.java:8172)
at reactor.test.DefaultStepVerifierBuilder$DefaultStepVerifier.toVerifierAndSubscribe(DefaultStepVerifierBuilder.java:867)
at reactor.test.DefaultStepVerifierBuilder$DefaultStepVerifier.verify(DefaultStepVerifierBuilder.java:823)
at reactor.test.DefaultStepVerifierBuilder$DefaultStepVerifier.verify(DefaultStepVerifierBuilder.java:815)
at reactor.test.DefaultStepVerifierBuilder.verifyComplete(DefaultStepVerifierBuilder.java:682)
at our.TestCase()
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:686)
...
at org.junit.platform.launcher.core.DefaultLauncher.withInterceptedStreams(DefaultLauncher.java:226)
at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:199)
at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:132)
at com.intellij.junit5.JUnit5IdeaTestRunner.startRunnerWithArgs(JUnit5IdeaTestRunner.java:69)
at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33)
at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:230)
at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:58)
Issue Analytics
- State:
- Created 4 years ago
- Reactions:4
- Comments:13 (3 by maintainers)
Same issue after updating to SB 2.3 and kafka 2.5 deps. Don’t know how to reproduce and what is the reason
Same issue with Hoxton.SR6. Tests work fine locally in IDE and gradle but break on CI server.