Skip to content

Commit

Permalink
kie-issues#622: explicitly provide startupTimeout in waitingFor call (#…
Browse files Browse the repository at this point in the history
…3259)

* kie-issues#622: explicitly provide startupTimeout in waitingFor call

* add PR check triggering Jenkinsfile

---------

Co-authored-by: jstastny-cz <[email protected]>
  • Loading branch information
jstastny-cz and jstastny-cz authored Oct 24, 2023
1 parent fbcaedc commit 2e1b430
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 4 deletions.
47 changes: 47 additions & 0 deletions .ci/jenkins/Jenkinsfile.pr.1.40.x
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
@Library('jenkins-pipeline-shared-libraries')_

pr_check_script = null

pipeline {
agent {
label 'ubuntu'
}
options {
timestamps()
timeout(time: 480, unit: 'MINUTES')
disableConcurrentBuilds(abortPrevious: true)
}
environment {
BUILDCHAIN_PROJECT = 'apache/incubator-kie-kogito-runtimes'

ENABLE_SONARCLOUD = 'false'
KOGITO_RUNTIMES_BUILD_MVN_OPTS = '-Dvalidate-formatting -Prun-code-coverage'
}
stages {
stage('Initialize') {
steps {
script {
// load `pr_check.groovy` file from kogito-pipelines:main
dir('kogito-pipelines') {
checkout(githubscm.resolveRepository('incubator-kie-kogito-pipelines', 'apache', 'main', false, 'ASF_Cloudbees_Jenkins_ci-builds'))
pr_check_script = load 'dsl/scripts/pr_check.groovy'
}
}
}
}
stage('PR check') {
steps {
script {
dir('kogito-pipelines') {
pr_check_script.launch()
}
}
}
}
}
post {
cleanup {
cleanWs()
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public KogitoKafkaContainer() {
withExposedPorts(KAFKA_PORT);
withCreateContainerCmdModifier(cmd -> cmd.withEntrypoint("sh"));
withCommand("-c", "while [ ! -f " + STARTER_SCRIPT + " ]; do sleep 0.1; done; " + STARTER_SCRIPT);
waitingFor(Wait.forLogMessage(".*Started Kafka API server.*", 1));
waitingFor(Wait.forLogMessage(".*Started Kafka API server.*", 1).withStartupTimeout(Constants.CONTAINER_START_TIMEOUT));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public KogitoKeycloakContainer() {
withEnv("KEYCLOAK_ADMIN", USER);
withEnv("KEYCLOAK_ADMIN_PASSWORD", PASSWORD);
withClasspathResourceMapping("testcontainers/keycloak/kogito-realm.json", REALM_FILE, BindMode.READ_ONLY);
waitingFor(Wait.forLogMessage(".*Keycloak.*started.*", 1));
waitingFor(Wait.forLogMessage(".*Keycloak.*started.*", 1).withStartupTimeout(Constants.CONTAINER_START_TIMEOUT));
withCommand("start-dev --import-realm");
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public class KogitoRedisSearchContainer extends KogitoGenericContainer<KogitoRed
public KogitoRedisSearchContainer() {
super(NAME);
addExposedPort(PORT);
waitingFor(Wait.forLogMessage(".*Ready to accept connections.*\\s", 1));
waitingFor(Wait.forLogMessage(".*Ready to accept connections.*\\s", 1).withStartupTimeout(Constants.CONTAINER_START_TIMEOUT));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

package org.kie.kogito.quarkus.workflow.deployment.devservices;

import java.time.Duration;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.testcontainers.containers.GenericContainer;
Expand Down Expand Up @@ -58,7 +60,7 @@ public DataIndexInMemoryContainer(DockerImageName dockerImageName, int fixedExpo
withEnv("KOGITO_DATA_INDEX_VERTX_GRAPHQL_UI_PATH", "/q/graphql-ui");
withEnv("KOGITO_DATA_INDEX_QUARKUS_PROFILE", "http-events-support");
withExposedPorts(PORT);
waitingFor(Wait.forHttp("/q/health/ready").forStatusCode(200));
waitingFor(Wait.forHttp("/q/health/ready").forStatusCode(200).withStartupTimeout(Duration.ofMinutes(5)));
}

@Override
Expand Down

0 comments on commit 2e1b430

Please sign in to comment.