-
Notifications
You must be signed in to change notification settings - Fork 2.3k
[SU] Add method that cancels subscriptions in integration tests #42298
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: master
Are you sure you want to change the base?
Conversation
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.
Pull request overview
This PR adds subscription cancellation support to the integration testing infrastructure by implementing a cancel method for EventSubscriptionHandler and adding a configurable timeout parameter to the existing cancel method in AttributeSubscriptionHandler. This enables proper cleanup of subscriptions in Software Update (OTA) integration tests.
Key Changes:
- Added new
cancelmethod toEventSubscriptionHandlerclass for canceling event subscriptions - Made the timeout parameter configurable in
AttributeSubscriptionHandler.cancelmethod
src/python_testing/matter_testing_infrastructure/matter/testing/event_attribute_reporting.py
Outdated
Show resolved
Hide resolved
src/python_testing/matter_testing_infrastructure/matter/testing/event_attribute_reporting.py
Outdated
Show resolved
Hide resolved
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.
Code Review
This pull request introduces a cancel method for EventSubscriptionHandler and updates the existing cancel method in AttributeSubscriptionHandler to allow parameterizing the timeout. This is a useful addition for integration tests.
My review focuses on an issue in the implementation of both cancel methods. They currently catch and swallow asyncio.CancelledError, which is generally incorrect for asyncio programming as it prevents tasks from being properly cancelled. I've suggested removing this exception handling to ensure correct cancellation behavior and also proposed updating the associated comments for clarity.
src/python_testing/matter_testing_infrastructure/matter/testing/event_attribute_reporting.py
Outdated
Show resolved
Hide resolved
src/python_testing/matter_testing_infrastructure/matter/testing/event_attribute_reporting.py
Outdated
Show resolved
Hide resolved
…g/event_attribute_reporting.py Co-authored-by: Copilot <[email protected]>
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.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
|
PR #42298: Size comparison from d85e161 to 26a97e8 Full report (8 builds for cc13x4_26x4, nrfconnect, realtek, stm32)
|
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.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.
src/python_testing/matter_testing_infrastructure/matter/testing/event_attribute_reporting.py
Outdated
Show resolved
Hide resolved
…g/event_attribute_reporting.py Co-authored-by: Copilot <[email protected]>
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.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.
src/python_testing/matter_testing_infrastructure/matter/testing/event_attribute_reporting.py
Outdated
Show resolved
Hide resolved
…g/event_attribute_reporting.py Co-authored-by: Copilot <[email protected]>
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.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.
src/python_testing/matter_testing_infrastructure/matter/testing/event_attribute_reporting.py
Show resolved
Hide resolved
src/python_testing/matter_testing_infrastructure/matter/testing/event_attribute_reporting.py
Show resolved
Hide resolved
|
PR #42298: Size comparison from d85e161 to 73edc2a Full report (35 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, nrfconnect, nxp, psoc6, qpg, realtek, stm32, telink)
|
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.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
|
PR #42298: Size comparison from d85e161 to 0991a7e Increases above 0.2%:
Full report (35 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, nrfconnect, nxp, psoc6, qpg, realtek, stm32, telink)
|
Summary
This pull request introduces a
cancelmethod forEventSubscriptionHandlerand updates the existing cancel method inAttributeSubscriptionHandlerto allow parameterizing the timeout. This is a useful addition for integration tests.Catching and swallowing the
asyncio.CancelledErroris incorrect, thus, a test might continue working when it is supposed to be cancelled (for example, when exceeding the Mobly test timeout. This is the reason why the 200 seconds timeout was added to the TC_CADMIN_1_3 test.Related issues
Fixes project-chip/matter-test-scripts#735
Testing
Tested manually with TC_SC_2_2.py + REPL tests passing