bug 525370 - figure out windows bustage with hang detection and re-enable it. r=jwalden

--HG--
extra : rebase_source : 24ea6c09d89f20c21dc7f0b49b6dc62e32cd5934
This commit is contained in:
Ted Mielczarek 2009-10-30 13:00:19 -04:00
parent 83b31eb1d1
commit 34015a77aa
3 changed files with 18 additions and 21 deletions

View File

@ -454,11 +454,6 @@ def environment(env = None, xrePath = DIST_BIN, crashreporter = True):
return env
if IS_WIN32:
#XXX: disabled on windows for now, see bug 525370
def readWithTimeout(f, timeout):
return (f.readline(), False)
elif False:
#XXX: figure out what's going wrong with this code!
import ctypes, time, msvcrt
PeekNamedPipe = ctypes.windll.kernel32.PeekNamedPipe
GetLastError = ctypes.windll.kernel32.GetLastError
@ -469,18 +464,24 @@ elif False:
is received within |timeout| seconds, return a blank line.
Returns a tuple (line, did_timeout), where |did_timeout| is True
if the read timed out, and False otherwise."""
if timeout is None:
# shortcut to allow callers to pass in "None" for no timeout.
return (f.readline(), False)
x = msvcrt.get_osfhandle(f.fileno())
l = ctypes.c_long()
buf = ctypes.create_string_buffer('', 1024)
done = time.time() + timeout
while time.time() < done:
if PeekNamedPipe(x, buf, len(buf), None, ctypes.byref(l), None) == 0:
err = GetLastError()
if err == 38 or err == 109: # ERROR_HANDLE_EOF || ERROR_BROKEN_PIPE
return ('', False)
if (l > 0 and '\n' in buf.value):
return (f.readline(), False)
time.sleep(0.1)
if PeekNamedPipe(x, None, 0, None, ctypes.byref(l), None) == 0:
err = GetLastError()
if err == 38 or err == 109: # ERROR_HANDLE_EOF || ERROR_BROKEN_PIPE
return ('', False)
else:
log.error("readWithTimeout got error: %d", err)
if l > 0:
# we're assuming that the output is line-buffered,
# which is not unreasonable
return (f.readline(), False)
time.sleep(0.01)
return ('', True)
else:
def readWithTimeout(f, timeout):
@ -506,7 +507,7 @@ def triggerBreakpad(proc, utilityPath):
crashinject = os.path.normpath(os.path.join(utilityPath, "crashinject.exe"))
if os.path.exists(crashinject) and subprocess.Popen([crashinject, str(proc.pid)]).wait() == 0:
return
#TODO: kill the process such that it triggers Breakpad on OS X
#TODO: kill the process such that it triggers Breakpad on OS X (bug 525296)
log.info("Can't trigger Breakpad, just killing process")
proc.kill()

View File

@ -70,9 +70,6 @@ if __name__ == '__main__':
appPath = os.path.join(SCRIPT_DIR, automation.DEFAULT_APP)
status = automation.runApp(url, browserEnv, appPath, PROFILE_DIRECTORY, {},
# the profiling HTML doesn't output anything,
# so let's just set this really high for now.
#FIXME: the POSIX codepath accepts None
# as "no timeout", the Windows codepath
# should too.
timeout = 1800.0)
# so let's just run this without a timeout
timeout = None)
sys.exit(status)

View File

@ -454,8 +454,7 @@ Are you executing $objdir/_tests/testing/mochitest/runtests.py?"""
if options.timeout:
timeout = options.timeout + 30
elif options.autorun:
#FIXME: need to support None for timeout values on Win32
timeout = 1000000
timeout = None
else:
timeout = 330.0 # default JS harness timeout is 300 seconds
automation.log.info("INFO | runtests.py | Running tests: start.\n")