mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
integration: test snapshot inflights metrics
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
This commit is contained in:
parent
46bddacacb
commit
a4badc33a3
@ -71,7 +71,25 @@ func TestV3WatchRestoreSnapshotUnsync(t *testing.T) {
|
||||
// trigger snapshot send from leader to this slow follower
|
||||
// which then calls watchable store Restore
|
||||
clus.Members[0].RecoverPartition(t, clus.Members[1:]...)
|
||||
clus.WaitLeader(t)
|
||||
lead := clus.WaitLeader(t)
|
||||
|
||||
sends, err := clus.Members[lead].Metric("etcd_network_snapshot_send_inflights_total")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if sends != "0" && sends != "1" {
|
||||
// 0 if already sent, 1 if sending
|
||||
t.Fatalf("inflight snapshot sends expected 0 or 1, got %q", sends)
|
||||
}
|
||||
receives, err := clus.Members[(lead+1)%3].Metric("etcd_network_snapshot_receive_inflights_total")
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
if receives != "0" && receives != "1" {
|
||||
// 0 if already received, 1 if receiving
|
||||
t.Fatalf("inflight snapshot receives expected 0 or 1, got %q", receives)
|
||||
}
|
||||
|
||||
time.Sleep(2 * time.Second)
|
||||
|
||||
// slow follower now applies leader snapshot
|
||||
|
Loading…
x
Reference in New Issue
Block a user