-
Notifications
You must be signed in to change notification settings - Fork 66
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
Added support for track 2 SDKs (azure-mgmt-iothub >= 1.0.0) #329
Changes from all commits
d5dce83
53c6718
d07576b
6bdb721
2a58430
5b2d66d
7433c2c
5efdd3d
a39d4ac
b45cd89
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 |
---|---|---|
|
@@ -182,6 +182,21 @@ def test_jobs(self): | |
checks=[self.check("jobId", self.job_ids[2])], | ||
) | ||
|
||
# Allow time for job to transfer to scheduled state (cannot cancel job in running state) | ||
from time import sleep | ||
sleep(5) | ||
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. Should we make this longer? Or is 5 second sleep consistently working. 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. Consistently working for me, but I also haven't seen this issue pop up in the build pipelines, only in local testing - one of my hubs got stuck with a job pending in a The error was because our test tried to cancel a job before it transitioned from |
||
|
||
self.cmd( | ||
"iot hub job show --job-id {} -n {} -g {}".format( | ||
self.job_ids[2], LIVE_HUB, LIVE_RG | ||
), | ||
checks=[ | ||
self.check("jobId", self.job_ids[2]), | ||
self.check("status", "scheduled"), | ||
], | ||
) | ||
|
||
# Cancel job | ||
self.cmd( | ||
"iot hub job cancel --job-id {} -n {} -g {}".format( | ||
self.job_ids[2], LIVE_HUB, LIVE_RG | ||
|
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.
We may hit a regression here since before
sub_id
was extracted when the client was initialized and used to build thetarget
dictionary. Might help determine problems if we change this https://github.com/c-ryan-k/azure-iot-cli-extension/blob/sdk_track_2_support/azext_iot/tests/iothub/test_iothub_discovery_int.py#L102 to assert sub_id is not the "unknown" placeholder value.