From 30b5c371904c6db2fee34191499842a9eff8e2aa Mon Sep 17 00:00:00 2001 From: Benjamin Wang Date: Tue, 22 Aug 2023 10:08:28 +0100 Subject: [PATCH] test: verify snap.Load() is sucessful Otherwise the following snap.Data may run into nil pointer panic. Signed-off-by: Benjamin Wang --- tests/e2e/cluster_downgrade_test.go | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/e2e/cluster_downgrade_test.go b/tests/e2e/cluster_downgrade_test.go index 7da3fb42775..7e131aea463 100644 --- a/tests/e2e/cluster_downgrade_test.go +++ b/tests/e2e/cluster_downgrade_test.go @@ -302,6 +302,7 @@ func verifySnapshotMembers(t *testing.T, epc *e2e.EtcdProcessCluster, expectedMe t.Logf("Verifying snapshot for member %d", i) ss := snap.New(epc.Cfg.Logger, datadir.ToSnapDir(epc.Procs[i].Config().DataDirPath)) snap, err := ss.Load() + require.NoError(t, err) st := v2store.New(etcdserver.StoreClusterPrefix, etcdserver.StoreKeysPrefix) err = st.Recovery(snap.Data) assert.NoError(t, err)