Migrate PubSub removing flaky test#1407
Conversation
|
@artur-ciocanu @cicoyle @salaboy Trying to move the following test to use Testcontainers I got a problem. java-sdk/sdk-tests/src/test/java/io/dapr/it/pubsub/http/PubSubIT.java Lines 571 to 572 in 3a8fd61 When running the test from I have 1 message with the first message containing 10 statuses. But using in-memory (Testcontainers) I have 10 messages and each one with 1 statuses. I would like to know if the |
sdk-tests/src/test/java/io/dapr/it/testcontainers/pubsub/http/TestPubSubApplication.java
Show resolved
Hide resolved
|
@mcruzdev I will try to review ASAP, but could you please check why the ITs are failing? |
It is another mapped flaky test |
Signed-off-by: Matheus Cruz <matheuscruz.dev@gmail.com>
|
Error, I need to change the assert... |
|
@mcruzdev could you please check what is wrong with the tests, I see this error: |
Signed-off-by: Matheus Cruz <matheuscruz.dev@gmail.com>
Signed-off-by: Matheus Cruz <matheuscruz.dev@gmail.com>
artur-ciocanu
left a comment
There was a problem hiding this comment.
@mcruzdev the PR looks good. There are a few things that I think should be addressed:
- Please make sure that you use logger instead of System.out, I have tried to add comments to all the places, but please double check and make sure that we use logger everywhere
- The Dapr Jackson serialzer could replaced with
CustomizableObjectSerializerinstead of creating an inline class - I see that there are quite a few
Thread.sleep()invocations, I am wondering if there is a way to avoid them. If not I am OK with them.
Please take a look and let me know your thoughts.
sdk-tests/src/test/java/io/dapr/it/testcontainers/pubsub/http/DaprPubSubIT.java
Outdated
Show resolved
Hide resolved
sdk-tests/src/test/java/io/dapr/it/testcontainers/pubsub/http/DaprPubSubIT.java
Show resolved
Hide resolved
sdk-tests/src/test/java/io/dapr/it/testcontainers/pubsub/http/DaprPubSubIT.java
Show resolved
Hide resolved
sdk-tests/src/test/java/io/dapr/it/testcontainers/pubsub/http/DaprPubSubIT.java
Show resolved
Hide resolved
sdk-tests/src/test/java/io/dapr/it/testcontainers/pubsub/http/DaprPubSubIT.java
Show resolved
Hide resolved
sdk-tests/src/test/java/io/dapr/it/testcontainers/pubsub/http/SubscriberController.java
Show resolved
Hide resolved
sdk-tests/src/test/java/io/dapr/it/testcontainers/pubsub/http/SubscriberController.java
Show resolved
Hide resolved
sdk-tests/src/test/java/io/dapr/it/testcontainers/pubsub/http/SubscriberController.java
Show resolved
Hide resolved
sdk-tests/src/test/java/io/dapr/it/testcontainers/pubsub/http/SubscriberController.java
Show resolved
Hide resolved
sdk-tests/src/test/java/io/dapr/it/testcontainers/pubsub/http/SubscriberController.java
Show resolved
Hide resolved
Signed-off-by: Matheus Cruz <matheuscruz.dev@gmail.com>
Signed-off-by: Matheus Cruz <matheuscruz.dev@gmail.com>
|
Hi @artur-ciocanu we really need a custom ObjectSerializer, using a I just copied the old behavior to the new way to write tests (using testcontainers to instantiate dapr). |
artur-ciocanu
left a comment
There was a problem hiding this comment.
@mcruzdev you made my day! Really nice patch, thank you! 🙇
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #1407 +/- ##
============================================
+ Coverage 76.91% 78.34% +1.42%
- Complexity 1592 1878 +286
============================================
Files 145 234 +89
Lines 4843 5832 +989
Branches 562 601 +39
============================================
+ Hits 3725 4569 +844
- Misses 821 943 +122
- Partials 297 320 +23 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Description
Use testcontainers for PubSub tests.
The main goal is to remove the following flaky test https://github.com/dapr/java-sdk/actions/runs/13773009141/job/38515768267#step:19:13432.
Closes one of the flaky test links related on the #1258 issue.
Issue reference
We strive to have all PR being opened based on an issue, where the problem or feature have been discussed prior to implementation.
Please reference the issue this PR will close: #[issue number]
Checklist
Please make sure you've completed the relevant tasks for this PR, out of the following list: