-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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 cirque - update int/pointer casting and reset subscription counts in tests. #10771
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -344,11 +344,14 @@ def run(self): | |
"OnOff", "OnOff", nodeid, endpoint, 1, 10) | ||
changeThread = _conductAttributeChange( | ||
self.devCtrl, nodeid, endpoint) | ||
# Reset the number of subscriptions received as subscribing causes a callback. | ||
handler.subscriptionReceived = 0 | ||
changeThread.start() | ||
with handler.cv: | ||
while handler.subscriptionReceived < 5: | ||
# We should observe 10 attribute changes | ||
handler.cv.wait() | ||
changeThread.join() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you comment on the join reason? Could this wait forever on failed test? Should we have a timeout? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That thread won't fail to join unless the send message call hangs, in which case we're already sunk in this test. The real challenge here is the handler.subscriptionReceived never hitting 5, which will happen if the two threads get out of sync with how many subscriptions they're looking for. But we already have that condition in here, and there's a timer on the tests anyway. I added this because before the thread was continuing along and sending message while other parts of the test were going and it was causing some interesting behaviour. That's rather a different problem (ie, we should add tests for what happens when you fire just a whole lot of requests to the node), but that's orthogonal to this issue. |
||
return True | ||
except Exception as ex: | ||
self.logger.exception(f"Failed to finish API test: {ex}") | ||
|
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.
The comment seems to mismatch intent. Is there a bug here?
@yunhanw-google
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.
Probably just a bug.