-
Notifications
You must be signed in to change notification settings - Fork 25
Refresh page till pipeline runs #263
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
base: develop
Are you sure you want to change the base?
Changes from all commits
b62f6f9
aff130f
1e27ec5
6dbcdad
f3880b3
7684b32
ebc544d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -127,15 +127,38 @@ public static void waitForPipelineToTransitionToStatus(String pipelineStatus, lo | |
| * Timeout: {@link ConstantsUtil#IMPLICIT_TIMEOUT_SECONDS} | ||
| */ | ||
| public static void waitTillPipelineRunCompletes() throws InterruptedException { | ||
| // Adding a page refresh in case tests are running on CDF to update the pipeline status. | ||
| RetryUtils.retry(ConstantsUtil.PIPELINE_REFRESH_TIMEOUT_SECONDS, ConstantsUtil.PIPELINE_RUN_TIMEOUT_SECONDS, | ||
| 10, () -> { | ||
| try { | ||
| // Wait for the Pipeline run to complete for the default timeout | ||
| WaitHelper.waitForElementToBeHidden(CdfPipelineRunLocators.runningStatus); | ||
| } catch (Exception e) { | ||
| e.printStackTrace(); | ||
| } | ||
|
|
||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: remove empty line |
||
|
|
||
| // Loop to refresh the page if the pipeline is still running till max refresh count | ||
| int maxRefreshCount = ConstantsUtil.MAX_PAGE_REFRESH_ATTEMPTS; | ||
| while (maxRefreshCount > 0) { | ||
| boolean isPipelineRunning = isRunning(); | ||
|
|
||
| if (isPipelineRunning) { | ||
| PageHelper.refreshCurrentPage(); | ||
| return !(isRunning()); | ||
|
|
||
| try { | ||
| Thread.sleep(5000); // Wait for 5 second after the refresh | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Had to use the static wait as there are multiple threads running in parallel and UI responsiveness can introduce unwanted failures
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can we move this to constant class? |
||
| } catch (InterruptedException e) { | ||
| e.printStackTrace(); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same comment here |
||
| } | ||
| ); | ||
|
|
||
| waitTillPipelineRunCompletes(ConstantsUtil.IMPLICIT_TIMEOUT_SECONDS); | ||
| WaitHelper.waitForPageToLoad(); | ||
| WaitHelper.waitForElementToBeClickable(CdfPipelineRunLocators.runDropdownButton); | ||
| WaitHelper.waitForElementToBeHidden( | ||
| CdfPipelineRunLocators.runningStatus, ConstantsUtil.IMPLICIT_TIMEOUT_SECONDS); | ||
| } else { | ||
| break; | ||
| } | ||
|
|
||
| --maxRefreshCount; | ||
| } | ||
| } | ||
|
|
||
| /** | ||
|
|
||
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.
can we properly log the error?