Skip to content

Commit

Permalink
tests: Optimize checking failed writes
Browse files Browse the repository at this point in the history
Signed-off-by: Marek Siarkowicz <siarkowicz@google.com>
  • Loading branch information
serathius committed Nov 6, 2022
1 parent 6bfaf8d commit 622fd91
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions tests/linearizability/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,11 @@ func step(state EtcdState, request etcdRequest, response etcdResponse) (bool, Et
if state.Value == response.getData {
return true, state
}
for write := range state.FailedWrites {
if write == response.getData {
state.Value = response.getData
delete(state.FailedWrites, write)
return true, state
}
_, ok := state.FailedWrites[response.getData]
if ok {
state.Value = response.getData
delete(state.FailedWrites, response.getData)
return true, state
}
case Put:
if response.err == nil {
Expand Down

0 comments on commit 622fd91

Please sign in to comment.