Skip to content

Commit

Permalink
azurerm_machine_learning_workspace: fix acctests (#7635)
Browse files Browse the repository at this point in the history
The machine learning service has changed the delete from a sync operation to an async operation.

Depends on the SDK v44.0.0 PR #7616
  • Loading branch information
ArcturusZhang authored Jul 10, 2020
1 parent 64e5b47 commit b7547ae
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -327,10 +327,15 @@ func resourceArmMachineLearningWorkspaceDelete(d *schema.ResourceData, meta inte
return fmt.Errorf("Error parsing Machine Learning Workspace ID `%q`: %+v", d.Id(), err)
}

if _, err := client.Delete(ctx, id.ResourceGroup, id.Name); err != nil {
future, err := client.Delete(ctx, id.ResourceGroup, id.Name)
if err != nil {
return fmt.Errorf("Error deleting Machine Learning Workspace %q (Resource Group %q): %+v", id.Name, id.ResourceGroup, err)
}

if err := future.WaitForCompletionRef(ctx, client.Client); err != nil {
return fmt.Errorf("Error waiting for deletion of Machine Learning Workspace %q (Resource Group %q): %+v", id.Name, id.ResourceGroup, err)
}

return nil
}

Expand Down

0 comments on commit b7547ae

Please sign in to comment.