Skip to content

Commit 2e00864

Browse files
committed
Chore: Increase timeout for more stable tests
The API could take more than 5 seconds to handle some actions. To avoid tests breaking randomly we will increase the timeout to minimize context deadline errors.
1 parent f694092 commit 2e00864

20 files changed

+85
-85
lines changed

projects/activity_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ func TestActivityList(t *testing.T) {
3030
for _, tt := range tests {
3131
t.Run(tt.name, func(t *testing.T) {
3232
ctx := t.Context()
33-
ctx, cancel := context.WithTimeout(ctx, 5*time.Second)
33+
ctx, cancel := context.WithTimeout(ctx, 10*time.Second)
3434
t.Cleanup(cancel)
3535

3636
if _, err := projects.ActivityList(ctx, engine, tt.input); err != nil {

projects/comment_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ func TestCommentCreate(t *testing.T) {
5454
for _, tt := range tests {
5555
t.Run(tt.name, func(t *testing.T) {
5656
ctx := t.Context()
57-
ctx, cancel := context.WithTimeout(ctx, 5*time.Second)
57+
ctx, cancel := context.WithTimeout(ctx, 10*time.Second)
5858
t.Cleanup(cancel)
5959

6060
comment, err := projects.CommentCreate(ctx, engine, tt.input)
@@ -105,7 +105,7 @@ func TestCommentUpdate(t *testing.T) {
105105
for _, tt := range tests {
106106
t.Run(tt.name, func(t *testing.T) {
107107
ctx := t.Context()
108-
ctx, cancel := context.WithTimeout(ctx, 5*time.Second)
108+
ctx, cancel := context.WithTimeout(ctx, 10*time.Second)
109109
t.Cleanup(cancel)
110110

111111
if _, err := projects.CommentUpdate(ctx, engine, tt.input); err != nil {
@@ -126,7 +126,7 @@ func TestCommentDelete(t *testing.T) {
126126
}
127127

128128
ctx := t.Context()
129-
ctx, cancel := context.WithTimeout(ctx, 5*time.Second)
129+
ctx, cancel := context.WithTimeout(ctx, 10*time.Second)
130130
t.Cleanup(cancel)
131131

132132
if _, err = projects.CommentDelete(ctx, engine, projects.NewCommentDeleteRequest(commentID)); err != nil {
@@ -146,7 +146,7 @@ func TestCommentGet(t *testing.T) {
146146
t.Cleanup(commentCleanup)
147147

148148
ctx := t.Context()
149-
ctx, cancel := context.WithTimeout(ctx, 5*time.Second)
149+
ctx, cancel := context.WithTimeout(ctx, 10*time.Second)
150150
t.Cleanup(cancel)
151151

152152
if _, err = projects.CommentGet(ctx, engine, projects.NewCommentGetRequest(commentID)); err != nil {
@@ -195,7 +195,7 @@ func TestCommentList(t *testing.T) {
195195
for _, tt := range tests {
196196
t.Run(tt.name, func(t *testing.T) {
197197
ctx := t.Context()
198-
ctx, cancel := context.WithTimeout(ctx, 5*time.Second)
198+
ctx, cancel := context.WithTimeout(ctx, 10*time.Second)
199199
t.Cleanup(cancel)
200200

201201
if _, err := projects.CommentList(ctx, engine, tt.input); err != nil {

projects/company_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ func TestCompanyCreate(t *testing.T) {
4848
for _, tt := range tests {
4949
t.Run(tt.name, func(t *testing.T) {
5050
ctx := t.Context()
51-
ctx, cancel := context.WithTimeout(ctx, 5*time.Second)
51+
ctx, cancel := context.WithTimeout(ctx, 10*time.Second)
5252
t.Cleanup(cancel)
5353

5454
company, err := projects.CompanyCreate(ctx, engine, tt.input)
@@ -114,7 +114,7 @@ func TestCompanyUpdate(t *testing.T) {
114114
for _, tt := range tests {
115115
t.Run(tt.name, func(t *testing.T) {
116116
ctx := t.Context()
117-
ctx, cancel := context.WithTimeout(ctx, 5*time.Second)
117+
ctx, cancel := context.WithTimeout(ctx, 10*time.Second)
118118
t.Cleanup(cancel)
119119

120120
if _, err := projects.CompanyUpdate(ctx, engine, tt.input); err != nil {
@@ -135,7 +135,7 @@ func TestCompanyDelete(t *testing.T) {
135135
}
136136

137137
ctx := t.Context()
138-
ctx, cancel := context.WithTimeout(ctx, 5*time.Second)
138+
ctx, cancel := context.WithTimeout(ctx, 10*time.Second)
139139
t.Cleanup(cancel)
140140

141141
if _, err = projects.CompanyDelete(ctx, engine, projects.NewCompanyDeleteRequest(companyID)); err != nil {
@@ -155,7 +155,7 @@ func TestCompanyGet(t *testing.T) {
155155
t.Cleanup(companyCleanup)
156156

157157
ctx := t.Context()
158-
ctx, cancel := context.WithTimeout(ctx, 5*time.Second)
158+
ctx, cancel := context.WithTimeout(ctx, 10*time.Second)
159159
t.Cleanup(cancel)
160160

161161
if _, err = projects.CompanyGet(ctx, engine, projects.NewCompanyGetRequest(companyID)); err != nil {
@@ -184,7 +184,7 @@ func TestCompanyList(t *testing.T) {
184184
for _, tt := range tests {
185185
t.Run(tt.name, func(t *testing.T) {
186186
ctx := t.Context()
187-
ctx, cancel := context.WithTimeout(ctx, 5*time.Second)
187+
ctx, cancel := context.WithTimeout(ctx, 10*time.Second)
188188
t.Cleanup(cancel)
189189

190190
if _, err := projects.CompanyList(ctx, engine, tt.input); err != nil {

projects/industry_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ func TestIndustryList(t *testing.T) {
2323
for _, tt := range tests {
2424
t.Run(tt.name, func(t *testing.T) {
2525
ctx := t.Context()
26-
ctx, cancel := context.WithTimeout(ctx, 5*time.Second)
26+
ctx, cancel := context.WithTimeout(ctx, 10*time.Second)
2727
t.Cleanup(cancel)
2828

2929
if _, err := projects.IndustryList(ctx, engine, tt.input); err != nil {

projects/jobrole_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ func TestJobRoleCreate(t *testing.T) {
2929
for _, tt := range tests {
3030
t.Run(tt.name, func(t *testing.T) {
3131
ctx := t.Context()
32-
ctx, cancel := context.WithTimeout(ctx, 5*time.Second)
32+
ctx, cancel := context.WithTimeout(ctx, 10*time.Second)
3333
t.Cleanup(cancel)
3434

3535
jobRoleResponse, err := projects.JobRoleCreate(ctx, engine, tt.input)
@@ -79,7 +79,7 @@ func TestJobRoleUpdate(t *testing.T) {
7979
for _, tt := range tests {
8080
t.Run(tt.name, func(t *testing.T) {
8181
ctx := t.Context()
82-
ctx, cancel := context.WithTimeout(ctx, 5*time.Second)
82+
ctx, cancel := context.WithTimeout(ctx, 10*time.Second)
8383
t.Cleanup(cancel)
8484

8585
if _, err := projects.JobRoleUpdate(ctx, engine, tt.input); err != nil {
@@ -100,7 +100,7 @@ func TestJobRoleDelete(t *testing.T) {
100100
}
101101

102102
ctx := t.Context()
103-
ctx, cancel := context.WithTimeout(ctx, 5*time.Second)
103+
ctx, cancel := context.WithTimeout(ctx, 10*time.Second)
104104
t.Cleanup(cancel)
105105

106106
if _, err = projects.JobRoleDelete(ctx, engine, projects.NewJobRoleDeleteRequest(jobRoleID)); err != nil {
@@ -120,7 +120,7 @@ func TestJobRoleGet(t *testing.T) {
120120
t.Cleanup(jobRoleCleanup)
121121

122122
ctx := t.Context()
123-
ctx, cancel := context.WithTimeout(ctx, 5*time.Second)
123+
ctx, cancel := context.WithTimeout(ctx, 10*time.Second)
124124
t.Cleanup(cancel)
125125

126126
if _, err = projects.JobRoleGet(ctx, engine, projects.NewJobRoleGetRequest(jobRoleID)); err != nil {
@@ -150,7 +150,7 @@ func TestJobRoleList(t *testing.T) {
150150
for _, tt := range tests {
151151
t.Run(tt.name, func(t *testing.T) {
152152
ctx := t.Context()
153-
ctx, cancel := context.WithTimeout(ctx, 5*time.Second)
153+
ctx, cancel := context.WithTimeout(ctx, 10*time.Second)
154154
t.Cleanup(cancel)
155155

156156
if _, err := projects.JobRoleList(ctx, engine, tt.input); err != nil {

projects/milestone_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ func TestMilestoneCreate(t *testing.T) {
4949
for _, tt := range tests {
5050
t.Run(tt.name, func(t *testing.T) {
5151
ctx := t.Context()
52-
ctx, cancel := context.WithTimeout(ctx, 5*time.Second)
52+
ctx, cancel := context.WithTimeout(ctx, 10*time.Second)
5353
t.Cleanup(cancel)
5454

5555
milestone, err := projects.MilestoneCreate(ctx, engine, tt.input)
@@ -108,7 +108,7 @@ func TestMilestoneUpdate(t *testing.T) {
108108
for _, tt := range tests {
109109
t.Run(tt.name, func(t *testing.T) {
110110
ctx := t.Context()
111-
ctx, cancel := context.WithTimeout(ctx, 5*time.Second)
111+
ctx, cancel := context.WithTimeout(ctx, 10*time.Second)
112112
t.Cleanup(cancel)
113113

114114
if _, err := projects.MilestoneUpdate(ctx, engine, tt.input); err != nil {
@@ -131,7 +131,7 @@ func TestMilestoneDelete(t *testing.T) {
131131
}
132132

133133
ctx := t.Context()
134-
ctx, cancel := context.WithTimeout(ctx, 5*time.Second)
134+
ctx, cancel := context.WithTimeout(ctx, 10*time.Second)
135135
t.Cleanup(cancel)
136136

137137
if _, err = projects.MilestoneDelete(ctx, engine, projects.NewMilestoneDeleteRequest(milestoneID)); err != nil {
@@ -153,7 +153,7 @@ func TestMilestoneGet(t *testing.T) {
153153
t.Cleanup(milestoneCleanup)
154154

155155
ctx := t.Context()
156-
ctx, cancel := context.WithTimeout(ctx, 5*time.Second)
156+
ctx, cancel := context.WithTimeout(ctx, 10*time.Second)
157157
t.Cleanup(cancel)
158158

159159
if _, err = projects.MilestoneGet(ctx, engine, projects.NewMilestoneGetRequest(milestoneID)); err != nil {
@@ -191,7 +191,7 @@ func TestMilestoneList(t *testing.T) {
191191
for _, tt := range tests {
192192
t.Run(tt.name, func(t *testing.T) {
193193
ctx := t.Context()
194-
ctx, cancel := context.WithTimeout(ctx, 5*time.Second)
194+
ctx, cancel := context.WithTimeout(ctx, 10*time.Second)
195195
t.Cleanup(cancel)
196196

197197
if _, err := projects.MilestoneList(ctx, engine, tt.input); err != nil {

projects/notebook_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ func TestNotebookCreate(t *testing.T) {
4444
for _, tt := range tests {
4545
t.Run(tt.name, func(t *testing.T) {
4646
ctx := t.Context()
47-
ctx, cancel := context.WithTimeout(ctx, 5*time.Second)
47+
ctx, cancel := context.WithTimeout(ctx, 10*time.Second)
4848
t.Cleanup(cancel)
4949

5050
notebookResponse, err := projects.NotebookCreate(ctx, engine, tt.input)
@@ -98,7 +98,7 @@ func TestNotebookUpdate(t *testing.T) {
9898
for _, tt := range tests {
9999
t.Run(tt.name, func(t *testing.T) {
100100
ctx := t.Context()
101-
ctx, cancel := context.WithTimeout(ctx, 5*time.Second)
101+
ctx, cancel := context.WithTimeout(ctx, 10*time.Second)
102102
t.Cleanup(cancel)
103103

104104
if _, err := projects.NotebookUpdate(ctx, engine, tt.input); err != nil {
@@ -119,7 +119,7 @@ func TestNotebookDelete(t *testing.T) {
119119
}
120120

121121
ctx := t.Context()
122-
ctx, cancel := context.WithTimeout(ctx, 5*time.Second)
122+
ctx, cancel := context.WithTimeout(ctx, 10*time.Second)
123123
t.Cleanup(cancel)
124124

125125
if _, err = projects.NotebookDelete(ctx, engine, projects.NewNotebookDeleteRequest(notebookID)); err != nil {
@@ -139,7 +139,7 @@ func TestNotebookGet(t *testing.T) {
139139
t.Cleanup(notebookCleanup)
140140

141141
ctx := t.Context()
142-
ctx, cancel := context.WithTimeout(ctx, 5*time.Second)
142+
ctx, cancel := context.WithTimeout(ctx, 10*time.Second)
143143
t.Cleanup(cancel)
144144

145145
if _, err = projects.NotebookGet(ctx, engine, projects.NewNotebookGetRequest(notebookID)); err != nil {
@@ -168,7 +168,7 @@ func TestNotebookList(t *testing.T) {
168168
for _, tt := range tests {
169169
t.Run(tt.name, func(t *testing.T) {
170170
ctx := t.Context()
171-
ctx, cancel := context.WithTimeout(ctx, 5*time.Second)
171+
ctx, cancel := context.WithTimeout(ctx, 10*time.Second)
172172
t.Cleanup(cancel)
173173

174174
if _, err := projects.NotebookList(ctx, engine, tt.input); err != nil {

projects/project_category_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ func TestProjectCategoryCreate(t *testing.T) {
4040
for _, tt := range tests {
4141
t.Run(tt.name, func(t *testing.T) {
4242
ctx := t.Context()
43-
ctx, cancel := context.WithTimeout(ctx, 5*time.Second)
43+
ctx, cancel := context.WithTimeout(ctx, 10*time.Second)
4444
t.Cleanup(cancel)
4545

4646
projectCategory, err := projects.ProjectCategoryCreate(ctx, engine, tt.input)
@@ -99,7 +99,7 @@ func TestProjectCategoryUpdate(t *testing.T) {
9999
for _, tt := range tests {
100100
t.Run(tt.name, func(t *testing.T) {
101101
ctx := t.Context()
102-
ctx, cancel := context.WithTimeout(ctx, 5*time.Second)
102+
ctx, cancel := context.WithTimeout(ctx, 10*time.Second)
103103
t.Cleanup(cancel)
104104

105105
if _, err := projects.ProjectCategoryUpdate(ctx, engine, tt.input); err != nil {
@@ -120,7 +120,7 @@ func TestProjectCategoryDelete(t *testing.T) {
120120
}
121121

122122
ctx := t.Context()
123-
ctx, cancel := context.WithTimeout(ctx, 5*time.Second)
123+
ctx, cancel := context.WithTimeout(ctx, 10*time.Second)
124124
t.Cleanup(cancel)
125125

126126
_, err = projects.ProjectCategoryDelete(ctx, engine, projects.NewProjectCategoryDeleteRequest(projectCategoryID))
@@ -141,7 +141,7 @@ func TestProjectCategoryGet(t *testing.T) {
141141
defer projectCategoryCleanup()
142142

143143
ctx := t.Context()
144-
ctx, cancel := context.WithTimeout(ctx, 5*time.Second)
144+
ctx, cancel := context.WithTimeout(ctx, 10*time.Second)
145145
t.Cleanup(cancel)
146146

147147
_, err = projects.ProjectCategoryGet(ctx, engine, projects.NewProjectCategoryGetRequest(projectCategoryID))
@@ -171,7 +171,7 @@ func TestProjectCategoryList(t *testing.T) {
171171
for _, tt := range tests {
172172
t.Run(tt.name, func(t *testing.T) {
173173
ctx := t.Context()
174-
ctx, cancel := context.WithTimeout(ctx, 5*time.Second)
174+
ctx, cancel := context.WithTimeout(ctx, 10*time.Second)
175175
t.Cleanup(cancel)
176176

177177
if _, err := projects.ProjectCategoryList(ctx, engine, tt.input); err != nil {

projects/project_member_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ func TestProjectMemberAdd(t *testing.T) {
3030
for _, tt := range tests {
3131
t.Run(tt.name, func(t *testing.T) {
3232
ctx := t.Context()
33-
ctx, cancel := context.WithTimeout(ctx, 5*time.Second)
33+
ctx, cancel := context.WithTimeout(ctx, 10*time.Second)
3434
t.Cleanup(cancel)
3535

3636
if _, err := projects.ProjectMemberAdd(ctx, engine, tt.input); err != nil {

projects/project_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ func TestProjectCreate(t *testing.T) {
3939
for _, tt := range tests {
4040
t.Run(tt.name, func(t *testing.T) {
4141
ctx := t.Context()
42-
ctx, cancel := context.WithTimeout(ctx, 5*time.Second)
42+
ctx, cancel := context.WithTimeout(ctx, 10*time.Second)
4343
t.Cleanup(cancel)
4444

4545
project, err := projects.ProjectCreate(ctx, engine, tt.input)
@@ -96,7 +96,7 @@ func TestProjectUpdate(t *testing.T) {
9696
for _, tt := range tests {
9797
t.Run(tt.name, func(t *testing.T) {
9898
ctx := t.Context()
99-
ctx, cancel := context.WithTimeout(ctx, 5*time.Second)
99+
ctx, cancel := context.WithTimeout(ctx, 10*time.Second)
100100
t.Cleanup(cancel)
101101

102102
if _, err := projects.ProjectUpdate(ctx, engine, tt.input); err != nil {
@@ -117,7 +117,7 @@ func TestProjectDelete(t *testing.T) {
117117
}
118118

119119
ctx := t.Context()
120-
ctx, cancel := context.WithTimeout(ctx, 5*time.Second)
120+
ctx, cancel := context.WithTimeout(ctx, 10*time.Second)
121121
t.Cleanup(cancel)
122122

123123
if _, err = projects.ProjectDelete(ctx, engine, projects.NewProjectDeleteRequest(projectID)); err != nil {
@@ -137,7 +137,7 @@ func TestProjectGet(t *testing.T) {
137137
t.Cleanup(projectCleanup)
138138

139139
ctx := t.Context()
140-
ctx, cancel := context.WithTimeout(ctx, 5*time.Second)
140+
ctx, cancel := context.WithTimeout(ctx, 10*time.Second)
141141
t.Cleanup(cancel)
142142

143143
if _, err = projects.ProjectGet(ctx, engine, projects.NewProjectGetRequest(projectID)); err != nil {
@@ -166,7 +166,7 @@ func TestProjectList(t *testing.T) {
166166
for _, tt := range tests {
167167
t.Run(tt.name, func(t *testing.T) {
168168
ctx := t.Context()
169-
ctx, cancel := context.WithTimeout(ctx, 5*time.Second)
169+
ctx, cancel := context.WithTimeout(ctx, 10*time.Second)
170170
t.Cleanup(cancel)
171171

172172
if _, err := projects.ProjectList(ctx, engine, tt.input); err != nil {

0 commit comments

Comments
 (0)