-
Notifications
You must be signed in to change notification settings - Fork 207
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Existing Spring Tests are failling with dapr-sdk 1.6.0 #766
Comments
Was able to reproduce the issue: As per Dapr proto definition in runtime, default path can be only one as string: https://github.com/dapr/dapr/blob/81fc87deae04713a78416009060eb35e8ae3bf9c/dapr/proto/runtime/v1/appcallback.proto#L180 Following lines are invoked in java-sdk in such a case (thanks to @mukundansundar for helping me identify exact code-piece in java-sdk): java-sdk/sdk-springboot/src/main/java/io/dapr/springboot/DaprSubscriptionBuilder.java Line 49 in 5a2833c
@javageek79 Please confirm, if that is the scenario: in your test(s), you are trying to set default paths for the same topic via multiple tests. And, that is why when you run test separately, it should run fine. Assuming that is the case - Ideally, it would be good, if we can avoid using same topic and setting default path for it via multiple tests - that doesn't seem like a prod scenario. @artursouza @mukundansundar, One discussable stuff here: Should we allow updation of default path and not throw a RuntimeException. means, if somebody tries to really update it in real scenario? |
Hi, let me jump in for @javageek79 and answer your question, since i took over the bug in our project. we are running multiple parallel springboot tests. when we configure surefire to forkmode=always (create a new jvm for each test) we don't get the runtime excception. running parallel springboot tests worked fine in 1.5.0 and is the default behaviour when buiulding spring applications with maven. executing tests consecutively (surefire configuration forkMode=always) is solving the behaviour but almost doubles the build time (which is not a good option in the production pipeline). looking at the code i wonder if it might be a solution by altering setDefaultPath like this:
allowing setDefaultPath if it is the same path as before. |
We can make a change where it does not throw an exception if the defaultPath is already set to the same value. |
If the route being provided for a topic is the same as it was previously, do not raise an exception. Fixes parallel test execution without `forkMode=always` (dapr#766) Signed-off-by: John Ewart <johnewart@microsoft.com>
If the route being provided for a topic is the same as it was previously, do not raise an exception. Fixes parallel test execution without `forkMode=always` (#766) Signed-off-by: John Ewart <johnewart@microsoft.com> Signed-off-by: John Ewart <johnewart@microsoft.com>
thanks, i can confirm that the problem no longer exists with the new master version. |
If the route being provided for a topic is the same as it was previously, do not raise an exception. Fixes parallel test execution without `forkMode=always` (#766) Signed-off-by: John Ewart <johnewart@microsoft.com> Signed-off-by: John Ewart <johnewart@microsoft.com>
Expected Behavior
All existing tests still run with the new dapr-sdk 1.6.0 as they do with 1.5.0
Actual Behavior
Some tests in our test suite are failing due to
Steps to Reproduce the Problem
Run two spring extended test classes testing a spring rest controller like
A test might looks like this
the tests are running fine if test classes are executed standalone. If all tests are running, they are failing with the named error above.
Release Note
RELEASE NOTE: FIX Bug in java sdk.
RELEASE NOTE:
The text was updated successfully, but these errors were encountered: