Skip to content

Commit 6034200

Browse files
committed
Fix inconsistency detection in transfers test.
1 parent 17a26e5 commit 6034200

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

contrib/pg_dtm/tests/perf/transfers.go

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -150,13 +150,12 @@ func (t Transfers) reader(wg *sync.WaitGroup, cFetches chan int, inconsistency *
150150
}
151151
commit(conns...)
152152

153-
if (sum != prevSum) {
154-
fmt.Printf("Total=%d xid=%d\n", sum, xid)
155-
if (prevSum != 0) {
156-
fmt.Printf("inconsistency!\n")
153+
if (sum != 0) {
154+
if (sum != prevsum) {
155+
fmt.Printf("inconsistency: total=%d xid=%d\n", sum, xid)
157156
*inconsistency = true
157+
prevsum = sum
158158
}
159-
prevSum = sum
160159
}
161160
}
162161

0 commit comments

Comments
 (0)