[fix] [test] fix flaky test MetadataStoreStatsTest.testMetadataStoreStats#19433
Merged
nicoloboschi merged 2 commits intoapache:masterfrom Feb 9, 2023
Merged
Conversation
nicoloboschi
requested changes
Feb 7, 2023
| @Test | ||
| public void testCreate() throws MetadataStoreException{ | ||
| public void testCreate() throws Exception{ | ||
| MetadataStore instance = MetadataStoreFactoryImpl.create( |
Contributor
There was a problem hiding this comment.
please use try/finally block to ensure the store is closed even if the test won't pass
| assertNotEquals(l2, l4); | ||
| assertNotEquals(l3, l4); | ||
|
|
||
| store2.close(); |
Contributor
There was a problem hiding this comment.
please use try/finally block to ensure the store is closed even if the test won't pass
| throw tearDownException; | ||
| } | ||
| // cleanup for metrics. | ||
| metadataStore.close(); |
Contributor
There was a problem hiding this comment.
this should be done before killing zookeeper, can you add it in stopZKCluster before zkUtil.killCluster(); ?
nicoloboschi
approved these changes
Feb 7, 2023
Contributor
|
/pulsarbot rerun-failure-checks |
Contributor
Author
Contributor
Author
|
/pulsarbot rerun-failure-checks |
Codecov Report
@@ 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
Flags with carried forward coverage won't be shown. Click here to find out more.
|
Member
|
thanks for fixing this @poorbarcode |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
We can see that this is a flaky test:
When the test is executed, it can be seen from the log that multiple metrics of class
MetadataStoreStatsare registered, and there is one named blank string. So I guess it is caused by other tests not closingMetadataStoreStatswhich is named blank string.Modifications
Close
MetadataStoreafter tests.Documentation
docdoc-requireddoc-not-neededdoc-completeMatching PR in forked repository
PR in forked repository: