Skip to content

Commit

Permalink
Extend poll intervals to do not overwhelm api (#62)
Browse files Browse the repository at this point in the history
Signed-off-by: Jakub Stejskal <[email protected]>
  • Loading branch information
Frawless authored Jan 16, 2024
1 parent 638beef commit e83aa62
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
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

0 comments on commit e83aa62

Please sign in to comment.