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

CORE-20708 Ensure API response is 2XX before parsing #6284

Merged
merged 4 commits into from
Jul 15, 2024

Conversation

ben-millar
Copy link
Contributor

We were seeing some test failures tracked under CORE-20708 where the function assertWithRetryIgnoringExceptions was blowing up due to test code which tried to deserialise response payloads without actually checking if the response was a 2XX.

This PR modifies these conditions so that the response code is checked before JSON deserialization is attempted. I noted also that there was a 50/50 split in the test cases between:

  1. it.code == 200 / it.code == 204
  2. it.code == ResponseCode.OK.statusCode / it.code == ResponseCode.NO_CONTENT.statusCode

and have modified all cases to use the latter approach, with descriptive shared consts.

Copy link

sonarcloud bot commented Jul 15, 2024

@corda-jenkins-ci02
Copy link
Contributor

Jenkins build for PR 6284 build 5

Build Successful:
Jar artifact version produced by this PR: 5.3.0.0-alpha-1721034880080
Helm chart version produced by this PR: 5.3.0-alpha.1721034880080
Helm chart pushed to: oci://corda-os-docker-dev.software.r3.com/helm-charts/pr-6284/corda
Helm chart Polaris score: 82

@ben-millar ben-millar marked this pull request as ready for review July 15, 2024 09:43
Copy link
Contributor

@LWogan LWogan left a comment

Choose a reason for hiding this comment

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

LGTM

@ben-millar ben-millar merged commit 123dfde into release/os/5.3 Jul 15, 2024
5 checks passed
@ben-millar ben-millar deleted the bm/CORE-20708/fixing-502-handling branch July 15, 2024 12:44
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.

2 participants