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

Allow 'should be able to cancel a snap' test to pass when a cancel successfully occurs (backport #7351) [release/4.10.x] #7362

Merged
merged 1 commit into from
Nov 13, 2024

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Nov 13, 2024

This test had the most failures out of any test in the integration tests pipeline in the last 14 days.

image

Upon investigation, it seems this test is not actually flaky but that this test will always fail anytime a snap is successfully cancellled. I had modified my native code to sleep after starting the snap in order to always cancel in time. It would fail because of this line: expect(err.message).to.equal("aborted");. The error message would instead be 'Unknown server response code.' Most of the time the snap completes before the cancelSnap request is processed. On the backend an error is thrown with the message 'aborted' but ultimately that made its way into 'handleUnknownResponse' which results in the error message 'Unknown server response code.' The message of aborted could only be accessed if one called this.load() on the request,

I changed the aborted HTTP error to be 499 which is an error code to indicate that a client has closed the request. And handled that as a special case in the handleUnknownResponse function.

Originally I thought it would make more sense to add 499 to the getStatus function, but then line 344 would no longer return RpcRequestStatus.Unknown and suddenly I was unable to cancel a snap before it was completed. Im guessing something to do with loading the value on line 360. Either way I didn't think it was worth putting more time into because RPC is deprecated and will be replaced with something else soon.
image


This is an automatic backport of pull request #7351 done by [Mergify](https://mergify.com).

…ccessfully occurs (#7351)

Co-authored-by: Paul Connelly <22944042+pmconne@users.noreply.github.com>
(cherry picked from commit bf842bb)
@aruniverse aruniverse merged commit e20de5f into release/4.10.x Nov 13, 2024
16 checks passed
@aruniverse aruniverse deleted the mergify/bp/release/4.10.x/pr-7351 branch November 13, 2024 18:22
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