Skip to content

Commit 87f578e

Browse files
committed
fix test
Signed-off-by: crazycs520 <[email protected]>
1 parent 1038012 commit 87f578e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pkg/distsql/distsql_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,9 @@ func TestSelectResultRuntimeStats(t *testing.T) {
119119
s1.procKeys.Add(100)
120120
s1.procKeys.Add(200)
121121

122-
s2 := *s1
123-
stmtStats.RegisterStats(1, s1)
124-
stmtStats.RegisterStats(1, &s2)
122+
s2 := s1.Clone()
123+
stmtStats.RegisterStats(1, s1.Clone())
124+
stmtStats.RegisterStats(1, s2)
125125
stats := stmtStats.GetRootStats(1)
126126
expect := "time:1s, open:0s, close:0s, loops:1, cop_task: {num: 4, max: 1s, min: 1ms, avg: 500.5ms, p95: 1s, max_proc_keys: 200, p95_proc_keys: 200, tot_proc: 2s, tot_wait: 2s, copr_cache_hit_ratio: 0.00, max_distsql_concurrency: 15}, backoff{RegionMiss: 2ms}"
127127
require.Equal(t, expect, stats.String())
@@ -134,7 +134,7 @@ func TestSelectResultRuntimeStats(t *testing.T) {
134134
}
135135
s1.reqStat.RecordRPCErrorStats("server_is_busy")
136136
s1.reqStat.RecordRPCErrorStats("server_is_busy")
137-
stmtStats.RegisterStats(2, s1)
137+
stmtStats.RegisterStats(2, s1.Clone())
138138
stats = stmtStats.GetRootStats(2)
139139
expect = "cop_task: {num: 2, max: 1s, min: 1ms, avg: 500.5ms, p95: 1s, max_proc_keys: 200, p95_proc_keys: 200, tot_proc: 1s, tot_wait: 1s, copr_cache_hit_ratio: 0.00, max_distsql_concurrency: 15}, rpc_info:{Cop:{num_rpc:1, total_time:1s}, rpc_errors:{server_is_busy:2}}, backoff{RegionMiss: 1ms}"
140140
require.Equal(t, expect, stats.String())

0 commit comments

Comments
 (0)