Skip to content

Commit 403a8e2

Browse files
utam0kroboquat
authored andcommitted
test: fix a bug in stopWs
1 parent b3d61ac commit 403a8e2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

test/pkg/integration/workspace.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,9 +321,10 @@ func stopWsF(t *testing.T, instanceID string, api *ComponentAPI) stopWorkspaceFu
321321
return dr.Status, err
322322
}
323323

324+
var lastStatus *wsmanapi.WorkspaceStatus
324325
for {
325326
t.Logf("waiting for stopping the workspace: %s", instanceID)
326-
lastStatus, err := WaitForWorkspaceStop(sctx, api, instanceID)
327+
lastStatus, err = WaitForWorkspaceStop(sctx, api, instanceID)
327328
if st, ok := status.FromError(err); ok && st.Code() == codes.Unavailable {
328329
api.ClearWorkspaceManagerClientCache()
329330
t.Logf("got %v during waiting for stopping the workspace", st)
@@ -334,7 +335,7 @@ func stopWsF(t *testing.T, instanceID string, api *ComponentAPI) stopWorkspaceFu
334335
}
335336
break
336337
}
337-
return nil, err
338+
return lastStatus, err
338339
}
339340
}
340341

0 commit comments

Comments
 (0)