Skip to content

Commit 5d14f2b

Browse files
committed
Make test pass on GitHub actions
Also made test surface smaller
1 parent c4d9759 commit 5d14f2b

File tree

1 file changed

+7
-20
lines changed

1 file changed

+7
-20
lines changed

mws/resource_workspace_test.go

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -904,27 +904,14 @@ func TestListWorkspaces(t *testing.T) {
904904
}
905905

906906
func TestWorkspace_WaitForResolve_Failure(t *testing.T) {
907-
qa.HTTPFixturesApply(t, []qa.HTTPFixture{
908-
{
909-
Method: "GET",
910-
Resource: "/api/2.0/accounts/abc/workspaces/1234",
911-
ReuseRequest: true,
912-
Response: Workspace{
913-
AccountID: "abc",
914-
WorkspaceID: 1234,
915-
WorkspaceStatus: "RUNNING",
916-
WorkspaceURL: "https://foo-bar-baz.cloud.databricks.com",
917-
},
918-
},
919-
}, func(ctx context.Context, client *common.DatabricksClient) {
907+
qa.HTTPFixturesApply(t, []qa.HTTPFixture{},
908+
func(ctx context.Context, client *common.DatabricksClient) {
920909
a := NewWorkspacesAPI(ctx, client)
921-
err := a.WaitForRunning(Workspace{
922-
AccountID: "abc",
923-
WorkspaceID: 1234,
924-
}, 1*time.Second)
925-
assert.EqualError(t, err, "workspace https://foo-bar-baz.cloud.databricks.com is not yet reachable:"+
926-
" Get \"https://foo-bar-baz.cloud.databricks.com/api/2.0/token/list\": "+
927-
"dial tcp: lookup foo-bar-baz.cloud.databricks.com: no such host")
910+
rerr := a.verifyWorkspaceReachable(Workspace{
911+
WorkspaceURL: "https://900150983cd24fb0.cloud.databricks.com",
912+
})
913+
assert.NotNil(t, rerr)
914+
assert.True(t, rerr.Retryable)
928915
})
929916
}
930917

0 commit comments

Comments
 (0)