-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Cleanup Glue databases left eventually behind by other test runs #12102
Cleanup Glue databases left eventually behind by other test runs #12102
Conversation
import static org.apache.hadoop.hive.metastore.TableType.EXTERNAL_TABLE; | ||
import static org.apache.hadoop.hive.metastore.TableType.VIRTUAL_VIEW; | ||
import static org.assertj.core.api.Assertions.assertThat; | ||
import static org.assertj.core.api.Assertions.assertThatThrownBy; | ||
|
||
public class TestDeltaLakeGlueMetastore | ||
{ | ||
private static final Logger log = Logger.get(TestDeltaLakeGlueMetastore.class); | ||
|
||
private static final String TEST_DATABASE_NAME_PREFIX = "test_delta_glue"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private static final String TEST_DATABASE_NAME_PREFIX = "test_delta_glue"; | |
private static final String TEST_DATABASE_NAME_PREFIX = "test_"; |
cc @alexjo2144
Does this relate to @alexjo2144 's #11903 ? |
If this approach is more general we can close mine |
dee3eff
to
38f578b
Compare
import static org.apache.hadoop.hive.metastore.TableType.EXTERNAL_TABLE; | ||
import static org.apache.hadoop.hive.metastore.TableType.VIRTUAL_VIEW; | ||
import static org.assertj.core.api.Assertions.assertThat; | ||
import static org.assertj.core.api.Assertions.assertThatThrownBy; | ||
|
||
public class TestDeltaLakeGlueMetastore | ||
{ | ||
private static final Logger log = Logger.get(TestDeltaLakeGlueMetastore.class); | ||
|
||
private static final String TEST_DATABASE_NAME_PREFIX = "test_"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By using this prefix will have the outcome that this test will delete glue databases belonging to other connectors as well (e.g. : iceberg).
To avoid doing the same logic for Iceberg too, can we place this logic on a shared location? Naive idea - a new module under testing
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@findepi WDYT ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is fine, let's just not introduce a new module for this
@@ -315,4 +332,38 @@ private static String randomName() | |||
{ | |||
return UUID.randomUUID().toString().toLowerCase(ENGLISH).replace("-", ""); | |||
} | |||
|
|||
private void cleanupOrphanedDatabases() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we put this in a separate test Class? It could be nice to run this class as a suite without needing to go through and clean all orphan databases
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alexjo2144 please tell me if this is what you wanted
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is, thanks
1044d95
to
6e9fd8a
Compare
@@ -161,7 +161,6 @@ public void tearDown() | |||
deleteRecursively(tempDir.toPath(), ALLOW_INSECURE); | |||
} | |||
}); | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not related.
515d4e0
to
270e9f2
Compare
Putting it in a different class does mean you need to add it to: |
Co-authored-by: Marius Grama <findinpath@gmail.com>
270e9f2
to
d21bb5a
Compare
Test PR: #12154 |
Looks like the new test passed |
CI failed: #12147 |
Co-authored-by: Marius Grama findinpath@gmail.com
Description
Related issues, pull requests, and links
Documentation
( ) No documentation is needed.
( ) Sufficient documentation is included in this PR.
( ) Documentation PR is available with #prnumber.
( ) Documentation issue #issuenumber is filed, and can be handled later.
Release notes
( ) No release notes entries required.
( ) Release notes entries required with the following suggested text: