test: make org.apache.gora.hbase.store.TestHBaseStore#assertMetadataAnalyzer deterministic #307
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.
Summary
org.apache.gora.hbase.store.TestHBaseStore#assertMetadataAnalyzerby waiting for HBase metadata to become visible before assertinggora-hbase; production code remains untouchedDetection (Baseline)
mvn -pl gora-hbase -Dtest=org.apache.gora.hbase.store.TestHBaseStore test -Dsurefire.parallel=classes -Dsurefire.threadCount=4gora-hbase/target/surefire-reports/org.apache.gora.hbase.store.TestHBaseStore.txt):assertMetadataAnalyzerinvoked the analyzer before the HBase mini cluster finished registering tables and column families, so the assertions intermittently observed partial metadataFix Details
metadataAnalyzer.getTablesNames()equals the expected list and each table exposes the full column-family setfinallyblock that callsmetadataAnalyzer.close()to release resources between runsawaitTables,awaitTableMetadata, andsleepForMetadatato encapsulate the polling logic for future reuseValidation
mvn -pl gora-hbase -Dtest=org.apache.gora.hbase.store.TestHBaseStore test -Dsurefire.parallel=classes -Dsurefire.threadCount=4gora-hbase/target/surefire-reports/TEST-org.apache.gora.hbase.store.TestHBaseStore.xml):<failure>or<error>child, confirming the same detection command now records this test as passingassertMetadataAnalyzerTests Updated
org.apache.gora.hbase.store.TestHBaseStore#assertMetadataAnalyzerRisk