-
Notifications
You must be signed in to change notification settings - Fork 31
test: fix failing live tests #132
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
base: main
Are you sure you want to change the base?
test: fix failing live tests #132
Conversation
|
@v-alexmoraru please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
|
| self.request_id = None | ||
| self.timestamp = None |
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.
you can set those props before parsing the json, and eliminate setting them in 'except' clause.
| message = "An error occurred while processing the operation" | ||
| code = "UnknownError" |
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.
to avoid duplications, consider defining them as constants and use them in all places.
| details: list[dict] = error_data.get("details", []) | ||
|
|
||
| # Extract RootActivityId from the details | ||
| self.request_id = None |
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.
same comment as above
| item = item_factory(item_type) | ||
|
|
||
| if item_type == ItemType.MIRRORED_DATABASE: | ||
| time.sleep(60) |
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 you explain the reason? and isn't 60 second too long?
| max_retries = 3 | ||
| retry_delay = 2 # seconds |
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 you please explain the need for retry?
Adds sleep time for tests using mirrored database, null checks & try-except blocks for several tests' corner cases.