Bug 682413 - attempt to recover from pulse failures, a=testonly, DONTBUILD

This commit is contained in:
Jonathan Griffin 2011-09-09 14:39:48 -07:00
parent 47bcaa34b1
commit 54ec6871a4

@ -36,10 +36,12 @@
# ***** END LICENSE BLOCK ***** # ***** END LICENSE BLOCK *****
import json import json
import logging
import optparse import optparse
import os import os
import sys import sys
import logging import time
import traceback
from threading import RLock from threading import RLock
@ -116,25 +118,32 @@ def main():
extensionDir = extensionDir.replace("/", "\\") extensionDir = extensionDir.replace("/", "\\")
if options.binary is None: if options.binary is None:
# If no binary is specified, start the pulse build monitor, and wait while True:
# until we receive build notifications before running tests. try:
monitor = TPSPulseMonitor(extensionDir, # If no binary is specified, start the pulse build monitor, and wait
config=config, # until we receive build notifications before running tests.
autolog=options.autolog, monitor = TPSPulseMonitor(extensionDir,
emailresults=options.emailresults, config=config,
testfile=options.testfile, autolog=options.autolog,
logfile=options.logfile, emailresults=options.emailresults,
rlock=rlock) testfile=options.testfile,
print "waiting for pulse build notifications" logfile=options.logfile,
rlock=rlock)
print "waiting for pulse build notifications"
if options.pulsefile: if options.pulsefile:
# For testing purposes, inject a pulse message directly into # For testing purposes, inject a pulse message directly into
# the monitor. # the monitor.
builddata = json.loads(open(options.pulsefile, 'r').read()) builddata = json.loads(open(options.pulsefile, 'r').read())
monitor.onBuildComplete(builddata) monitor.onBuildComplete(builddata)
monitor.listen() monitor.listen()
return except KeyboardInterrupt:
sys.exit()
except:
traceback.print_exc()
print 'sleeping 5 minutes'
time.sleep(300)
TPS = TPSTestRunner(extensionDir, TPS = TPSTestRunner(extensionDir,
emailresults=options.emailresults, emailresults=options.emailresults,