-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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 test TestAccIotHubDPS_linkedHubs
#18153
Conversation
01729ee
to
26ac092
Compare
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.
test failure, perhapes we need to poll/wait on creation?
------- Stdout: -------
=== RUN TestAccIotHubDPS_linkedHubs
=== PAUSE TestAccIotHubDPS_linkedHubs
=== CONT TestAccIotHubDPS_linkedHubs
testcase.go:110: Step 1/4 error: Error running apply: exit status 1
Error: creating/updating IoT Device Provisioning Service Iot Hub Dps: (Provisioning Service Name "acctestIoTDPS-220829185508492455" / Resource Group "acctestRG-220829185508492455"): iothub.IotDpsResourceClient#CreateOrUpdate: Failure sending request: StatusCode=404 -- Original Error: Code="Failed" Message="The async operation failed." InnerError={"unmarshalError":"json: cannot unmarshal number into Go struct field serviceErrorInternal.code of type string"} AdditionalInfo=[{"code":404002,"httpStatusCode":"NotFound","message":"Unable to find the IoThub `acctestIoTHub2-220829185508492455.azure-devices.net`. Check if the hub exists and the connection information is correct. If you contact a support representative please include this correlation identifier: ef2c3d4b-cd68-4a92-a2a8-4142e277a8f3, timestamp: 2022-08-29 18:58:55Z, errorcode: IH404002."}]
with azurerm_iothub_dps.test,
on terraform_plugin_test.tf line 61, in resource "azurerm_iothub_dps" "test":
61: resource "azurerm_iothub_dps" "test" {
--- FAIL: TestAccIotHubDPS_linkedHubs (338.94s)
FAIL
c179e49
to
ee80b41
Compare
@katbyte thanks for reviewing the change! I've done some test locally and this issue does happen sometimes. I tried looking at the resource properties, and they are all same during the provisioning failure time whether the issue happens or not, and a retry can create the IotHub DPS correctly. Fortunately, the error code is 404 for this specific issue that linked hubs are not found, I'll add a poll and retry to check the 404 error. |
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.
LGTM 🎩
This functionality has been released in v3.21.0 of the Terraform Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you! |
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions. |
connection_string
is not referencing existing IoT Hubs, causing error "Unable to find the IoThub ...", fixing it by using existing reference.