File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change 22
22
_digest = sha .new
23
23
import sys
24
24
import os
25
+ import time
25
26
sys .path .insert (0 , os .getenv ("GITPYTHONLIB" ,"." ))
26
27
27
28
from git_remote_helpers .util import die , debug , warn
@@ -204,6 +205,11 @@ def read_one_line(repo):
204
205
"""Reads and processes one command.
205
206
"""
206
207
208
+ sleepy = os .environ .get ("GIT_REMOTE_TESTGIT_SLEEPY" )
209
+ if sleepy :
210
+ debug ("Sleeping %d sec before readline" % int (sleepy ))
211
+ time .sleep (int (sleepy ))
212
+
207
213
line = sys .stdin .readline ()
208
214
209
215
cmdline = line
@@ -258,6 +264,7 @@ def main(args):
258
264
259
265
more = True
260
266
267
+ sys .stdin = os .fdopen (sys .stdin .fileno (), 'r' , 0 )
261
268
while (more ):
262
269
more = read_one_line (repo )
263
270
Original file line number Diff line number Diff line change @@ -72,6 +72,19 @@ test_expect_success 'pushing to local repo' '
72
72
compare_refs localclone HEAD server HEAD
73
73
'
74
74
75
+ # Generally, skip this test. It demonstrates a now-fixed race in
76
+ # git-remote-testgit, but is too slow to leave in for general use.
77
+ : test_expect_success ' racily pushing to local repo' '
78
+ test_when_finished "rm -rf server2 localclone2" &&
79
+ cp -a server server2 &&
80
+ git clone "testgit::${PWD}/server2" localclone2 &&
81
+ (cd localclone2 &&
82
+ echo content >>file &&
83
+ git commit -a -m three &&
84
+ GIT_REMOTE_TESTGIT_SLEEPY=2 git push) &&
85
+ compare_refs localclone2 HEAD server2 HEAD
86
+ '
87
+
75
88
test_expect_success ' synch with changes from localclone' '
76
89
(cd clone &&
77
90
git pull)
You can’t perform that action at this time.
0 commit comments