From 1836c4c560166c26a321d9640c378829c703ae7c Mon Sep 17 00:00:00 2001 From: Natalia Ukhorskaya Date: Tue, 28 Jan 2014 16:03:54 +0400 Subject: [PATCH] Add environment property for timeout in android tests --- .../org/jetbrains/jet/compiler/run/RunUtils.java | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/compiler/android-tests/src/org/jetbrains/jet/compiler/run/RunUtils.java b/compiler/android-tests/src/org/jetbrains/jet/compiler/run/RunUtils.java index 17410404aad..307c785ab84 100644 --- a/compiler/android-tests/src/org/jetbrains/jet/compiler/run/RunUtils.java +++ b/compiler/android-tests/src/org/jetbrains/jet/compiler/run/RunUtils.java @@ -160,7 +160,20 @@ public class RunUtils { handler.startNotify(); if (settings.waitForEnd) { - handler.waitFor(1200000); + String timeoutAsString = System.getenv("kotlin.tests.android.timeout"); + if (timeoutAsString == null) { + timeoutAsString = "30"; + System.err.println("Default value for timeout used: timeout = 30 min. You can change it using 'kotlin.tests.android.timeout' environment variable"); + } + int timeout; + try { + timeout = Integer.parseInt(timeoutAsString); + } + catch (NumberFormatException e) { + timeout = 30; + System.err.println("Timeout system property should be a number"); + } + handler.waitFor(timeout * 60 * 1000); if (!handler.isProcessTerminated()) { System.out.println("Output before handler.isProcessTerminated() " + settings.commandLine);