Permalink
Browse files

Merge branch 'master' of github.com:grails/grails-functional-tests-v2

  • Loading branch information...
2 parents a8bf0af + d806d65 commit b3a8bd2b093c0d3d2c69c768731643a0d769bd66 @graemerocher graemerocher committed May 2, 2012
@@ -192,7 +192,7 @@ abstract class BaseSpec extends GebReportingSpec{
private Process createProcess(boolean debug,String project, CharSequence[] command) {
if (project != null && !(project in upgradedProjects)) { upgradeProject(project) }
- def completeCommand = ["${grailsHome}/bin/${debug ? 'grails-debug' : 'grails'}", "-Dgrails.work.dir=${grailsWorkDir}/${project} -Dgrails.project.work.dir=${projectWorkDir}/${project}", "--non-interactive", '--stacktrace']
+ def completeCommand = ["${grailsHome}/bin/${debug ? 'grails-debug' : 'grails'}", "-Dgrails.work.dir=${grailsWorkDir} -Dgrails.project.work.dir=${projectWorkDir}/${project}", "--non-interactive", '--stacktrace']
if(port != null) {
completeCommand << "-Dgrails.server.port.http=${port}"
}
@@ -9,15 +9,15 @@ import org.junit.Assert
*/
class GrailsExecutor {
@Delegate BaseSpec parent
- def invokeMethod(String name, Object args) {
+ def invokeMethod(String name, Object args) {
"${parent.debug ? 'executeDebug' : 'execute'}"(
getProject(),
Utils.getCommandName(name),
*args)
}
def createApp(String name) {
- BaseSpec.projectWorkDir = System.getProperty("java.io.tmpdir")
+ BaseSpec.projectWorkDir = new File("build/project-work").canonicalPath
execute(
getProject(),
"create-app"
@@ -58,12 +58,9 @@ class GrailsExecutor {
static int waitForPort(boolean isDebug, int port, Closure onFailure, Closure onSuccess) {
int timeout = 0
- // allow longer to attach a debugger
- def timeoutMax = isDebug ? 120000 : 60000
- while (true) {
- if (timeout > timeoutMax) {
- onFailure()
- }
+
+ def timeoutMax = 1000 * 60 * 5 // 5 mins
+ while (timeout < timeoutMax) {
if (Utils.isServerRunningOnPort(port)) {
onSuccess()
break
@@ -73,6 +70,7 @@ class GrailsExecutor {
sleep(100)
}
}
+ onFailure()
return timeout
}

0 comments on commit b3a8bd2

Please sign in to comment.