Skip to content

[phee-682] Fix env it#6

Open
shkr7 wants to merge 12 commits intodevelopfrom
fix-env-it
Open

[phee-682] Fix env it#6
shkr7 wants to merge 12 commits intodevelopfrom
fix-env-it

Conversation

@shkr7
Copy link

@shkr7 shkr7 commented Jul 2, 2024

PHEE-682 Ephemeral Flaky TCs Fix

Checklist

Please make sure these boxes are checked before submitting your pull request - thanks!

  • Followed the PR title naming convention mentioned above.

  • Acknowledge that we will not merge PRs that are not passing the checks ("green") - it is your (author's) responsibility to get a proposed PR to pass all the checks, not primarily the project's maintainers.

  • The PR title should include a JIRA ticket

  • Design-related bullet points or design document links related to this PR added in the description above.

  • Updated corresponding Postman Collection or API documentation for the changes in this PR.

  • Create/update unit or integration tests for verifying the changes made.

  • Add required Swagger annotation and update API documentation with details of any API changes if applicable

  • Followed the naming conventions as given in https://docs.google.com/document/d/1Q4vaMSzrTxxh9TS0RILuNkSkYCxotuYk1Xe0CMIkkCU/edit?usp=sharing

  • Followed coding conventions at https://cwiki.apache.org/confluence/display/FINERACT/Coding+Conventions.

FYI our guidelines for code reviews same as https://cwiki.apache.org/confluence/display/FINERACT/Code+Review+Guide.

@shkr7 shkr7 force-pushed the fix-env-it branch 2 times, most recently from 8684eec to 7f50e0b Compare July 10, 2024 11:08
@shkr7 shkr7 changed the title [fix-env-it] Fix env it [phee-682] Fix env it Jul 12, 2024
@When("I call the batch summary API with expected status of {int} with total {int} txns")
public void callBatchSummaryAPI(int expectedStatus, int totalTxns) {
await().atMost(awaitMost, SECONDS).pollDelay(pollDelay, SECONDS).pollInterval(pollInterval, SECONDS).untilAsserted(() -> {
await().atMost(120, SECONDS).pollDelay(pollDelay, SECONDS).pollInterval(pollInterval, SECONDS).untilAsserted(() -> {

Choose a reason for hiding this comment

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

donot hard code these values

Choose a reason for hiding this comment

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

need to be taken from a config


awaitly:
maxWaitTime: 25
maxWaitTime: 120

Choose a reason for hiding this comment

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

I am accepting this as the awaitly time out is a max wait time and this doesn't affect tests that complete early.

Copy link

@fynmanoj fynmanoj left a comment

Choose a reason for hiding this comment

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

Sorry for approving it earlier. some of these issues did not catch my eye.
please review Awaitly usage.

@Then("I check for result file URL validity")
public void iCheckForResultFileURLValidity() {
assertThat(isValidURL(scenarioScopeState.batchAndSubBatchSummaryResponse.getFile())).isTrue();
await().atMost(awaitMost, SECONDS).pollDelay(pollDelay, SECONDS).pollInterval(pollInterval, SECONDS).untilAsserted(() -> {

Choose a reason for hiding this comment

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

Awaitly may not be needed here as, this block is not making any external call.
Are we waiting for any parallel process to fill data into this DTO? i dont think we have such a n architecture

logger.error("Error parsing the batch summary response", e);
}
assertThat(scenarioScopeState.batchAndSubBatchSummaryResponse).isNotNull();
await().atMost(awaitMost, SECONDS).pollDelay(pollDelay, SECONDS).pollInterval(pollInterval, SECONDS).untilAsserted(() -> {

Choose a reason for hiding this comment

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

here again, Awaitly is not required here, there are no external request in this block

iCanCreateAnRedeemVoucherRequestDTOForVoucherRedemption();
iCallTheRedeemVoucherAPIWithExpectedStatusOf(200);
assertUnsuccessfulRedemption();
await().atMost(awaitMost, SECONDS).pollDelay(pollDelay, SECONDS).pollInterval(pollInterval, SECONDS).untilAsserted(() -> {

Choose a reason for hiding this comment

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

here as well, Await doesn't make much sense as we are making a post request. repeating this step has no value.

@fynmanoj fynmanoj self-requested a review July 23, 2024 05:54
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