Skip to content

Commit

Permalink
Increase dev-mode timeout on Windows to 90 seconds
Browse files Browse the repository at this point in the history
  • Loading branch information
snazy committed Apr 14, 2023
1 parent ccf168a commit cc8b86b
Showing 1 changed file with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.util.Locale;
import java.util.Map;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
Expand Down Expand Up @@ -122,7 +123,7 @@ protected String getHttpResponse() {
}

protected String getHttpResponse(String path) {
return getHttpResponse(path, 1, TimeUnit.MINUTES);
return getHttpResponse(path, devModeTimeoutSeconds(), TimeUnit.SECONDS);
}

protected String getHttpResponse(String path, long timeout, TimeUnit tu) {
Expand All @@ -146,7 +147,16 @@ protected void replace(String srcFile, Map<String, String> tokens) {
}

protected void assertUpdatedResponseContains(String path, String value) {
assertUpdatedResponseContains(path, value, 1, TimeUnit.MINUTES);
assertUpdatedResponseContains(path, value, devModeTimeoutSeconds(), TimeUnit.SECONDS);
}

protected int devModeTimeoutSeconds() {
// It's a wild guess, but maybe Windows is just slower - at least: a successful Gradle-CI-jobs on Windows is
// 2.5x slower than the same Gradle-CI-job on Linux.
if (System.getProperty("os.name").toLowerCase(Locale.ENGLISH).contains("windows")) {
return 90;
}
return 60;
}

protected void assertUpdatedResponseContains(String path, String value, long waitAtMost, TimeUnit timeUnit) {
Expand Down

0 comments on commit cc8b86b

Please sign in to comment.