Yet another attempt to fix the intermittent failure of gpg git test (#9146)

* Yet another attempt to fix the race in gpg_git_test

* add some fail nows

* Need to set preparetestenv

* Ensure that http messages go to the correct server
This commit is contained in:
zeripath 2019-11-26 15:35:41 +00:00 committed by Lunny Xiao
parent 055f6d2296
commit 9d9e6ac411
2 changed files with 33 additions and 5 deletions

View file

@ -91,6 +91,7 @@ func onGiteaRun(t *testing.T, callback func(*testing.T, *url.URL), prepare ...bo
assert.NoError(t, err)
listener, err := net.Listen("tcp", u.Host)
assert.NoError(t, err)
u.Host = listener.Addr().String()
defer func() {
ctx, cancel := context.WithTimeout(context.Background(), 2*time.Minute)