Skip to content

Commit

Permalink
Fix: remediate unit test race condition
Browse files Browse the repository at this point in the history
  • Loading branch information
yunginnanet committed Oct 19, 2023
1 parent 7c5cc69 commit 7633aa3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions internal/util/speedometer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,9 @@ func Test_Speedometer(t *testing.T) {
for i := 0; i < 100; i++ {
go func() {
var counted int
counted, err = sp.Write([]byte("a"))
if err != nil {
var gerr error
counted, gerr = sp.Write([]byte("a"))
if gerr != nil {
t.Errorf("unexpected error: %v", err)
}
atomic.AddInt64(&count, int64(counted))
Expand Down

0 comments on commit 7633aa3

Please sign in to comment.