-
Notifications
You must be signed in to change notification settings - Fork 9.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tests/robustness: Validate all etcd watches opened to etcd #15893
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -508,6 +508,10 @@ func (h History) Merge(h2 History) History { | |
return result | ||
} | ||
|
||
func (h History) Len() int { | ||
return len(h.successful) + len(h.failed) | ||
} | ||
|
||
func (h History) Operations() []porcupine.Operation { | ||
operations := make([]porcupine.Operation, 0, len(h.successful)+len(h.failed)) | ||
var maxTime int64 | ||
|
@@ -530,3 +534,14 @@ func (h History) Operations() []porcupine.Operation { | |
} | ||
return operations | ||
} | ||
|
||
func (h History) MaxRevision() int64 { | ||
var maxRevision int64 | ||
for _, op := range h.successful { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we need to handle a situation where There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can maintain special meaning of |
||
revision := op.Output.(EtcdNonDeterministicResponse).Revision | ||
if revision > maxRevision { | ||
maxRevision = revision | ||
} | ||
} | ||
return maxRevision | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the change accidentally updated? :/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it's intentional as file paths change.