Skip to content

Commit

Permalink
test: verify snap.Load() is sucessful
Browse files Browse the repository at this point in the history
Otherwise the following snap.Data may run into nil pointer panic.

Signed-off-by: Benjamin Wang <[email protected]>
  • Loading branch information
ahrtr committed Aug 22, 2023
1 parent f3cc759 commit 30b5c37
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tests/e2e/cluster_downgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 30b5c37

Please sign in to comment.