Skip to content
This repository has been archived by the owner on Jun 16, 2021. It is now read-only.

Commit

Permalink
fix the testcase TestInParallelError
Browse files Browse the repository at this point in the history
booleanMap expected to contain true values on odd number, so move
the code `booleanMap.Add(index, true)` down to fix that.

Signed-off-by: Wang Long <long.wanglong@huawei.com>
  • Loading branch information
datawolf committed Apr 8, 2016
1 parent 4d629d5 commit c3238e6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion utils/util_inparallel_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,12 +61,13 @@ func TestInParallelError(t *testing.T) {
for i := 0; i < size; i++ {
task := func(index int) func() error {
return func() error {
booleanMap.Add(index, true)
booleanMap.Add(index, false)
t.Log("index", index)
if index%2 == 0 {
t.Log("return an error for", index)
return fmt.Errorf("Error with %v", index)
}
booleanMap.Add(index, true)
return nil
}
}(i)
Expand Down

0 comments on commit c3238e6

Please sign in to comment.