Index: tests/fake_repos.py |
diff --git a/tests/fake_repos.py b/tests/fake_repos.py |
index 5f8c54ef823a59560a0bd97d61615df35f770d61..9386862dbb6cf8d01f0739f0ddc386d4815c0e32 100755 |
--- a/tests/fake_repos.py |
+++ b/tests/fake_repos.py |
@@ -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,11 @@ class FakeReposBase(object): |
text += ''.join('%s = %s\n' % (usr, pwd) for usr, pwd in self.USERS) |
write(join(self.svn_repo, 'conf', 'passwd'), text) |
+ # This is needed on the Mac for some reason. |
+ 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 +387,11 @@ class FakeReposBase(object): |
def wait_for_port_to_bind(self, port, process): |
sock = socket.socket() |
+ |
+ if sys.platform == 'darwin': |
M-A Ruel
2011/03/12 15:39:17
??
What happen otherwise? I'd rather have a time.
|
+ # Mac seems a bit slow, so give the daemon a chance to start up. |
+ time.sleep(0.1) |
+ |
try: |
start = datetime.datetime.utcnow() |
maxdelay = datetime.timedelta(seconds=30) |