Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
zhenghaoz committed Mar 4, 2021
1 parent a3fd457 commit 4255487
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions base/parallel_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ func TestParallel(t *testing.T) {
})
workersSet := NewSet(workerIds...)
assert.Equal(t, a, b)
assert.Equal(t, 4, workersSet.Len())
assert.GreaterOrEqual(t, 4, workersSet.Len())
assert.Less(t, 1, workersSet.Len())
// single thread
_ = Parallel(len(a), 1, func(workerId, jobId int) error {
b[jobId] = a[jobId]
Expand Down Expand Up @@ -65,7 +66,8 @@ func TestBatchParallel(t *testing.T) {
})
workersSet := NewSet(workerIds...)
assert.Equal(t, a, b)
assert.Equal(t, 4, workersSet.Len())
assert.GreaterOrEqual(t, 4, workersSet.Len())
assert.Less(t, 1, workersSet.Len())
// single thread
_ = Parallel(len(a), 1, func(workerId, jobId int) error {
b[jobId] = a[jobId]
Expand Down

0 comments on commit 4255487

Please sign in to comment.