Przeglądaj źródła

testutil: fix data race in RecorderBuffered

Was accessing a shared data structure instead of the private copy.

Fixes #4198
Anthony Romano 10 lat temu
rodzic
commit
54c905f87f
1 zmienionych plików z 1 dodań i 1 usunięć
  1. 1 1
      pkg/testutil/recorder.go

+ 1 - 1
pkg/testutil/recorder.go

@@ -61,7 +61,7 @@ func (r *RecorderBuffered) Wait(n int) (acts []Action, err error) {
 	WaitSchedule()
 	acts = r.Action()
 	if len(acts) < n {
-		err = newLenErr(n, len(r.actions))
+		err = newLenErr(n, len(acts))
 	}
 	return acts, err
 }