-
Notifications
You must be signed in to change notification settings - Fork 0
#125: Added retry when deleting SaaS instance #126
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
Merged
ckunki
merged 33 commits into
main
from
bug/125-Made_operation_delete_wait_for_SaaS_instance_to_enable_deletion
Dec 11, 2025
Merged
Changes from all commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
b47703b
#125: Made operation delete wait for SaaS instance to enable deletion
ckunki d9ff70a
Moved wait_until_running to method delete_database()
ckunki 1745370
Prepare release 2.6.0
ckunki da2da36
Added wait for delete
ckunki 37629cb
project:fix
ckunki b6d2a97
Fixed type error
ckunki 1ea9003
Modified tests
ckunki dc4d3f1
project:fix
ckunki 63aeff8
Fixed tests
ckunki 7180fc0
Fixed tests 2
ckunki 7875c4c
Fixed tests 3
ckunki faa125e
project:fix
ckunki 5e4bb90
Fixed tests 4
ckunki ce0b67c
project:fix
ckunki ae24e7f
Fixed tests 5
ckunki 7f59a81
Fixed mypy errors
ckunki 9b4536f
project:fix
ckunki 41ecbcd
Fixed pyexasol connection to use websocket_sslopt={"cert_reqs": ssl.C…
ckunki 846b81f
Added client argument to delete
ckunki 1523047
Added import for ssl
ckunki 474a1d5
Fixed database connection to ignore SSL
ckunki 73c53a3
Removed SSL option
ckunki d75aac3
Added unit tests
ckunki f5e192c
Added test/__init__
ckunki ae4f6bb
Updated max timeout for deleting a datbase
ckunki beeae07
project:fix
ckunki ae9411b
Tried to shorten duration of integration tests
ckunki c6659da
Updated connection tests
ckunki 9d97005
Cleanup
ckunki d44cc2a
More cleanup and updated docstrings
ckunki 9fdf7e4
Added dummy integration test
ckunki f1dbf07
Removed obsolete nox session
ckunki 535ee43
Fixed sonar findings
ckunki File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| # 2.6.0 - 2025-12-11 | ||
|
|
||
| ## Summary | ||
|
|
||
| This release changes the strategy for deleting a SaaS database instance, as required by the changed behavior of the actual SaaS backend. | ||
|
|
||
| Before, SAPIPY used only a fixed waiting time. In case of HTTP responses with status code 400 and message `Operation.*not allowed.*cluster.*not.*in.*proper state` SAPIPY now retries deleting the SaaS instance for max. 5 minutes. | ||
|
|
||
| ## Bugfixes | ||
|
|
||
| * #125: Added retry when deleting SaaS instance |
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
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
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
File renamed without changes.
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
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,47 +1,57 @@ | ||
| import contextlib | ||
| import ssl | ||
|
|
||
| import pyexasol | ||
| import pytest | ||
|
|
||
| from exasol.saas.client.api_access import get_connection_params | ||
|
|
||
| SSL_OPTIONS = {"websocket_sslopt": {"cert_reqs": ssl.CERT_NONE}} | ||
|
|
||
|
|
||
| @pytest.fixture | ||
ckunki marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| def pyexasol_connection( | ||
| saas_host, | ||
| saas_pat, | ||
| saas_account_id, | ||
| allow_connection, | ||
| operational_saas_database_id, | ||
| ): | ||
| @contextlib.contextmanager | ||
| def connect(**kwargs): | ||
| params = get_connection_params( | ||
| host=saas_host, | ||
| account_id=saas_account_id, | ||
| pat=saas_pat, | ||
| **kwargs, | ||
| ) | ||
| params.update(SSL_OPTIONS) | ||
| with pyexasol.connect(**params) as con: | ||
| yield con | ||
|
|
||
| return connect | ||
|
|
||
|
|
||
| @pytest.mark.slow | ||
| def test_get_connection_params_with_id( | ||
| saas_host, saas_pat, saas_account_id, operational_saas_database_id, allow_connection | ||
| pyexasol_connection, | ||
| operational_saas_database_id, | ||
| ): | ||
| """ | ||
| This integration test checks that opening a pyexasol connection to a SaaS DB with | ||
| known id and executing a query works. | ||
| """ | ||
| connection_params = get_connection_params( | ||
| host=saas_host, | ||
| account_id=saas_account_id, | ||
| pat=saas_pat, | ||
| database_id=operational_saas_database_id, | ||
| ) | ||
| with pyexasol.connect(**connection_params) as pyconn: | ||
| with pyexasol_connection(database_id=operational_saas_database_id) as pyconn: | ||
| result = pyconn.execute("SELECT 1;").fetchall() | ||
| assert result == [(1,)] | ||
|
|
||
|
|
||
| @pytest.mark.slow | ||
| def test_get_connection_params_with_name( | ||
| saas_host, | ||
| saas_pat, | ||
| saas_account_id, | ||
| operational_saas_database_id, | ||
| database_name, | ||
| allow_connection, | ||
| ): | ||
| def test_get_connection_params_with_name(pyexasol_connection, database_name): | ||
| """ | ||
| This integration test checks that opening a pyexasol connection to a SaaS DB with | ||
| known name and executing a query works. | ||
| """ | ||
| connection_params = get_connection_params( | ||
| host=saas_host, | ||
| account_id=saas_account_id, | ||
| pat=saas_pat, | ||
| database_name=database_name, | ||
| ) | ||
| with pyexasol.connect(**connection_params) as pyconn: | ||
| with pyexasol_connection(database_name=database_name) as pyconn: | ||
| result = pyconn.execute("SELECT 1;").fetchall() | ||
| assert result == [(1,)] | ||
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.