internal/trace: increment sync counter before final Sync on error

CL 648195 was supposed to have fixed #71615, but it didn't include an
update to r.syncs. I can confirm this CL fixes the issue even when
running the test many times in a row.

Fixes #71615.

Change-Id: I97db3d639dc5bc8648a191696f90b0e5087307c8
Reviewed-on: https://go-review.googlesource.com/c/go/+/648315
Auto-Submit: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
TryBot-Bypass: Michael Knyszek <mknyszek@google.com>
This commit is contained in:
Michael Anthony Knyszek 2025-02-10 23:54:56 +00:00 committed by Gopher Robot
parent 7c1a4134b4
commit 887d9ef610

View file

@ -154,6 +154,7 @@ func (r *Reader) ReadEvent() (e Event, err error) {
// Read the next generation.
r.gen, r.spill, r.spillErr = readGeneration(r.r, r.spill)
if r.gen == nil {
r.syncs++
return syncEvent(nil, r.lastTs, r.syncs), nil
}