You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "poorbarcode (via GitHub)" <gi...@apache.org> on 2023/02/05 18:11:11 UTC

[GitHub] [pulsar] poorbarcode opened a new pull request, #19433: [fix] [test] fix flaky test MetadataStoreStatsTest.testMetadataStoreStats

poorbarcode opened a new pull request, #19433:
URL: https://github.com/apache/pulsar/pull/19433

   ### Motivation
   
   We can see that this is a flaky test:
   
   - https://github.com/apache/pulsar/actions/runs/4084265136/jobs/7040983653
   
   When the test is executed, it can be seen from the log that multiple metrics of class `MetadataStoreStats` are registered, and there is one named blank string. So I guess it is caused by other tests not closing `MetadataStoreStats` which is named blank string
   
   ### Modifications
   
   Close `MetadataStore` after tests.
   
   ### Documentation
   
   <!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
   
   - [ ] `doc` <!-- Your PR contains doc changes. -->
   - [ ] `doc-required` <!-- Your PR changes impact docs and you will update later -->
   - [x] `doc-not-needed` <!-- Your PR changes do not impact docs -->
   - [ ] `doc-complete` <!-- Docs have been already added -->
   
   ### Matching PR in forked repository
   
   PR in forked repository: 
   - https://github.com/poorbarcode/pulsar/pull/64


-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] poorbarcode commented on pull request #19433: [fix] [test] fix flaky test MetadataStoreStatsTest.testMetadataStoreStats

Posted by "poorbarcode (via GitHub)" <gi...@apache.org>.
poorbarcode commented on PR #19433:
URL: https://github.com/apache/pulsar/pull/19433#issuecomment-1421889974

   another one:
   - https://github.com/apache/pulsar/actions/runs/4112160925/jobs/7097029412


-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] nicoloboschi merged pull request #19433: [fix] [test] fix flaky test MetadataStoreStatsTest.testMetadataStoreStats

Posted by "nicoloboschi (via GitHub)" <gi...@apache.org>.
nicoloboschi merged PR #19433:
URL: https://github.com/apache/pulsar/pull/19433


-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] nicoloboschi commented on pull request #19433: [fix] [test] fix flaky test MetadataStoreStatsTest.testMetadataStoreStats

Posted by "nicoloboschi (via GitHub)" <gi...@apache.org>.
nicoloboschi commented on PR #19433:
URL: https://github.com/apache/pulsar/pull/19433#issuecomment-1421247002

   /pulsarbot rerun-failure-checks


-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] lhotari commented on pull request #19433: [fix] [test] fix flaky test MetadataStoreStatsTest.testMetadataStoreStats

Posted by "lhotari (via GitHub)" <gi...@apache.org>.
lhotari commented on PR #19433:
URL: https://github.com/apache/pulsar/pull/19433#issuecomment-1424881144

   thanks for fixing this @poorbarcode 


-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] nicoloboschi commented on a diff in pull request #19433: [fix] [test] fix flaky test MetadataStoreStatsTest.testMetadataStoreStats

Posted by "nicoloboschi (via GitHub)" <gi...@apache.org>.
nicoloboschi commented on code in PR #19433:
URL: https://github.com/apache/pulsar/pull/19433#discussion_r1098835990


