kuczoram opened a new pull request, #6956:
URL: https://github.com/apache/hive/pull/6956

   <!--
   Thanks for sending a pull request!  Here are some tips for you:
     1. If this is your first time, please read our contributor guidelines: 
https://cwiki.apache.org/confluence/display/Hive/HowToContribute
     2. Ensure that you have created an issue on the Hive project JIRA: 
https://issues.apache.org/jira/projects/HIVE/summary
     3. Ensure you have added or run the appropriate tests for your PR: 
     4. If the PR is unfinished, add '[WIP]' in your PR title, e.g., 
'[WIP]HIVE-XXXXX:  Your PR title ...'.
     5. Be sure to keep the PR description updated to reflect all changes.
     6. Please write your PR title to summarize what this PR proposes.
     7. If possible, provide a concise example to reproduce the issue for a 
faster review.
   
   -->
   
   ### What changes were proposed in this pull request?
   
   - CompactorTest.setup(): delete the directory before creating it, so every 
test starts empty.
   - TestCompactionMetrics: add an **After** that calls compactorTestCleanup().
   
   
   ### Why are the changes needed?
   Compactor tests that extend CompactorTest can fail depending on which other 
test classes ran before them in the same Maven run. For example, 
TestWorker2#minorNoBaseLotsOfDeltas fails with:
   
   ```
   java.lang.AssertionError: expected:<12> but was:<15>
       at 
org.apache.hadoop.hive.ql.txn.compactor.TestWorker.compactNoBaseLotsOfDeltas(TestWorker.java:644)
   
   ```
   if it runs after TestCompactionMetrics#testWorkerPerfMetrics in the same 
split.
   
   **How to reproduce:**
   `mvn -pl ql test 
-Dtest='TestCompactionMetrics#testWorkerPerfMetrics,TestWorker2#minorNoBaseLotsOfDeltas'
 -Dsurefire.runOrder=alphabetical`
   
   **Cause**
   CompactorTest.setup() creates each test's directory as 
${test.tmp.dir}/compactor_test_table_<N>, where N comes from a static 
AtomicInteger. Surefire runs each test class in a new JVM (reuseForks=false), 
so N starts at 0 in every class. ql/target/tmp is only cleaned once per Maven 
run, so tests in different classes get the same directory.
   
   TestCompactionMetrics never calls compactorTestCleanup(), so its files stay 
behind. When a later test reuses that directory and the same table name 
(mapwb), it finds old base and delta directories. The compactor then marks some 
deltas as obsolete, and the test's file count assertions fail.
   
   ### Does this PR introduce _any_ user-facing change?
   No, it is just unit test fix
   
   ### How was this patch tested?
   By running the unit tests
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

  • [PR] HIVE-30250: Compactor tes... kuczoram (via GitHub) via gitbox

Reply via email to