Skip to content

Commit

Permalink
CORE-20708 Updating retry condition so we don't try to unwrap nginx f…
Browse files Browse the repository at this point in the history
…ailures
  • Loading branch information
ben-millar committed Jul 9, 2024
1 parent bfcf929 commit 9bda2b6
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package net.corda.e2etest.utilities.config
import com.fasterxml.jackson.databind.JsonNode
import kong.unirest.UnirestException
import net.corda.e2etest.utilities.ClusterInfo
import net.corda.e2etest.utilities.ClusterReadinessChecker
import net.corda.e2etest.utilities.DEFAULT_CLUSTER
import net.corda.e2etest.utilities.assertWithRetryIgnoringExceptions
import net.corda.e2etest.utilities.cluster
Expand Down Expand Up @@ -152,14 +151,15 @@ fun ClusterInfo.waitForConfigurationChange(
}
}

// check cluster is ready. No need to aggressively poll too much as its expected the cluster to be down for a number of seconds
ClusterReadinessChecker().assertIsReady(Duration.ofMinutes(2), Duration.ofMillis(1000))

// Wait for the service to become available again and have the expected configuration value
assertWithRetryIgnoringExceptions {
timeout(timeout)
command { getConfig(section) }
condition {
if (it.code != OK.statusCode) {
return@condition false
}

val bodyJSON = it.body.toJson()
it.code == OK.statusCode && bodyJSON["sourceConfig"] != null
&& bodyJSON.sourceConfigNode()[key] != null && bodyJSON.sourceConfigNode()[key].toString() == value
Expand Down

0 comments on commit 9bda2b6

Please sign in to comment.