Skip to content
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: handle multiple sandbox processes in resumable state #944

Merged
merged 2 commits into from
Oct 4, 2023

Conversation

shetzel
Copy link
Contributor

@shetzel shetzel commented Sep 29, 2023

What does this PR do?

handle multiple sandbox processes in resumable state. The error that happens has the SandboxProcesses added to err.data , and a resume lifecycle event is fired with that data for consumers to act on.

What issues does this PR fix or reference?

@W-13635704@

if (resumeSandboxRequest.SandboxName) {
sandboxCreationProgress = await this.querySandboxProcessBySandboxName(resumeSandboxRequest.SandboxName);
} else if (resumeSandboxRequest.SandboxProcessObjId) {
if (resumeSandboxRequest.SandboxProcessObjId) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefer the SandboxProcessId over name since it's unique.

expect(queryStub.firstCall.firstArg).to.be.equal(queryStr);
expect(pollStatusAndAuthStub.calledOnce).to.be.true;
expect(result).to.be.equal(statusResult.records[0]);
describe('createSandbox', () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most of the changes here are reorganization of the existing tests to make more sense. I added a bunch of new tests as well in the resumeSandbox and querySandboxProcess sections.

err.data = result;
throw err;
}
return result[0];
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is mostly what Jochen's PR is, with some additions to the query to ORDER BY and augment the MultipleRecords error (data property) with the sandbox processes.

cristiand391
cristiand391 previously approved these changes Oct 3, 2023
@cristiand391 cristiand391 merged commit a49409d into main Oct 4, 2023
29 checks passed
@cristiand391 cristiand391 deleted the sh/improved-resume-sandbox branch October 4, 2023 21:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants