Skip to content

Commit 2ab8704

Browse files
committed
ci: add a bit more test time for slow ci machine
Signed-off-by: Sander Pick <sanderpick@gmail.com>
1 parent 158d6eb commit 2ab8704

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

gateway/pinning_test.go

+8-4
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,6 @@ func init() {
5353
}); err != nil {
5454
panic(err)
5555
}
56-
queue.MaxConcurrency = 10 // Reduce concurrency to test overloading workers
57-
pinning.PinTimeout = time.Second * 5
5856
}
5957

6058
func TestMain(m *testing.M) {
@@ -75,6 +73,8 @@ func TestMain(m *testing.M) {
7573
}
7674

7775
func Test_ListPins(t *testing.T) {
76+
queue.MaxConcurrency = 10 // Reduce concurrency to test overloading workers
77+
pinning.PinTimeout = time.Second * 10
7878
gw := newGateway(t)
7979

8080
t.Run("pagination", func(t *testing.T) {
@@ -100,7 +100,7 @@ func Test_ListPins(t *testing.T) {
100100
i := i
101101
j := i + (b * batchSize)
102102
f := files[j]
103-
time.Sleep(time.Second)
103+
time.Sleep(time.Second * 2)
104104
eg.Go(func() error {
105105
if gctx.Err() != nil {
106106
return nil
@@ -115,7 +115,7 @@ func Test_ListPins(t *testing.T) {
115115
}(c, b)
116116
}
117117

118-
time.Sleep(time.Second * 25) // Allow time for requests to be added
118+
time.Sleep(time.Minute) // Allow time for requests to be added
119119

120120
// Test pagination
121121
for _, c := range clients {
@@ -294,6 +294,7 @@ func Test_ListPins(t *testing.T) {
294294
}
295295

296296
func Test_AddPin(t *testing.T) {
297+
pinning.PinTimeout = time.Second * 5
297298
gw := newGateway(t)
298299
c := newClient(t, gw)
299300

@@ -332,6 +333,7 @@ func Test_AddPin(t *testing.T) {
332333
}
333334

334335
func Test_GetPin(t *testing.T) {
336+
pinning.PinTimeout = time.Second * 5
335337
gw := newGateway(t)
336338
c := newClient(t, gw)
337339

@@ -383,6 +385,7 @@ func Test_GetPin(t *testing.T) {
383385
}
384386

385387
func Test_ReplacePin(t *testing.T) {
388+
pinning.PinTimeout = time.Second * 5
386389
gw := newGateway(t)
387390
c := newClient(t, gw)
388391

@@ -423,6 +426,7 @@ func Test_ReplacePin(t *testing.T) {
423426
}
424427

425428
func Test_RemovePin(t *testing.T) {
429+
pinning.PinTimeout = time.Second * 5
426430
gw := newGateway(t)
427431
c := newClient(t, gw)
428432

pinning/queue/queue_test.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,8 @@ func TestQueue_ListRequests(t *testing.T) {
5252
key := newBucketkey(t)
5353
ids := make([]string, limit)
5454
for i := 0; i < limit; i++ {
55-
now = now.Add(time.Second) // Pagination is not possible at sub second resolution due limits in the API spec
55+
// Pagination is not possible at sub second resolution due limits in the API spec
56+
now = now.Add(time.Second * 2)
5657
p := newParams(key, now, time.Millisecond, succeed)
5758
r, err := q.AddRequest(p)
5859
require.NoError(t, err)

0 commit comments

Comments
 (0)