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

Extend poll intervals to do not overwhelm api #62

Merged
merged 1 commit into from
Jan 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/main/java/io/odh/test/TestConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ public class TestConstants {
public static final String LATEST_BUNDLE_DEPLOY_FILE = "install-files/latest.yaml";
public static final String RELEASED_BUNDLE_DEPLOY_FILE = "install-files/released.yaml";

public static final long GLOBAL_POLL_INTERVAL = Duration.ofSeconds(10).toMillis();
public static final long GLOBAL_POLL_INTERVAL_MEDIUM = Duration.ofSeconds(5).toMillis();
public static final long GLOBAL_POLL_INTERVAL_SHORT = Duration.ofSeconds(1).toMillis();
public static final long GLOBAL_POLL_INTERVAL_LONG = Duration.ofSeconds(15).toMillis();
public static final long GLOBAL_POLL_INTERVAL_MEDIUM = Duration.ofSeconds(10).toMillis();
public static final long GLOBAL_POLL_INTERVAL_SHORT = Duration.ofSeconds(5).toMillis();
public static final long GLOBAL_TIMEOUT = Duration.ofMinutes(5).toMillis();
public static final long GLOBAL_STABILITY_TIME = Duration.ofMinutes(1).toSeconds();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ public final <T extends HasMetadata> boolean waitResourceCondition(T resource, R
boolean[] resourceReady = new boolean[1];

TestUtils.waitFor("resource condition: " + condition.getConditionName() + " to be fulfilled for resource " + resource.getKind() + ":" + resource.getMetadata().getName(),
TestConstants.GLOBAL_POLL_INTERVAL, TestConstants.GLOBAL_TIMEOUT,
TestConstants.GLOBAL_POLL_INTERVAL_MEDIUM, TestConstants.GLOBAL_TIMEOUT,
() -> {
T res = type.get(resource.getMetadata().getNamespace(), resource.getMetadata().getName());
resourceReady[0] = condition.getPredicate().test(res);
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/io/odh/test/utils/DeploymentUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ public static boolean waitForDeploymentReady(String namespaceName, String deploy
*/
public static void waitForDeploymentDeletion(String namespaceName, String name) {
LOGGER.debug("Waiting for Deployment: {}/{} deletion", namespaceName, name);
TestUtils.waitFor("deletion of Deployment: " + namespaceName + "/" + name, TestConstants.GLOBAL_POLL_INTERVAL, DELETION_TIMEOUT,
TestUtils.waitFor("deletion of Deployment: " + namespaceName + "/" + name, TestConstants.GLOBAL_POLL_INTERVAL_MEDIUM, DELETION_TIMEOUT,
() -> {
if (ResourceManager.getClient().getDeployment(namespaceName, name) == null) {
return true;
Expand Down
Loading