From f0f4e8a4e884e9e2550538777c4607d970a6803a Mon Sep 17 00:00:00 2001 From: Madhav Jivrajani Date: Thu, 1 Feb 2024 16:14:35 +0530 Subject: [PATCH] tests/robustness: fix out of index panic in model replay Signed-off-by: Madhav Jivrajani --- tests/robustness/model/replay.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/robustness/model/replay.go b/tests/robustness/model/replay.go index 5d040493220..78d88c7965e 100644 --- a/tests/robustness/model/replay.go +++ b/tests/robustness/model/replay.go @@ -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: