Skip to content

Commit 21554ec

Browse files
author
Muhammad Idil Haq Amir
committed
test: adding sleep for temporary solution
1 parent ff37298 commit 21554ec

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

core/appeal/service_test.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1096,6 +1096,7 @@ func (s *ServiceTestSuite) TestCreate() {
10961096
Log(mock.Anything, appeal.AuditKeyBulkInsert, mock.Anything).Return(nil).Once()
10971097

10981098
actualError := h.service.Create(context.Background(), appeals)
1099+
time.Sleep(time.Millisecond)
10991100

11001101
s.Nil(actualError)
11011102
s.Equal(expectedResult, appeals)
@@ -1560,6 +1561,7 @@ func (s *ServiceTestSuite) TestCreate() {
15601561
Return(nil).Once()
15611562

15621563
actualError := h.service.Create(context.Background(), appeals)
1564+
time.Sleep(time.Millisecond)
15631565

15641566
s.Nil(actualError)
15651567
s.Equal(expectedResult, appeals)
@@ -1657,6 +1659,7 @@ func (s *ServiceTestSuite) TestCreate() {
16571659
h.mockProviderService.EXPECT().GrantAccess(mock.Anything, mock.Anything).Return(nil).Once()
16581660

16591661
err := h.service.Create(context.Background(), []*domain.Appeal{input}, appeal.CreateWithAdditionalAppeal())
1662+
time.Sleep(time.Millisecond)
16601663

16611664
s.NoError(err)
16621665
s.Equal("test-approval", input.Approvals[0].Name)
@@ -1933,6 +1936,7 @@ func (s *ServiceTestSuite) TestCreateAppeal__WithExistingAppealAndWithAutoApprov
19331936
h.mockAuditLogger.EXPECT().Log(mock.Anything, appeal.AuditKeyBulkInsert, mock.Anything).Return(nil).Once()
19341937

19351938
actualError := h.service.Create(context.Background(), appeals)
1939+
time.Sleep(time.Millisecond)
19361940

19371941
s.Nil(actualError)
19381942
s.Equal(expectedResult, appeals)
@@ -2129,6 +2133,7 @@ func (s *ServiceTestSuite) TestCreateAppeal__WithAdditionalAppeals() {
21292133
h.mockNotifier.EXPECT().Notify(h.ctxMatcher, mock.Anything).Return(nil).Once()
21302134

21312135
err := h.service.Create(context.Background(), appealsPayload)
2136+
time.Sleep(time.Millisecond)
21322137

21332138
s.NoError(err)
21342139
}
@@ -2763,6 +2768,7 @@ func (s *ServiceTestSuite) TestUpdateApproval() {
27632768
Return(nil).Once()
27642769

27652770
_, actualError := h.service.UpdateApproval(context.Background(), action)
2771+
time.Sleep(time.Millisecond)
27662772

27672773
s.Nil(actualError)
27682774
})
@@ -3164,7 +3170,7 @@ func (s *ServiceTestSuite) TestUpdateApproval() {
31643170
Return(nil).Once()
31653171

31663172
actualResult, actualError := h.service.UpdateApproval(context.Background(), tc.expectedApprovalAction)
3167-
3173+
time.Sleep(time.Millisecond)
31683174
s.NoError(actualError)
31693175
tc.expectedResult.Policy = actualResult.Policy
31703176
s.Equal(tc.expectedResult, actualResult)
@@ -3364,9 +3370,9 @@ func (s *ServiceTestSuite) TestAddApprover() {
33643370

33653371
actualAppeal, actualError := h.service.AddApprover(context.Background(), appealID, approvalID, newApprover)
33663372

3373+
time.Sleep(time.Millisecond)
33673374
s.NoError(actualError)
33683375
s.Equal(expectedApproval, actualAppeal.Approvals[0])
3369-
33703376
})
33713377
}
33723378
})

0 commit comments

Comments
 (0)