Commit 330f5347 authored by dpranke@chromium.org's avatar dpranke@chromium.org

Although there appear to be one or two tests that are flaky on both mac and linux.

Review URL: http://codereview.chromium.org/6681019

git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@77955 0039d316-1c4b-4281-b951-d872f2087c98
parent eceda5af
......@@ -7,6 +7,7 @@
import atexit
import datetime
import errno
import logging
import os
import pprint
......@@ -15,6 +16,7 @@ import socket
import subprocess
import sys
import tempfile
import time
# trial_dir must be first for non-system libraries.
from tests import trial_dir
......@@ -237,7 +239,11 @@ class FakeReposBase(object):
def tear_down_svn(self):
if self.svnserve:
logging.debug('Killing svnserve pid %s' % self.svnserve.pid)
self.svnserve.kill()
try:
self.svnserve.kill()
except OSError, e:
if e.errno != errno.ESRCH: # no such process
raise
self.wait_for_port_to_free(self.svn_port)
self.svnserve = None
if not self.trial.SHOULD_LEAK:
......@@ -303,6 +309,12 @@ class FakeReposBase(object):
text += ''.join('%s = %s\n' % (usr, pwd) for usr, pwd in self.USERS)
write(join(self.svn_repo, 'conf', 'passwd'), text)
# Mac 10.6 ships with a buggy subversion build and we need this line
# to work around the bug.
write(join(self.svn_repo, 'db', 'fsfs.conf'),
'[rep-sharing]\n'
'enable-rep-sharing = false\n')
# Start the daemon.
cmd = ['svnserve', '-d', '--foreground', '-r', self.root_dir]
if self.host == '127.0.0.1':
......@@ -376,6 +388,14 @@ class FakeReposBase(object):
def wait_for_port_to_bind(self, port, process):
sock = socket.socket()
if sys.platform == 'darwin':
# On Mac SnowLeopard, if we attempt to connect to the socket
# immediately, it fails with EINVAL and never gets a chance to
# connect (putting us into a hard spin and then failing).
# Linux doesn't need this.
time.sleep(0.1)
try:
start = datetime.datetime.utcnow()
maxdelay = datetime.timedelta(seconds=30)
......
......@@ -692,7 +692,7 @@ from :3
if not self.enabled:
return
options = self.Options(verbose=True)
root_dir = tempfile.mkdtemp()
root_dir = gclient_scm.os.path.realpath(tempfile.mkdtemp())
relpath = 'foo'
base_path = join(root_dir, relpath)
url = join(self.base_path, '.git')
......@@ -725,6 +725,7 @@ from :3
join(gclient_scm.os.path.realpath(root_dir), 'foo'))
out = sys.stdout.getvalue()
sys.stdout.close()
sys.stdout = self._old_stdout
self.assertTrue(out in (msg1, msg2), (out, msg1, msg2))
def testUpdateUpdate(self):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment