Skip to content

Commit

Permalink
Reduce number of goroutines in tests that became flaky after Go 1.14 …
Browse files Browse the repository at this point in the history
…migration (#248)

* Run less go routines in unit tests

* Change number

* Change number
  • Loading branch information
Yiran Wang authored May 6, 2020
1 parent e95dce8 commit 78baa5e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions lib/persistedretry/tagreplication/store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ import (
"github.com/golang/mock/gomock"
"github.com/jmoiron/sqlx"

"github.com/stretchr/testify/require"
"github.com/uber/kraken/lib/persistedretry"
. "github.com/uber/kraken/lib/persistedretry/tagreplication"
"github.com/uber/kraken/localdb"
"github.com/uber/kraken/mocks/lib/persistedretry/tagreplication"
mocktagreplication "github.com/uber/kraken/mocks/lib/persistedretry/tagreplication"
"github.com/uber/kraken/utils/testutil"
"github.com/stretchr/testify/require"
)

type storeMocks struct {
Expand Down Expand Up @@ -109,7 +109,7 @@ func TestDatabaseNotLocked(t *testing.T) {
store := mocks.new()

var wg sync.WaitGroup
for i := 0; i < 1000; i++ {
for i := 0; i < 200; i++ {
wg.Add(1)
go func() {
defer wg.Done()
Expand Down
4 changes: 2 additions & 2 deletions lib/persistedretry/writeback/store_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ import (
"testing"
"time"

"github.com/stretchr/testify/require"
"github.com/uber/kraken/lib/persistedretry"
"github.com/uber/kraken/localdb"
"github.com/stretchr/testify/require"
)

func checkTask(t *testing.T, expected *Task, result persistedretry.Task) {
Expand Down Expand Up @@ -75,7 +75,7 @@ func TestDatabaseNotLocked(t *testing.T) {
store := NewStore(db)

var wg sync.WaitGroup
for i := 0; i < 1000; i++ {
for i := 0; i < 200; i++ {
wg.Add(1)
go func() {
defer wg.Done()
Expand Down

0 comments on commit 78baa5e

Please sign in to comment.