##########
managed-ledger/src/test/java/org/apache/bookkeeper/test/BookKeeperClusterTestCase.java:
##########
@@ -226,6 +226,8 @@ public void tearDown() throws Exception {
         if (tearDownException != null) {
             throw tearDownException;
         }
+        // cleanup for metrics.
+        metadataStore.close();

Review Comment:
   this should be done before killing zookeeper, can you add it in stopZKCluster before `zkUtil.killCluster();` ? 



##########
pulsar-metadata/src/test/java/org/apache/pulsar/metadata/CounterTest.java:
##########
@@ -95,6 +95,8 @@ public void testCounterDoesNotAutoReset(String provider, Supplier<String> urlSup
         assertNotEquals(l1, l4);
         assertNotEquals(l2, l4);
         assertNotEquals(l3, l4);
+
+        store2.close();

Review Comment:
   please use try/finally block to ensure the store is closed even if the test won't pass



##########
pulsar-metadata/src/test/java/org/apache/pulsar/metadata/impl/MetadataStoreFactoryImplTest.java:
##########
@@ -55,11 +55,13 @@ public void resetMetadataStoreProperty() {
 
 
     @Test
-    public void testCreate() throws MetadataStoreException{
+    public void testCreate() throws Exception{
         MetadataStore instance = MetadataStoreFactoryImpl.create(

Review Comment:
   please use try/finally block to ensure the store is closed even if the test won't pass



-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] poorbarcode commented on a diff in pull request #19433: [fix] [test] fix flaky test MetadataStoreStatsTest.testMetadataStoreStats

Posted by "poorbarcode (via GitHub)" <gi...@apache.org>.
poorbarcode commented on code in PR #19433:
URL: https://github.com/apache/pulsar/pull/19433#discussion_r1098936298


##########
pulsar-metadata/src/test/java/org/apache/pulsar/metadata/CounterTest.java:
##########
@@ -95,6 +95,8 @@ public void testCounterDoesNotAutoReset(String provider, Supplier<String> urlSup
         assertNotEquals(l1, l4);
         assertNotEquals(l2, l4);
         assertNotEquals(l3, l4);
+
+        store2.close();

Review Comment:
   already fixed



-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] poorbarcode commented on pull request #19433: [fix] [test] fix flaky test MetadataStoreStatsTest.testMetadataStoreStats

Posted by "poorbarcode (via GitHub)" <gi...@apache.org>.
poorbarcode commented on PR #19433:
URL: https://github.com/apache/pulsar/pull/19433#issuecomment-1421892541

   /pulsarbot rerun-failure-checks


-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] poorbarcode commented on a diff in pull request #19433: [fix] [test] fix flaky test MetadataStoreStatsTest.testMetadataStoreStats

Posted by "poorbarcode (via GitHub)" <gi...@apache.org>.
poorbarcode commented on code in PR #19433:
URL: https://github.com/apache/pulsar/pull/19433#discussion_r1098936180


##########
pulsar-metadata/src/test/java/org/apache/pulsar/metadata/impl/MetadataStoreFactoryImplTest.java:
##########
@@ -55,11 +55,13 @@ public void resetMetadataStoreProperty() {
 
 
     @Test
-    public void testCreate() throws MetadataStoreException{
+    public void testCreate() throws Exception{
         MetadataStore instance = MetadataStoreFactoryImpl.create(

Review Comment:
   already fixed



##########
managed-ledger/src/test/java/org/apache/bookkeeper/test/BookKeeperClusterTestCase.java:
##########
@@ -226,6 +226,8 @@ public void tearDown() throws Exception {
         if (tearDownException != null) {
             throw tearDownException;
         }
+        // cleanup for metrics.
+        metadataStore.close();

Review Comment:
   already fixed



-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [pulsar] codecov-commenter commented on pull request #19433: [fix] [test] fix flaky test MetadataStoreStatsTest.testMetadataStoreStats

Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #19433:
URL: https://github.com/apache/pulsar/pull/19433#issuecomment-1421909579

   # [Codecov](https://codecov.io/gh/apache/pulsar/pull/19433?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 [#19433](https://codecov.io/gh/apache/pulsar/pull/19433?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (14afc11) into [master](https://codecov.io/gh/apache/pulsar/commit/aa7af1099e72e328be1e7f0c332060b69e6aa0d7?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (aa7af10) will **decrease** coverage by `1.27%`.
   > The diff coverage is `100.00%`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/pulsar/pull/19433/graphs/tree.svg?width=650&height=150&src=pr&token=acYqCpsK9J&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/pulsar/pull/19433?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@             Coverage Diff              @@
   ##             master   #19433      +/-   ##
   ============================================
   - Coverage     64.20%   62.93%   -1.27%     
   + Complexity    26265    25815     -450     
   ============================================
     Files          1832     1832              
     Lines        134067   134113      +46     
     Branches      14753    14755       +2     
   ============================================
   - Hits          86077    84408    -1669     
   - Misses        40135    41970    +1835     
   + Partials       7855     7735     -120     
   ```
   
   | Flag | Coverage Δ | |
   |---|---|---|
   | inttests | `24.73% <100.00%> (-0.19%)` | :arrow_down: |
   | systests | `25.46% <100.00%> (-0.01%)` | :arrow_down: |
   | unittests | `60.12% <100.00%> (-1.34%)` | :arrow_down: |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#carryforward-flags-in-the-pull-request-comment) to find out more.
   
   | [Impacted Files](https://codecov.io/gh/apache/pulsar/pull/19433?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...che/bookkeeper/mledger/impl/ManagedCursorImpl.java](https://codecov.io/gh/apache/pulsar/pull/19433?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-bWFuYWdlZC1sZWRnZXIvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL2Jvb2trZWVwZXIvbWxlZGdlci9pbXBsL01hbmFnZWRDdXJzb3JJbXBsLmphdmE=) | `78.05% <100.00%> (+0.12%)` | :arrow_up: |
   | [...ain/java/org/apache/pulsar/broker/rest/Topics.java](https://codecov.io/gh/apache/pulsar/pull/19433?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cHVsc2FyLWJyb2tlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2Jyb2tlci9yZXN0L1RvcGljcy5qYXZh) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [.../stats/prometheus/AggregatedSubscriptionStats.java](https://codecov.io/gh/apache/pulsar/pull/19433?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cHVsc2FyLWJyb2tlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2Jyb2tlci9zdGF0cy9wcm9tZXRoZXVzL0FnZ3JlZ2F0ZWRTdWJzY3JpcHRpb25TdGF0cy5qYXZh) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...metheus/AggregatedTransactionCoordinatorStats.java](https://codecov.io/gh/apache/pulsar/pull/19433?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cHVsc2FyLWJyb2tlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2Jyb2tlci9zdGF0cy9wcm9tZXRoZXVzL0FnZ3JlZ2F0ZWRUcmFuc2FjdGlvbkNvb3JkaW5hdG9yU3RhdHMuamF2YQ==) | `0.00% <0.00%> (-100.00%)` | :arrow_down: |
   | [...broker/stats/prometheus/TransactionAggregator.java](https://codecov.io/gh/apache/pulsar/pull/19433?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cHVsc2FyLWJyb2tlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2Jyb2tlci9zdGF0cy9wcm9tZXRoZXVzL1RyYW5zYWN0aW9uQWdncmVnYXRvci5qYXZh) | `0.00% <0.00%> (-96.06%)` | :arrow_down: |
   | [.../pulsar/broker/rest/RestMessagePublishContext.java](https://codecov.io/gh/apache/pulsar/pull/19433?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cHVsc2FyLWJyb2tlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2Jyb2tlci9yZXN0L1Jlc3RNZXNzYWdlUHVibGlzaENvbnRleHQuamF2YQ==) | `0.00% <0.00%> (-92.60%)` | :arrow_down: |
   | [...a/org/apache/pulsar/client/util/TypeCheckUtil.java](https://codecov.io/gh/apache/pulsar/pull/19433?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cHVsc2FyLWNsaWVudC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2NsaWVudC91dGlsL1R5cGVDaGVja1V0aWwuamF2YQ==) | `0.00% <0.00%> (-83.34%)` | :arrow_down: |
   | [.../apache/pulsar/utils/CmdGenerateDocumentation.java](https://codecov.io/gh/apache/pulsar/pull/19433?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cHVsc2FyLWJyb2tlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL3V0aWxzL0NtZEdlbmVyYXRlRG9jdW1lbnRhdGlvbi5qYXZh) | `0.00% <0.00%> (-76.93%)` | :arrow_down: |
   | [...ker/stats/prometheus/AggregatedNamespaceStats.java](https://codecov.io/gh/apache/pulsar/pull/19433?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cHVsc2FyLWJyb2tlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL2Jyb2tlci9zdGF0cy9wcm9tZXRoZXVzL0FnZ3JlZ2F0ZWROYW1lc3BhY2VTdGF0cy5qYXZh) | `5.20% <0.00%> (-76.05%)` | :arrow_down: |
   | [...apache/pulsar/websocket/data/ProducerMessages.java](https://codecov.io/gh/apache/pulsar/pull/19433?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-cHVsc2FyLXdlYnNvY2tldC9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvcHVsc2FyL3dlYnNvY2tldC9kYXRhL1Byb2R1Y2VyTWVzc2FnZXMuamF2YQ==) | `0.00% <0.00%> (-75.00%)` | :arrow_down: |
   | ... and [167 more](https://codecov.io/gh/apache/pulsar/pull/19433?src=pr&el=tree-more&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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org