Skip to content

Commit

Permalink
update check timer for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
changchaishi committed Jan 14, 2025
1 parent b26c356 commit 4af0768
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions tests/integration/repo_merge_upstream_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func TestRepoMergeUpstream(t *testing.T) {
}
respMsg, _ := htmlDoc.Find(".ui.message:not(.positive)").Html()
return strings.Contains(respMsg, `This branch is 1 commit behind <a href="/user2/repo1/src/branch/master">user2/repo1:master</a>`)
}, 5*time.Second, 100*time.Millisecond)
}, 10*time.Second, 200*time.Millisecond)

// click the "sync fork" button
req = NewRequestWithValues(t, "POST", mergeUpstreamLink, map[string]string{"_csrf": GetUserCSRFToken(t, session)})
Expand All @@ -88,8 +88,6 @@ func TestRepoMergeUpstream(t *testing.T) {
req := NewRequestWithJSON(t, "PUT", fmt.Sprintf("/api/v1/repos/%s/%s/contents/%s", baseRepo.OwnerName, baseRepo.Name, "new-file.txt"), &api.UpdateFileOptions{
DeleteFileOptions: api.DeleteFileOptions{
FileOptions: api.FileOptions{
BranchName: "master",
NewBranchName: "master",
Message: "Update new-file.txt",
},
SHA: "a4007b6679563f949751ed31bb371fdfb3194446",
Expand All @@ -105,7 +103,7 @@ func TestRepoMergeUpstream(t *testing.T) {
htmlDoc := NewHTMLParser(t, resp.Body)
respMsg, _ := htmlDoc.Find(".ui.message:not(.positive)").Html()
return strings.Contains(respMsg, `The base branch <a href="/user2/repo1/src/branch/master">user2/repo1:master</a> has new changes`)
}, 5*time.Second, 100*time.Millisecond)
}, 10*time.Second, 200*time.Millisecond)

// and do the merge-upstream by API
req = NewRequestWithJSON(t, "POST", fmt.Sprintf("/api/v1/repos/%s/test-repo-fork/merge-upstream", forkUser.Name), &api.MergeUpstreamRequest{
Expand All @@ -123,7 +121,7 @@ func TestRepoMergeUpstream(t *testing.T) {
resp := session.MakeRequest(t, NewRequestf(t, "GET", "/%s/test-repo-fork/src/branch/fork-branch", forkUser.Name), http.StatusOK)
htmlDoc := NewHTMLParser(t, resp.Body)
return queryMergeUpstreamButtonLink(htmlDoc) == ""
}, 5*time.Second, 100*time.Millisecond)
}, 10*time.Second, 200*time.Millisecond)
})
})
}

0 comments on commit 4af0768

Please sign in to comment.