@@ -293,12 +293,12 @@ func (s *testSnapshotSuite) TestSnapshotRuntimeStats() {
293293 snapshot .MergeRegionRequestStats (reqStats .Stats )
294294 snapshot .MergeRegionRequestStats (reqStats .Stats )
295295 bo := tikv .NewBackofferWithVars (context .Background (), 2000 , nil )
296- err := bo .BackoffWithMaxSleepTxnLockFast (30 , errors .New ("test" ))
296+ err := bo .BackoffWithMaxSleepTxnLockFast (5 , errors .New ("test" ))
297297 s .Nil (err )
298298 snapshot .RecordBackoffInfo (bo )
299299 snapshot .RecordBackoffInfo (bo )
300- expect := "Get:{num_rpc:4, total_time:2s},txnLockFast_backoff:{num:2, total_time:60ms }"
301- s .Equal (snapshot .FormatStats (), expect )
300+ expect := "Get:{num_rpc:4, total_time:2s},txnLockFast_backoff:{num:2, total_time:10ms }"
301+ s .Equal (expect , snapshot .FormatStats ())
302302 detail := & kvrpcpb.ExecDetailsV2 {
303303 TimeDetail : & kvrpcpb.TimeDetail {
304304 WaitWallTimeMs : 100 ,
@@ -316,23 +316,23 @@ func (s *testSnapshotSuite) TestSnapshotRuntimeStats() {
316316 },
317317 }
318318 snapshot .MergeExecDetail (detail )
319- expect = "Get:{num_rpc:4, total_time:2s},txnLockFast_backoff:{num:2, total_time:60ms }, " +
319+ expect = "Get:{num_rpc:4, total_time:2s},txnLockFast_backoff:{num:2, total_time:10ms }, " +
320320 "total_process_time: 100ms, total_wait_time: 100ms, " +
321321 "scan_detail: {total_process_keys: 10, " +
322322 "total_process_keys_size: 10, " +
323323 "total_keys: 15, " +
324324 "rocksdb: {delete_skipped_count: 5, " +
325325 "key_skipped_count: 1, " +
326326 "block: {cache_hit_count: 10, read_count: 20, read_byte: 15 Bytes}}}"
327- s .Equal (snapshot .FormatStats (), expect )
327+ s .Equal (expect , snapshot .FormatStats ())
328328 snapshot .MergeExecDetail (detail )
329- expect = "Get:{num_rpc:4, total_time:2s},txnLockFast_backoff:{num:2, total_time:60ms }, " +
329+ expect = "Get:{num_rpc:4, total_time:2s},txnLockFast_backoff:{num:2, total_time:10ms }, " +
330330 "total_process_time: 200ms, total_wait_time: 200ms, " +
331331 "scan_detail: {total_process_keys: 20, " +
332332 "total_process_keys_size: 20, " +
333333 "total_keys: 30, " +
334334 "rocksdb: {delete_skipped_count: 10, " +
335335 "key_skipped_count: 2, " +
336336 "block: {cache_hit_count: 20, read_count: 40, read_byte: 30 Bytes}}}"
337- s .Equal (snapshot .FormatStats (), expect )
337+ s .Equal (expect , snapshot .FormatStats ())
338338}
0 commit comments