Skip to content

Commit

Permalink
ci: add a bit more test time for slow ci machine
Browse files Browse the repository at this point in the history
Signed-off-by: Sander Pick <[email protected]>
  • Loading branch information
sanderpick committed Mar 29, 2021
1 parent 158d6eb commit 2ab8704
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
12 changes: 8 additions & 4 deletions gateway/pinning_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@ func init() {
}); err != nil {
panic(err)
}
queue.MaxConcurrency = 10 // Reduce concurrency to test overloading workers
pinning.PinTimeout = time.Second * 5
}

func TestMain(m *testing.M) {
Expand All @@ -75,6 +73,8 @@ func TestMain(m *testing.M) {
}

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

t.Run("pagination", func(t *testing.T) {
Expand All @@ -100,7 +100,7 @@ func Test_ListPins(t *testing.T) {
i := i
j := i + (b * batchSize)
f := files[j]
time.Sleep(time.Second)
time.Sleep(time.Second * 2)
eg.Go(func() error {
if gctx.Err() != nil {
return nil
Expand All @@ -115,7 +115,7 @@ func Test_ListPins(t *testing.T) {
}(c, b)
}

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

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

func Test_AddPin(t *testing.T) {
pinning.PinTimeout = time.Second * 5
gw := newGateway(t)
c := newClient(t, gw)

Expand Down Expand Up @@ -332,6 +333,7 @@ func Test_AddPin(t *testing.T) {
}

func Test_GetPin(t *testing.T) {
pinning.PinTimeout = time.Second * 5
gw := newGateway(t)
c := newClient(t, gw)

Expand Down Expand Up @@ -383,6 +385,7 @@ func Test_GetPin(t *testing.T) {
}

func Test_ReplacePin(t *testing.T) {
pinning.PinTimeout = time.Second * 5
gw := newGateway(t)
c := newClient(t, gw)

Expand Down Expand Up @@ -423,6 +426,7 @@ func Test_ReplacePin(t *testing.T) {
}

func Test_RemovePin(t *testing.T) {
pinning.PinTimeout = time.Second * 5
gw := newGateway(t)
c := newClient(t, gw)

Expand Down
3 changes: 2 additions & 1 deletion pinning/queue/queue_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ func TestQueue_ListRequests(t *testing.T) {
key := newBucketkey(t)
ids := make([]string, limit)
for i := 0; i < limit; i++ {
now = now.Add(time.Second) // Pagination is not possible at sub second resolution due limits in the API spec
// Pagination is not possible at sub second resolution due limits in the API spec
now = now.Add(time.Second * 2)
p := newParams(key, now, time.Millisecond, succeed)
r, err := q.AddRequest(p)
require.NoError(t, err)
Expand Down

0 comments on commit 2ab8704

Please sign in to comment.