-
Notifications
You must be signed in to change notification settings - Fork 66
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
Adding Max HTTP Response Size IT #901
Conversation
Signed-off-by: Dennis Toepker <[email protected]>
) | ||
Assert.assertNotNull(updateSettingsResponse) | ||
logger.info("update settings response: $updateSettingsResponse") | ||
Thread.sleep(1000) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
any reason to wait for 1s
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For all comments regarding adding a 1 second wait, I took inspiration from other similar ITs, for example: https://github.com/opensearch-project/notifications/blob/main/notifications/notifications/src/test/kotlin/org/opensearch/integtest/send/SendTestMessageWithMockServerIT.kt
""".trimIndent() | ||
val configId = createConfigWithRequestJsonString(createRequestJsonString) | ||
Assert.assertNotNull(configId) | ||
Thread.sleep(1000) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and here
val statusText = sendResponse.getAsJsonArray("status_list")[0].asJsonObject["delivery_status"].asJsonObject["status_text"].asString | ||
|
||
// we set the max HTTP response size to 8 bytes, which means the expected string length of the response is 8 / 2 (bytes per Java char) = 4 | ||
Assert.assertEquals(4, statusText.length) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how about we set max http response size to 9? how the result will look like?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it will do an int division truncation and limit the string to 4 chars
notifications/notifications/src/test/kotlin/org/opensearch/integtest/MaxHTTPResponseSizeIT.kt
Show resolved
Hide resolved
Signed-off-by: Dennis Toepker <[email protected]>
* Adding integ test for HTTP response max size setting Signed-off-by: Dennis Toepker <[email protected]> * misc build fixes Signed-off-by: Dennis Toepker <[email protected]> --------- Signed-off-by: Dennis Toepker <[email protected]> Co-authored-by: Dennis Toepker <[email protected]> (cherry picked from commit a62c920) Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
* Adding integ test for HTTP response max size setting * misc build fixes --------- (cherry picked from commit a62c920) Signed-off-by: Dennis Toepker <[email protected]> Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com> Co-authored-by: Dennis Toepker <[email protected]>
Description
IT for #861
Issues Resolved
See above Issue
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.