Fix flaky TestInternalMixedCatalogService by hardening test cleanup#4165
Open
j1wonpark wants to merge 2 commits intoapache:masterfrom
Open
Fix flaky TestInternalMixedCatalogService by hardening test cleanup#4165j1wonpark wants to merge 2 commits intoapache:masterfrom
j1wonpark wants to merge 2 commits intoapache:masterfrom
Conversation
When a test method fails mid-way after creating a table but before dropping it, the @AfterEach cleanup could not drop the non-empty database. This left residual state that caused cascading failures in subsequent nested test classes (Database already exists, assertion on listDatabases().isEmpty(), etc.). - CompatibilityCatalogTests.cleanDatabase: drop residual table before dropping database, wrap both in try-catch - TestTableCommit.after: guard dropTable with tableExists check, wrap in try-catch to prevent cascading cleanup failures Signed-off-by: Jiwon Park <jpark92@outlook.kr>
Add missing try-catch around dropDatabase in TestTableOperation.after() for consistency with TestTableCommit and CompatibilityCatalogTests cleanup methods. Signed-off-by: Jiwon Park <jpark92@outlook.kr>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #4165 +/- ##
============================================
- Coverage 29.93% 29.75% -0.18%
- Complexity 4229 4239 +10
============================================
Files 675 681 +6
Lines 53990 54837 +847
Branches 6838 7001 +163
============================================
+ Hits 16161 16316 +155
- Misses 36636 37299 +663
- Partials 1193 1222 +29
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
Why are the changes needed?
When a test method in
TestInternalMixedCatalogServicefails mid-way after creating a table but before dropping it, the@AfterEachcleanup could not drop the non-empty database. This left residual state that caused cascading failures in subsequent nested test classes (Database already exists, assertion onlistDatabases().isEmpty(), etc.).Brief change log
TestTableCommit.after(): GuarddropTablewithtableExistscheck, wrap bothdropTableanddropDatabasein try-catch to prevent cascading cleanup failuresCompatibilityCatalogTests.cleanDatabase(): Drop residual table before dropping database, wrap both in try-catchTestTableOperation.after(): WrapdropDatabasein try-catch for consistency with other nested test classesHow was this patch tested?
Documentation