-
Notifications
You must be signed in to change notification settings - Fork 14.3k
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
fix: database connection validation when creation #11653
Conversation
Codecov Report
@@ Coverage Diff @@
## master #11653 +/- ##
==========================================
- Coverage 65.76% 61.87% -3.89%
==========================================
Files 873 873
Lines 42316 42310 -6
Branches 3972 3972
==========================================
- Hits 27827 26180 -1647
- Misses 14374 15950 +1576
- Partials 115 180 +65
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
4045167
to
82dfa7f
Compare
55dadd4
to
6491ca7
Compare
@dpgaspar would you mind taking a look at this as it changes some of the logic related to your API refactor? |
bd1ef12
to
459be21
Compare
459be21
to
be2ce74
Compare
SUMMARY
Better database connection validation when creating a database. Discovered this bug while developing #11509 , the symptom of the failed test on the user side is you can add databases with wrong passwords as long as
TABLE_NAMES_CACHE_CONFIG
is enabled. The cause is that Database.get_all_schema_names is a cached function withself.id
as cache key, but a newly created uncommitted Database instance always hasself.id == None
.Also renames a couple of test databases to make it easier to debug in case some of them slip through failed tests and got incorrectly created.
BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
N/A
TEST PLAN
To reproduce the bug with unit tests:
TABLE_NAMES_CACHE_CONFIG
in test config. E.g.AssertionError: 201 != 422
To reproduce the bug in user interface:
TABLE_NAMES_CACHE_CONFIG
ADDITIONAL INFORMATION
cc @dpgaspar @john-bodley