tests/robustness: fix out of index panic in model replay

Signed-off-by: Madhav Jivrajani <madhav.jiv@gmail.com>
This commit is contained in:
Madhav Jivrajani 2024-02-01 16:14:35 +05:30
parent ca41186228
commit f0f4e8a4e8

View File

@ -73,7 +73,7 @@ func (r *EtcdReplay) next() (request EtcdRequest, revision int64, index int) {
revision = r.eventHistory[r.eventHistoryIndex].Revision
index = r.eventHistoryIndex
operations := []EtcdOperation{}
for r.eventHistory[index].Revision == revision {
for index < len(r.eventHistory) && r.eventHistory[index].Revision == revision {
event := r.eventHistory[index]
switch event.Type {
case PutOperation: