Skip to content

HIVE-29051: TestTezTPCDS30TBPerfCliDriver leaks Postgres container causing intermittent failures elsewhere #5908

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

zabetak
Copy link
Member

@zabetak zabetak commented Jun 27, 2025

What changes were proposed in this pull request and why?

  1. Move metastore/container destroy logic in buildClassRule of CliAdapter. All database/container lifecyle handling must be in the same place to avoid leaks and inconsistent behavior.
  2. Rename QTestMetastoreHandler#afterTest to QTestMetastoreHandler#truncateDatabase to better reflect what is actually doing
  3. Perform database truncation (Derby only) only inside buildTestRule. No need to do it also as part of the class rule
  4. Handle metastore configuration exclusively in buildClassRule. We need to set the configuration only once before the first test runs and this is exactly what happens if we put it in the class rule.
  5. Drop firstTestNotYetRun flag along with related code since there is no longer overlapping logic between test and class rule.
  6. Drop now redundant QTestMetastoreHandler#beforeTest method

Does this PR introduce any user-facing change?

No

How was this patch tested?

Run the following and after each verified (using docker ps) that no container is running.

mvn test -Dtest=TestTezTPCDS30TBPerfCliDriver -Dqfile=cbo_query1.q,cbo_query2.q 
mvn test -Dtest=TestMiniLlapLocalCliDriver -Dtest.metastore.db=postgres -Dqfile="acid_insert_overwrite_update.q,acid_stats3.q"
mvn test -Dtest=TestMiniLlapLocalCliDriver -Dqfile="acid_insert_overwrite_update.q,acid_stats3.q"
mvn test -Dtest=TestMiniLlapLocalCliDriver -Dqfile_regex=cbo_.* -Dtest.output.overwrite 

…using intermittent failures elsewhere

1. Move metastore/container destroy logic in buildClassRule of CliAdapter. All database/container lifecyle handling must be in the same place to avoid leaks and inconsistent behavior.
2. Rename QTestMetastoreHandler#afterTest to QTestMetastoreHandler#truncateDatabase to better reflect what is actually doing
3. Perform database truncation (Derby only) only inside buildTestRule. No need to do it also as part of the class rule
4. Handle metastore configuration exclusively in buildClassRule. We need to set the configuration only once before the first test runs and this is exactly what happens if we put it in the class rule.
5. Drop firstTestNotYetRun flag along with related code since there is no longer overlapping logic between test and class rule.
6. Drop now redundant QTestMetastoreHandler#beforeTest method
@zhangbutao
Copy link
Contributor

@zabetak
Copy link
Member Author

zabetak commented Jun 27, 2025

@zhangbutao That's exactly what is fixing :D

Copy link
Contributor

@zhangbutao zhangbutao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 LGTM
I just using docker ps to verify that no container is running after qtest.

Copy link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants