|
@@ -68,6 +68,10 @@ def run_file(files, parameters, expected, mode):
|
|
while 1:
|
|
while 1:
|
|
proc2 = execute("compile", [mod_filename, username, filename, mode], wait=False)
|
|
proc2 = execute("compile", [mod_filename, username, filename, mode], wait=False)
|
|
|
|
|
|
|
|
+ if proc.returncode is not None:
|
|
|
|
+ # Modelverse has already terminated, which isn't a good sign!
|
|
|
|
+ raise Exception("Modelverse died!")
|
|
|
|
+
|
|
while proc2.returncode is None:
|
|
while proc2.returncode is None:
|
|
time.sleep(0.01)
|
|
time.sleep(0.01)
|
|
proc2.poll()
|
|
proc2.poll()
|
|
@@ -104,6 +108,11 @@ def run_file(files, parameters, expected, mode):
|
|
c = len(e) if isinstance(e, set) else 1
|
|
c = len(e) if isinstance(e, set) else 1
|
|
for _ in range(c):
|
|
for _ in range(c):
|
|
val = urllib2.urlopen(urllib2.Request("http://localhost:8001/", urllib.urlencode({"op": "get_output", "username": username})), timeout=10).read()
|
|
val = urllib2.urlopen(urllib2.Request("http://localhost:8001/", urllib.urlencode({"op": "get_output", "username": username})), timeout=10).read()
|
|
|
|
+
|
|
|
|
+ if proc.returncode is not None:
|
|
|
|
+ # Modelverse has already terminated, which isn't a good sign!
|
|
|
|
+ raise Exception("Modelverse died!")
|
|
|
|
+
|
|
val = val.split("=", 2)[2]
|
|
val = val.split("=", 2)[2]
|
|
print("Got %s, expect %s" % (val, e))
|
|
print("Got %s, expect %s" % (val, e))
|
|
if isinstance(e, set):
|
|
if isinstance(e, set):
|
|
@@ -148,6 +157,11 @@ def run_barebone(parameters, expected, interface="0", timeout=False, wait=False,
|
|
break
|
|
break
|
|
except:
|
|
except:
|
|
time.sleep(0.01)
|
|
time.sleep(0.01)
|
|
|
|
+
|
|
|
|
+ if proc.returncode is not None:
|
|
|
|
+ # Modelverse has already terminated, which isn't a good sign!
|
|
|
|
+ return False
|
|
|
|
+
|
|
if time.time() - start > timeout_val:
|
|
if time.time() - start > timeout_val:
|
|
raise
|
|
raise
|
|
|
|
|
|
@@ -159,6 +173,11 @@ def run_barebone(parameters, expected, interface="0", timeout=False, wait=False,
|
|
if p not in var_list:
|
|
if p not in var_list:
|
|
data = flush_data(data)
|
|
data = flush_data(data)
|
|
val = urllib2.urlopen(urllib2.Request("http://localhost:8001/", urllib.urlencode({"op": "get_output", "username": username})), timeout=10).read()
|
|
val = urllib2.urlopen(urllib2.Request("http://localhost:8001/", urllib.urlencode({"op": "get_output", "username": username})), timeout=10).read()
|
|
|
|
+
|
|
|
|
+ if proc.returncode is not None:
|
|
|
|
+ # Modelverse has already terminated, which isn't a good sign!
|
|
|
|
+ return False
|
|
|
|
+
|
|
val = val.split("=", 2)[1].split("&", 1)[0]
|
|
val = val.split("=", 2)[1].split("&", 1)[0]
|
|
var_list[p] = val
|
|
var_list[p] = val
|
|
continue
|
|
continue
|