Skip to content
This repository has been archived by the owner on Jul 23, 2024. It is now read-only.

Improve waiting strategy for Integration tests #399

Merged
merged 1 commit into from
Jun 7, 2023

Conversation

masayag
Copy link
Collaborator

@masayag masayag commented Jun 6, 2023

What this PR does / why we need it:
Instead of relying on okhttp async implementation, we use executor service to invoke recurring requests to the service till completion.
This is designed to decrease the CPU load even lower while maintaining more readable and easier-to-maintain code.

Which issue(s) this PR fixes (optional, use fixes #<issue_number>(, fixes #<issue_number>, ...) format, where issue_number might be a GitHub issue, or a Jira story (FLPATH-xxxx):
Fixes #FLPATH-399

Change type

  • New feature
  • Bug fix
  • Unit tests
  • Integration tests
  • CI
  • Documentation
  • Auto-generated SDK code

Impacted services

  • Workflow Service
  • Notification Service

Checklist

  • Subject and description added to both, commit and PR.
  • Relevant issues have been referenced.

@openshift-ci openshift-ci bot requested review from gciavarrini and RichardW98 June 6, 2023 10:59
@@ -57,7 +51,7 @@ public static ApiClient getParodosAPiClient()
}

int port = Integer.parseInt(serverPort);
if (port <= 0 && port > 65535) {
if (port <= 0 || port > 65535) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this isn't related to this PR, but fixes a bug since this if used to return always false.

Copy link
Contributor

Choose a reason for hiding this comment

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

you're right. Fixes even also e837ae6

*/
public T submitWithRetry(Callable<T> task) {
// @formatter:off
return submitWithRetry(task, () -> {}, () -> {}, 10 * 60 * 1000, 5000);
Copy link
Collaborator Author

@masayag masayag Jun 6, 2023

Choose a reason for hiding this comment

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

@gciavarrini what should be the timeout? was it used to be 1 minute in the previous implementation?

Copy link
Contributor

Choose a reason for hiding this comment

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

In the bash implementation there were 100 retries.
I chose 1 minute because it seemed like a reasonable time interval and I didn't receive any feedback on this.
TBH, I'm not sure which is the best timeout value :)

@masayag masayag mentioned this pull request Jun 6, 2023
11 tasks
Copy link
Collaborator

@pkliczewski pkliczewski left a comment

Choose a reason for hiding this comment

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

/lgtm

Instead of relying on okhttp async implementation,
we use executor service to invoke recurring requests
 to the service till completion.

This is designed to decrease the CPU load even lower
while maintaining more readable and easier-to-maintain code.

Signed-off-by: Moti Asayag <masayag@redhat.com>
@openshift-ci openshift-ci bot removed the lgtm label Jun 7, 2023
@gciavarrini
Copy link
Contributor

/approve

@openshift-ci
Copy link

openshift-ci bot commented Jun 7, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: gciavarrini

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved label Jun 7, 2023
@pkliczewski
Copy link
Collaborator

/lgtm

@openshift-ci openshift-ci bot added the lgtm label Jun 7, 2023
@openshift-merge-robot openshift-merge-robot merged commit cf48240 into rhdhorchestrator:main Jun 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants