@@ -11,7 +11,6 @@ import (
1111 "net/url"
1212 "strings"
1313 "testing"
14- "time"
1514
1615 auth_model "code.gitea.io/gitea/models/auth"
1716 "code.gitea.io/gitea/models/repo"
@@ -132,8 +131,6 @@ func Test_WebhookCreate(t *testing.T) {
132131 // 2. trigger the webhook
133132 testAPICreateBranch (t , session , "user2" , "repo1" , "master" , "master2" , http .StatusCreated )
134133
135- time .Sleep (1 * time .Second )
136-
137134 // 3. validate the webhook is triggered
138135 assert .EqualValues (t , string (webhook_module .HookEventCreate ), triggeredEvent )
139136 assert .EqualValues (t , "repo1" , payload .Repo .Name )
@@ -163,8 +160,6 @@ func Test_WebhookDelete(t *testing.T) {
163160 testAPICreateBranch (t , session , "user2" , "repo1" , "master" , "master2" , http .StatusCreated )
164161 testAPIDeleteBranch (t , "master2" , http .StatusNoContent )
165162
166- time .Sleep (1 * time .Second )
167-
168163 // 3. validate the webhook is triggered
169164 assert .EqualValues (t , "delete" , triggeredEvent )
170165 assert .EqualValues (t , "repo1" , payload .Repo .Name )
@@ -193,8 +188,6 @@ func Test_WebhookFork(t *testing.T) {
193188 // 2. trigger the webhook
194189 testRepoFork (t , session , "user2" , "repo1" , "user1" , "repo1-fork" , "master" )
195190
196- time .Sleep (1 * time .Second )
197-
198191 // 3. validate the webhook is triggered
199192 assert .EqualValues (t , "fork" , triggeredEvent )
200193 assert .EqualValues (t , "repo1-fork" , payload .Repo .Name )
@@ -224,8 +217,6 @@ func Test_WebhookIssueComment(t *testing.T) {
224217 issueURL := testNewIssue (t , session , "user2" , "repo1" , "Title2" , "Description2" )
225218 testIssueAddComment (t , session , issueURL , "issue title2 comment1" , "" )
226219
227- time .Sleep (1 * time .Second )
228-
229220 // 3. validate the webhook is triggered
230221 assert .EqualValues (t , "issue_comment" , triggeredEvent )
231222 assert .EqualValues (t , "created" , payload .Action )
@@ -256,8 +247,6 @@ func Test_WebhookRelease(t *testing.T) {
256247 // 2. trigger the webhook
257248 createNewRelease (t , session , "/user2/repo1" , "v0.0.99" , "v0.0.99" , false , false )
258249
259- time .Sleep (1 * time .Second )
260-
261250 // 3. validate the webhook is triggered
262251 assert .EqualValues (t , "release" , triggeredEvent )
263252 assert .EqualValues (t , "repo1" , payload .Repository .Name )
@@ -287,8 +276,6 @@ func Test_WebhookPush(t *testing.T) {
287276 // 2. trigger the webhook
288277 testCreateFile (t , session , "user2" , "repo1" , "master" , "test_webhook_push.md" , "# a test file for webhook push" )
289278
290- time .Sleep (1 * time .Second )
291-
292279 // 3. validate the webhook is triggered
293280 assert .EqualValues (t , "push" , triggeredEvent )
294281 assert .EqualValues (t , "repo1" , payload .Repo .Name )
@@ -317,8 +304,6 @@ func Test_WebhookIssue(t *testing.T) {
317304 // 2. trigger the webhook
318305 testNewIssue (t , session , "user2" , "repo1" , "Title1" , "Description1" )
319306
320- time .Sleep (1 * time .Second )
321-
322307 // 3. validate the webhook is triggered
323308 assert .EqualValues (t , "issues" , triggeredEvent )
324309 assert .EqualValues (t , "opened" , payload .Action )
@@ -350,8 +335,6 @@ func Test_WebhookPullRequest(t *testing.T) {
350335 repo1 := unittest .AssertExistsAndLoadBean (t , & repo.Repository {ID : 1 })
351336 testCreatePullToDefaultBranch (t , session , repo1 , repo1 , "master2" , "first pull request" )
352337
353- time .Sleep (1 * time .Second )
354-
355338 // 3. validate the webhook is triggered
356339 assert .EqualValues (t , "pull_request" , triggeredEvent )
357340 assert .EqualValues (t , "repo1" , payload .PullRequest .Base .Repository .Name )
@@ -381,8 +364,6 @@ func Test_WebhookWiki(t *testing.T) {
381364 // 2. trigger the webhook
382365 testAPICreateWikiPage (t , session , "user2" , "repo1" , "Test Wiki Page" , http .StatusCreated )
383366
384- time .Sleep (1 * time .Second )
385-
386367 // 3. validate the webhook is triggered
387368 assert .EqualValues (t , "wiki" , triggeredEvent )
388369 assert .EqualValues (t , "created" , payload .Action )
@@ -411,8 +392,6 @@ func Test_WebhookRepository(t *testing.T) {
411392 // 2. trigger the webhook
412393 testAPIOrgCreateRepo (t , session , "org3" , "repo_new" , http .StatusCreated )
413394
414- time .Sleep (1 * time .Second )
415-
416395 // 3. validate the webhook is triggered
417396 assert .EqualValues (t , "repository" , triggeredEvent )
418397 assert .EqualValues (t , "created" , payload .Action )
@@ -445,8 +424,6 @@ func Test_WebhookPackage(t *testing.T) {
445424 AddTokenAuth (token )
446425 MakeRequest (t , req , http .StatusCreated )
447426
448- time .Sleep (1 * time .Second )
449-
450427 // 3. validate the webhook is triggered
451428 assert .EqualValues (t , "package" , triggeredEvent )
452429 assert .EqualValues (t , "created" , payload .Action )
0 commit comments