Skip to content
This repository was archived by the owner on Dec 12, 2024. It is now read-only.
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
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
<maven.build.timestamp.format>yyyy-MM-dd-HH-mm</maven.build.timestamp.format>
<gcloud.api.bom.version>0.84.0-alpha</gcloud.api.bom.version>
<jetty9.minor.version>4</jetty9.minor.version>
<jetty9.dot.version>17</jetty9.dot.version>
<jetty9.version>9.${jetty9.minor.version}.${jetty9.dot.version}.v20190418</jetty9.version>
<jetty9.dot.version>18</jetty9.dot.version>
<jetty9.version>9.${jetty9.minor.version}.${jetty9.dot.version}.v20190429</jetty9.version>
<docker.tag.prefix></docker.tag.prefix>
<docker.tag.short>${docker.tag.prefix}9.${jetty9.minor.version}</docker.tag.short>
<docker.tag.long>${docker.tag.prefix}9.${jetty9.minor.version}-${maven.build.timestamp}</docker.tag.long>
Expand Down
4 changes: 2 additions & 2 deletions scripts/local_integration_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ docker build -t $APP_IMAGE . || gcloud docker -- build -t $APP_IMAGE .

# run app container locally to test shutdown logging
echo "Starting app container..."
docker run --rm --name $CONTAINER -e "SHUTDOWN_LOGGING_THREAD_DUMP=true" -e "SHUTDOWN_LOGGING_HEAP_INFO=true" $APP_IMAGE &> $OUTPUT_FILE &
docker run --rm --name $CONTAINER -e "HEAP_SIZE_MB=512" -e "SHUTDOWN_LOGGING_THREAD_DUMP=true" -e "SHUTDOWN_LOGGING_HEAP_INFO=true" $APP_IMAGE &> $OUTPUT_FILE &

function waitForOutput() {
found_output='false'
Expand Down Expand Up @@ -76,4 +76,4 @@ waitForOutput 'num.*instances.*bytes.*class name'

popd

echo 'OK'
echo 'OK'
Original file line number Diff line number Diff line change
Expand Up @@ -46,30 +46,36 @@ public final class HttpUrlUtil {
* @param unit the time unit to wait for server up
*/
public static void waitForServerUp(URI uri, int duration, TimeUnit unit) {
System.err.println("Waiting for server up: " + uri);
boolean waiting = true;

log.info("Waiting for server up: " + uri);
boolean ok = false;
long wait = 0;
long expiration = System.currentTimeMillis() + unit.toMillis(duration);
while (waiting && System.currentTimeMillis() < expiration) {
while (!ok && System.currentTimeMillis() < expiration) {
try {
System.out.print(".");
HttpURLConnection http = openTo(uri);
int statusCode = http.getResponseCode();
if (statusCode != HttpURLConnection.HTTP_OK) {
log.log(Level.FINER, "Waiting 2s for next attempt");
TimeUnit.SECONDS.sleep(2);
} else {
waiting = false;
if (statusCode == HttpURLConnection.HTTP_OK) {
ok = true;
break;
}
} catch (MalformedURLException e) {
throw new IllegalArgumentException("Invalid URI: " + uri.toString());
} catch (IOException e) {
log.log(Level.INFO, "Ignoring IOException: " + e);
log.log(Level.FINEST, "Ignoring IOException", e);
}
try {
wait += 500;
log.log(Level.INFO, "Waiting " + wait + "ms for next attempt");
TimeUnit.MILLISECONDS.sleep(wait);
} catch (InterruptedException ignore) {
System.err.println(ignore);
// ignore
}
}
System.err.println();
System.err.println("Server seems to be up.");

log.info("Server up: " + ok);
}

/**
Expand Down
2 changes: 2 additions & 0 deletions tests/test-war-smoke/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,8 @@
<goals>
<goal>start</goal>
</goals>
<configuration>
</configuration>
</execution>
<execution>
<id>stop</id>
Expand Down
1 change: 1 addition & 0 deletions tests/test-war-smoke/src/main/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
FROM ${jetty.test.image}
ADD ${project.build.finalName}.war $JETTY_BASE/webapps/root.war

ENV HEAP_SIZE_MB=512
# Uncomment to dump the jetty configuration at startup
# WORKDIR $JETTY_BASE
# RUN java -jar $JETTY_HOME/start.jar --update-ini jetty.server.dumpAfterStart=true