question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Running set of unittests fail on line that should never fail

See original GitHub issue

When 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:closed
  • Created 4 years ago
  • Reactions:4
  • Comments:13 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
Guchmancommented, Jun 18, 2020

Same issue after updating to SB 2.3 and kafka 2.5 deps. Don’t know how to reproduce and what is the reason

1reaction
ikarsokolovcommented, Jul 8, 2020

Same issue with Hoxton.SR6. Tests work fine locally in IDE and gradle but break on CI server.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Are Your Unit Tests Failing and You Don't Know Why? - Parasoft
Of the many reasons software developers complain about unit testing, dealing with noisy test suites is one of the biggest.
Read more >
Unit tests fail in Test Explorer but runs without any problem in ...
at the 'Test explorer' site. Miroslav, I'm asking if the tests that are failing when you "Run All" pass if you try to...
Read more >
Why are unit tests failing seen as bad?
Releasing software with some known bugs below a certain severity is not necessarily bad. However, these known glitches should not cause a ...
Read more >
Unit tests sometimes failing, sometimes passing - Stack Overflow
Tests can fail intermittently for a number of reasons and identifying why they fail is often revealing about your codebase and environment.
Read more >
How to fail a build on failing unit tests - Platform.sh Community
Every time a push is made, run all unit tests. If tests fail, the build should fail and not be deployed. Assumptions. During...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found