Repository: etcd-io/etcd
File: tests/robustness/model/history.go (Go)

Code before:
		Return:   end.Nanoseconds(),
	}
	isRead := request.IsRead()
	if !isRead {
		// Failed writes can still be persisted, setting -1 for now as don't know when request has took effect.
		op.Return = math.MaxInt64
		// Operations of single client needs to be sequential.
		// As we don't know return time of failed operations, all new writes need to be done with new stream id.
		h.streamID = h.idProvider.NewStreamID()
	}
	h.append(op)
}

func (h *AppendableHistory) append(op porcupine.Operation) {
	if op.Return != math.MaxInt64 && op.Call >= op.Return {
		panic(fmt.Sprintf("Invalid operation, call(%d) >= return(%d)", op.Call, op.Return))
	}
	if len(h.operations) > 0 {
		// TODO: check the client ID
		prev := h.operations[len(h.operations)-1]
		if op.Call <= prev.Call {
			panic(fmt.Sprintf("Out of order append, new.call(%d) <= prev.call(%d)", op.Call, prev.Call))
		}
		// if op.Call <= prev.Return {
		// 	panic(fmt.Sprintf("Overlapping operations, new.call(%d) <= prev.return(%d)", op.Call, prev.Return))
		// }
	}
	h.operations = append(h.operations, op)
}

func getRequest(key string) EtcdRequest {
	return rangeRequest(key, "", 0)
}

func staleGetRequest(key string, revision int64) EtcdRequest {
	return staleRangeRequest(key, "", 0, revision)
}

func rangeRequest(start, end string, limit int64) EtcdRequest {
	return staleRangeRequest(start, end, limit, 0)
}

func listRequest(key string, limit int64) EtcdRequest {
	return staleListRequest(key, limit, 0)
}

func staleListRequest(key string, limit, revision int64) EtcdRequest {
	return staleRangeRequest(key, clientv3.GetPrefixRangeEnd(key), limit, revision)
}

func staleRangeRequest(start, end string, limit, revision int64) EtcdRequest {

Review comment (suggestion):
```suggestion
		 if op.Call <= prev.Return {
		 	panic(fmt.Sprintf("Overlapping operations, new.call(%d) <= prev.return(%d)", op.Call, prev.Return))
		}
```

Code after:
		Return:   end.Nanoseconds(),
	}
	isRead := request.IsRead()
	if !isRead {
		// Failed writes can still be persisted, setting -1 for now as don't know when request has took effect.
		op.Return = math.MaxInt64
		// Operations of single client needs to be sequential.
		// As we don't know return time of failed operations, all new writes need to be done with new stream id.
		h.streamID = h.idProvider.NewStreamID()
	}
	h.append(op)
}

func (h *AppendableHistory) append(op porcupine.Operation) {
	if op.Return != math.MaxInt64 && op.Call >= op.Return {
		panic(fmt.Sprintf("Invalid operation, call(%d) >= return(%d)", op.Call, op.Return))
	}

	if len(h.operations) > 0 && op.ClientId == h.operations[len(h.operations)-1].ClientId {
		prev := h.operations[len(h.operations)-1]
		if op.Call <= prev.Call {
			panic(fmt.Sprintf("Out of order append, new.call(%d) <= prev.call(%d)", op.Call, prev.Call))
		}
		if op.Call <= prev.Return {
			panic(fmt.Sprintf("Overlapping operations, new.call(%d) <= prev.return(%d)", op.Call, prev.Return))
		}
	}
	h.operations = append(h.operations, op)
}

func getRequest(key string) EtcdRequest {
	return rangeRequest(key, "", 0)
}

func staleGetRequest(key string, revision int64) EtcdRequest {
	return staleRangeRequest(key, "", 0, revision)
}

func rangeRequest(start, end string, limit int64) EtcdRequest {
	return staleRangeRequest(start, end, limit, 0)
}

func listRequest(key string, limit int64) EtcdRequest {
	return staleListRequest(key, limit, 0)
}

func staleListRequest(key string, limit, revision int64) EtcdRequest {
	return staleRangeRequest(key, clientv3.GetPrefixRangeEnd(key), limit, revision)
}

func staleRangeRequest(start, end string, limit, revision int64) EtcdRequest {