Skip to content

Commit

Permalink
test: increase context timeout to support github ci delay
Browse files Browse the repository at this point in the history
  • Loading branch information
jeamon committed Nov 1, 2023
1 parent 8aea293 commit 6ab9002
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions gorqs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ func TestFetch(t *testing.T) {
// Ensure all jobs added are queued and executed in the order they were added.
func TestSyncQueue_Basic(t *testing.T) {
queue := New(SyncMode)
ctx, cancel := context.WithTimeout(context.Background(), 100*time.Millisecond)
ctx, cancel := context.WithTimeout(context.Background(), time.Second)
defer cancel()

done := make(chan struct{}, 1)
Expand Down Expand Up @@ -321,15 +321,15 @@ func TestSyncQueue_Basic(t *testing.T) {
check(t, 3, id, err)

// give more time for above josb to finish.
time.Sleep(70 * time.Millisecond)
time.Sleep(100 * time.Millisecond)

if err := queue.Stop(ctx); err != nil {
t.Errorf("expected <nil> but got %v", err)
}

select {
case <-done:
case <-time.After(20 * time.Millisecond):
case <-time.After(time.Millisecond * 500):
t.Error("running queue did not exit.")
}

Expand Down

0 comments on commit 6ab9002

Please sign in to comment.