-
Notifications
You must be signed in to change notification settings - Fork 19
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: TOOLS-3012 standardise error handling string for manage roster #337
base: master
Are you sure you want to change the base?
Conversation
a-spiker
commented
Feb 20, 2025
•
edited
Loading
edited
- removes special string handling
- removes special string handling
@@ -2067,7 +2067,7 @@ async def test_info_cluster_stable_with_errors(self): | |||
) | |||
|
|||
self.info_mock.return_value = "ERROR::unstable cluster" | |||
expected = ASInfoClusterStableError("ERROR::unstable cluster") | |||
expected = ASInfoResponseError("Server returned an error response for info command", "ERROR::unstable cluster") |
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 looks like it would still fail since it would be ERROR:7:unstable cluster
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.
@kportertx We have removed special string handling with this PR and treated every error generically. With this change, we always handle the Exception, which goes to a happy path where the User can choose what to do next.
Without this change, we were abstracting the Error thrown from the server. Here's a complete experience example.
Admin+> manage roster stage observed ns sc
ERROR: Server returned an error response for info command : unstable cluster.
WARNING: It is advised that you do not manage the roster. Run 'info network' for more information.
You are about to set the pending-roster for namespace sc to: A2, A1, A0
Confirm that you want to proceed by typing x5d8ee, or cancel by typing anything else.
x5d8ee
Pending roster now contains observed nodes.
Run "manage recluster" for your changes to take effect.
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 path was broken due to unstable-cluster
-> unstable cluster
change from the server where asadm was handling these special strings viz unstable cluster
, cluster not specified size
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.
K, just looked like this test would still fail.
@@ -2053,7 +2053,7 @@ async def test_info_cluster_stable(self): | |||
|
|||
async def test_info_cluster_stable_with_errors(self): | |||
self.info_mock.return_value = "ERROR::cluster not specified size" | |||
expected = ASInfoClusterStableError("ERROR::cluster not specified size") | |||
expected = ASInfoResponseError("Server returned an error response for info command", "ERROR::cluster not specified size") |
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 directly use INFO_SERVER_ERROR_RESPONSE here rather than the hardcoded string?