From cd9fbaeb024262f7f15f76581de8746d945af483 Mon Sep 17 00:00:00 2001
From: Calen Pennington <calen.pennington@gmail.com>
Date: Tue, 30 Oct 2012 15:51:21 -0400
Subject: [PATCH] Add timeout so that jasmine tests eventually fail if the
 server doesn't start

---
 cms/envs/common.py | 1 +
 lms/envs/common.py | 1 +
 rakefile           | 4 ++++
 3 files changed, 6 insertions(+)

diff --git a/cms/envs/common.py b/cms/envs/common.py
index f110ede87ae..4b4b69ad392 100644
--- a/cms/envs/common.py
+++ b/cms/envs/common.py
@@ -35,6 +35,7 @@ MITX_FEATURES = {
     'ENABLE_DISCUSSION_SERVICE': False,
     'AUTH_USE_MIT_CERTIFICATES' : False,
 }
+ENABLE_JASMINE = False
 
 # needed to use lms student app
 GENERATE_RANDOM_USER_CREDENTIALS = False
diff --git a/lms/envs/common.py b/lms/envs/common.py
index 251427d0147..2af62182ac7 100644
--- a/lms/envs/common.py
+++ b/lms/envs/common.py
@@ -30,6 +30,7 @@ from .discussionsettings import *
 
 ################################### FEATURES ###################################
 COURSEWARE_ENABLED = True
+ENABLE_JASMINE = False
 GENERATE_RANDOM_USER_CREDENTIALS = False
 PERFSTATS = False
 
diff --git a/rakefile b/rakefile
index e0972df12a9..5cdc5b3214a 100644
--- a/rakefile
+++ b/rakefile
@@ -48,7 +48,11 @@ def django_for_jasmine(system)
     puts django_pid
     jasmine_url = 'http://localhost:12345/_jasmine/'
     up = false
+    start_time = Time.now
     until up do
+        if Time.now - start_time > 30
+            abort "Timed out waiting for server to start to run jasmine tests"
+        end
         begin
             response = Net::HTTP.get_response(URI(jasmine_url))
             puts response.code
-- 
GitLab