You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@rocketmq.apache.org by GitBox <gi...@apache.org> on 2022/08/14 06:51:47 UTC
[GitHub] [rocketmq] caigy opened a new pull request, #4822: [ISSUE #4821] Add some integration tests for POP consumption in slave-acting-master mode
caigy opened a new pull request, #4822:
URL: https://github.com/apache/rocketmq/pull/4822
**Make sure set the target branch to `develop`**
## What is the purpose of the change
fix #4821
## Brief changelog
Add `PopSlaveActingMasterIT` and fix some bugs found.
## Verifying this change
XXXX
Follow this checklist to help us incorporate your contribution quickly and easily. Notice, `it would be helpful if you could finish the following 5 checklist(the last one is not necessary)before request the community to review your PR`.
- [x] Make sure there is a [Github issue](https://github.com/apache/rocketmq/issues) filed for the change (usually before you start working on it). Trivial changes like typos do not require a Github issue. Your pull request should address just this issue, without pulling in other changes - one PR resolves one issue.
- [x] Format the pull request title like `[ISSUE #123] Fix UnknownException when host config not exist`. Each commit in the pull request should have a meaningful subject line and body.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] Write necessary unit-test(over 80% coverage) to verify your logic correction, more mock a little better when cross module dependency exist. If the new feature or significant change is committed, please remember to add integration-test in [test module](https://github.com/apache/rocketmq/tree/master/test).
- [x] Run `mvn -B clean apache-rat:check findbugs:findbugs checkstyle:checkstyle` to make sure basic checks pass. Run `mvn clean install -DskipITs` to make sure unit-test pass. Run `mvn clean test-compile failsafe:integration-test` to make sure integration-test pass.
- [ ] If this contribution is large, please file an [Apache Individual Contributor License Agreement](http://www.apache.org/licenses/#clas).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [rocketmq] codecov-commenter commented on pull request #4822: [ISSUE #4821] Add some integration tests for POP consumption in slave-acting-master mode
Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on PR #4822:
URL: https://github.com/apache/rocketmq/pull/4822#issuecomment-1216532424
# [Codecov](https://codecov.io/gh/apache/rocketmq/pull/4822?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#4822](https://codecov.io/gh/apache/rocketmq/pull/4822?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (22dd251) into [develop](https://codecov.io/gh/apache/rocketmq/commit/8dd07c84697d3709f1f4bef5d78089b7d171b6cd?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (8dd07c8) will **decrease** coverage by `0.11%`.
> The diff coverage is `40.00%`.
> :exclamation: Current head 22dd251 differs from pull request most recent head cad0ada. Consider uploading reports for the commit cad0ada to get more accurate results
```diff
@@ Coverage Diff @@
## develop #4822 +/- ##
=============================================
- Coverage 44.94% 44.82% -0.12%
Complexity 7640 7640
=============================================
Files 980 982 +2
Lines 68135 68239 +104
Branches 9014 9025 +11
=============================================
- Hits 30622 30591 -31
- Misses 33729 33847 +118
- Partials 3784 3801 +17
```
| [Impacted Files](https://codecov.io/gh/apache/rocketmq/pull/4822?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [...cketmq/broker/processor/PopBufferMergeService.java](https://codecov.io/gh/apache/rocketmq/pull/4822/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YnJva2VyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9yb2NrZXRtcS9icm9rZXIvcHJvY2Vzc29yL1BvcEJ1ZmZlck1lcmdlU2VydmljZS5qYXZh) | `37.67% <0.00%> (-3.04%)` | :arrow_down: |
| [...he/rocketmq/broker/processor/PopReviveService.java](https://codecov.io/gh/apache/rocketmq/pull/4822/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YnJva2VyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9yb2NrZXRtcS9icm9rZXIvcHJvY2Vzc29yL1BvcFJldml2ZVNlcnZpY2UuamF2YQ==) | `38.35% <0.00%> (ø)` | |
| [...broker/processor/ChangeInvisibleTimeProcessor.java](https://codecov.io/gh/apache/rocketmq/pull/4822/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YnJva2VyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9yb2NrZXRtcS9icm9rZXIvcHJvY2Vzc29yL0NoYW5nZUludmlzaWJsZVRpbWVQcm9jZXNzb3IuamF2YQ==) | `66.97% <100.00%> (+1.83%)` | :arrow_up: |
| [...rocketmq/broker/processor/PopMessageProcessor.java](https://codecov.io/gh/apache/rocketmq/pull/4822/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-YnJva2VyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS9yb2NrZXRtcS9icm9rZXIvcHJvY2Vzc29yL1BvcE1lc3NhZ2VQcm9jZXNzb3IuamF2YQ==) | `38.17% <100.00%> (-0.57%)` | :arrow_down: |
| [...va/org/apache/rocketmq/store/FlushDiskWatcher.java](https://codecov.io/gh/apache/rocketmq/pull/4822/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c3RvcmUvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3JvY2tldG1xL3N0b3JlL0ZsdXNoRGlza1dhdGNoZXIuamF2YQ==) | `81.25% <0.00%> (-9.38%)` | :arrow_down: |
| [...controller/impl/DefaultBrokerHeartbeatManager.java](https://codecov.io/gh/apache/rocketmq/pull/4822/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29udHJvbGxlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcm9ja2V0bXEvY29udHJvbGxlci9pbXBsL0RlZmF1bHRCcm9rZXJIZWFydGJlYXRNYW5hZ2VyLmphdmE=) | `71.26% <0.00%> (-9.23%)` | :arrow_down: |
| [...q/namesrv/routeinfo/BrokerHousekeepingService.java](https://codecov.io/gh/apache/rocketmq/pull/4822/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-bmFtZXNydi9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcm9ja2V0bXEvbmFtZXNydi9yb3V0ZWluZm8vQnJva2VySG91c2VrZWVwaW5nU2VydmljZS5qYXZh) | `72.72% <0.00%> (-9.10%)` | :arrow_down: |
| [...a/org/apache/rocketmq/logging/inner/SysLogger.java](https://codecov.io/gh/apache/rocketmq/pull/4822/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-bG9nZ2luZy9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcm9ja2V0bXEvbG9nZ2luZy9pbm5lci9TeXNMb2dnZXIuamF2YQ==) | `28.57% <0.00%> (-5.72%)` | :arrow_down: |
| [...etmq/namesrv/routeinfo/BatchUnRegisterService.java](https://codecov.io/gh/apache/rocketmq/pull/4822/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-bmFtZXNydi9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcm9ja2V0bXEvbmFtZXNydi9yb3V0ZWluZm8vQmF0Y2hVblJlZ2lzdGVyU2VydmljZS5qYXZh) | `94.73% <0.00%> (-5.27%)` | :arrow_down: |
| [...java/org/apache/rocketmq/logging/inner/Logger.java](https://codecov.io/gh/apache/rocketmq/pull/4822/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-bG9nZ2luZy9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcm9ja2V0bXEvbG9nZ2luZy9pbm5lci9Mb2dnZXIuamF2YQ==) | `51.67% <0.00%> (-4.31%)` | :arrow_down: |
| ... and [39 more](https://codecov.io/gh/apache/rocketmq/pull/4822/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
:mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [rocketmq] ShannonDing commented on pull request #4822: [ISSUE #4821] Add some integration tests for POP consumption in slave-acting-master mode
Posted by GitBox <gi...@apache.org>.
ShannonDing commented on PR #4822:
URL: https://github.com/apache/rocketmq/pull/4822#issuecomment-1216098466
org.apache.rocketmq.broker.processor.ChangeInvisibleTimeProcessorTest
testProcessRequest_Success(org.apache.rocketmq.broker.processor.ChangeInvisibleTimeProcessorTest) Time elapsed: 2.568 sec <<< ERROR!
java.lang.NullPointerException
at org.apache.rocketmq.broker.processor.ChangeInvisibleTimeProcessorTest.testProcessRequest_Success(ChangeInvisibleTimeProcessorTest.java:122)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [rocketmq] RongtongJin merged pull request #4822: [ISSUE #4821] Add some integration tests for POP consumption in slave-acting-master mode
Posted by GitBox <gi...@apache.org>.
RongtongJin merged PR #4822:
URL: https://github.com/apache/rocketmq/pull/4822
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [rocketmq] RongtongJin commented on a diff in pull request #4822: [ISSUE #4821] Add some integration tests for POP consumption in slave-acting-master mode
Posted by GitBox <gi...@apache.org>.
RongtongJin commented on code in PR #4822:
URL: https://github.com/apache/rocketmq/pull/4822#discussion_r945247945
##########
test/src/test/java/org/apache/rocketmq/test/container/PopSlaveActingMasterIT.java:
##########
@@ -0,0 +1,569 @@
+package org.apache.rocketmq.test.container;
Review Comment:
Missing ASF header
##########
test/src/test/java/org/apache/rocketmq/test/container/PopSlaveActingMasterIT.java:
##########
@@ -0,0 +1,569 @@
+package org.apache.rocketmq.test.container;
+
+import org.apache.commons.lang3.RandomStringUtils;
+import org.apache.rocketmq.broker.BrokerController;
+import org.apache.rocketmq.client.consumer.DefaultMQPushConsumer;
+import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyStatus;
+import org.apache.rocketmq.client.consumer.listener.MessageListenerConcurrently;
+import org.apache.rocketmq.client.producer.DefaultMQProducer;
+import org.apache.rocketmq.client.producer.SendResult;
+import org.apache.rocketmq.client.producer.SendStatus;
+import org.apache.rocketmq.common.BrokerIdentity;
+import org.apache.rocketmq.common.KeyBuilder;
+import org.apache.rocketmq.common.consumer.ConsumeFromWhere;
+import org.apache.rocketmq.common.message.Message;
+import org.apache.rocketmq.common.message.MessageConst;
+import org.apache.rocketmq.common.message.MessageExt;
+import org.apache.rocketmq.common.message.MessageQueue;
+import org.apache.rocketmq.common.message.MessageRequestMode;
+import org.apache.rocketmq.container.BrokerContainer;
+import org.apache.rocketmq.container.InnerBrokerController;
+import org.apache.rocketmq.container.InnerSalveBrokerController;
+import org.apache.rocketmq.remoting.common.RemotingHelper;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import java.io.UnsupportedEncodingException;
+import java.time.Duration;
+import java.time.LocalDateTime;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Random;
+import java.util.Set;
+import java.util.concurrent.CopyOnWriteArrayList;
+import java.util.concurrent.atomic.AtomicInteger;
+
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.awaitility.Awaitility.await;
+
+public class PopSlaveActingMasterIT extends ContainerIntegrationTestBase {
Review Comment:
How about ignoring these tests? It proves the function's correctness, but it takes too much time and is not the core function, which affects the running time of the CI. IMO, just run these tests manually before the release.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [rocketmq] coveralls commented on pull request #4822: [ISSUE #4821] Add some integration tests for POP consumption in slave-acting-master mode
Posted by GitBox <gi...@apache.org>.
coveralls commented on PR #4822:
URL: https://github.com/apache/rocketmq/pull/4822#issuecomment-1216531551
[![Coverage Status](https://coveralls.io/builds/51693433/badge)](https://coveralls.io/builds/51693433)
Coverage decreased (-0.1%) to 49.129% when pulling **cad0adae5d9821285b223d23124a08411a143a5c on caigy:issue-4821** into **8dd07c84697d3709f1f4bef5d78089b7d171b6cd on apache:develop**.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [rocketmq] caigy commented on a diff in pull request #4822: [ISSUE #4821] Add some integration tests for POP consumption in slave-acting-master mode
Posted by GitBox <gi...@apache.org>.
caigy commented on code in PR #4822:
URL: https://github.com/apache/rocketmq/pull/4822#discussion_r945272905
##########
test/src/test/java/org/apache/rocketmq/test/container/PopSlaveActingMasterIT.java:
##########
@@ -0,0 +1,569 @@
+package org.apache.rocketmq.test.container;
+
+import org.apache.commons.lang3.RandomStringUtils;
+import org.apache.rocketmq.broker.BrokerController;
+import org.apache.rocketmq.client.consumer.DefaultMQPushConsumer;
+import org.apache.rocketmq.client.consumer.listener.ConsumeConcurrentlyStatus;
+import org.apache.rocketmq.client.consumer.listener.MessageListenerConcurrently;
+import org.apache.rocketmq.client.producer.DefaultMQProducer;
+import org.apache.rocketmq.client.producer.SendResult;
+import org.apache.rocketmq.client.producer.SendStatus;
+import org.apache.rocketmq.common.BrokerIdentity;
+import org.apache.rocketmq.common.KeyBuilder;
+import org.apache.rocketmq.common.consumer.ConsumeFromWhere;
+import org.apache.rocketmq.common.message.Message;
+import org.apache.rocketmq.common.message.MessageConst;
+import org.apache.rocketmq.common.message.MessageExt;
+import org.apache.rocketmq.common.message.MessageQueue;
+import org.apache.rocketmq.common.message.MessageRequestMode;
+import org.apache.rocketmq.container.BrokerContainer;
+import org.apache.rocketmq.container.InnerBrokerController;
+import org.apache.rocketmq.container.InnerSalveBrokerController;
+import org.apache.rocketmq.remoting.common.RemotingHelper;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+import java.io.UnsupportedEncodingException;
+import java.time.Duration;
+import java.time.LocalDateTime;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Random;
+import java.util.Set;
+import java.util.concurrent.CopyOnWriteArrayList;
+import java.util.concurrent.atomic.AtomicInteger;
+
+import static org.assertj.core.api.Assertions.assertThat;
+import static org.awaitility.Awaitility.await;
+
+public class PopSlaveActingMasterIT extends ContainerIntegrationTestBase {
Review Comment:
OK.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [rocketmq] caigy commented on a diff in pull request #4822: [ISSUE #4821] Add some integration tests for POP consumption in slave-acting-master mode
Posted by GitBox <gi...@apache.org>.
caigy commented on code in PR #4822:
URL: https://github.com/apache/rocketmq/pull/4822#discussion_r945272812
##########
test/src/test/java/org/apache/rocketmq/test/container/PopSlaveActingMasterIT.java:
##########
@@ -0,0 +1,569 @@
+package org.apache.rocketmq.test.container;
Review Comment:
Thanks, I'll add it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: dev-unsubscribe@rocketmq.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org