infinitepush: increase test timeout and add logging

Summary:
Tests failed on mac. My guess is that timeout is too low.
Let's increase it to 10 seconds (it's fine because we want wait for 10 sec
if debugbackup finishes faster).

Also let's add logging

Test Plan: Run `test-infinitepush-*`

Reviewers: #sourcecontrol

Differential Revision: https://phabricator.intern.facebook.com/D4213330

Tasks: 12479677
This commit is contained in:
Stanislau Hlebik 2016-11-21 08:25:10 -08:00
parent 24dc1a5878
commit 024d254256
2 changed files with 16 additions and 3 deletions

View File

@ -50,6 +50,9 @@
# Server-side option
loglevel = DEBUG
# Client-side option
debugbackuplog = FILE
"""
from __future__ import absolute_import
@ -630,7 +633,11 @@ def backup(ui, repo, dest=None, **opts):
"""
if opts.get('background'):
runshellcommand('hg debugbackup', os.environ)
background_cmd = 'hg debugbackup'
logfile = ui.config('infinitepush', 'debugbackuplog')
if logfile:
background_cmd = background_cmd + ' &> ' + logfile
runshellcommand(background_cmd, os.environ)
return 0
backuptipfile = 'infinitepushbackuptip'
backuptip = repo.svfs.tryread(backuptipfile)

View File

@ -132,12 +132,18 @@ Backup in background
6 (no-eol)
$ mkcommit newcommit
$ tip=`hg log -r tip -T '{rev}'`
$ hg debugbackup --background
$ hg --config infinitepush.debugbackuplog="$TESTTMP/logfile" debugbackup --background
>>> from time import sleep
>>> for i in range(5):
>>> for i in range(100):
... sleep(0.1)
... backuptip = int(open('.hg/store/infinitepushbackuptip').read())
... if backuptip == 7:
... break
$ cat $TESTTMP/logfile
pushing to ssh://user@dummy/repo
searching for changes
remote: pushing 2 commits:
remote: 667453c0787e newhead2
remote: 773a3ba2e7c2 newcommit
$ cat .hg/store/infinitepushbackuptip
7 (no-eol)