Skip to content

WIP: test if watch is sequential #18264

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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ah8ad3
Copy link
Contributor

@ah8ad3 ah8ad3 commented Jul 2, 2024

WIP:
Added member id in WatchResponse.
Change validateOrdered to check for MemberId for each event, as sequential should check for each process.

Fixes #18141

@k8s-ci-robot
Copy link

Hi @ah8ad3. Thanks for your PR.

I'm waiting for a etcd-io member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@ah8ad3 ah8ad3 force-pushed the robustness-test-watch-sequential branch from 1aa13de to 9347f8e Compare July 2, 2024 06:29
@serathius serathius marked this pull request as draft July 2, 2024 08:28
@ah8ad3 ah8ad3 force-pushed the robustness-test-watch-sequential branch from 9347f8e to caaf1f0 Compare July 2, 2024 13:10
@ah8ad3
Copy link
Contributor Author

ah8ad3 commented Jul 2, 2024

Printed the revisions it seems not checking revision 0 is not working here

    watch.go:150: Request revision: {Key: Revision:2 WithPrefix:true WithProgressNotify:true WithPrevKV:false}
    watch.go:150: Request revision: {Key: Revision:2 WithPrefix:true WithProgressNotify:true WithPrevKV:false}
    watch.go:150: Request revision: {Key: Revision:574 WithPrefix:true WithProgressNotify:true WithPrevKV:false}
    watch.go:150: Request revision: {Key: Revision:646 WithPrefix:true WithProgressNotify:true WithPrevKV:false}
    watch.go:150: Request revision: {Key: Revision:709 WithPrefix:true WithProgressNotify:true WithPrevKV:false}
    watch.go:150: Request revision: {Key: Revision:773 WithPrefix:true WithProgressNotify:true WithPrevKV:false}
    watch.go:150: Request revision: {Key: Revision:850 WithPrefix:true WithProgressNotify:true WithPrevKV:false}
    watch.go:150: Request revision: {Key: Revision:894 WithPrefix:true WithProgressNotify:true WithPrevKV:false}
    watch.go:150: Request revision: {Key: Revision:936 WithPrefix:true WithProgressNotify:true WithPrevKV:false}
    watch.go:150: Request revision: {Key: Revision:964 WithPrefix:true WithProgressNotify:true WithPrevKV:false}
    watch.go:150: Request revision: {Key: Revision:1036 WithPrefix:true WithProgressNotify:true WithPrevKV:false}
    watch.go:150: Request revision: {Key: Revision:1069 WithPrefix:true WithProgressNotify:true WithPrevKV:false}
    watch.go:150: Request revision: {Key: Revision:1092 WithPrefix:true WithProgressNotify:true WithPrevKV:false}
    watch.go:150: Request revision: {Key: Revision:2 WithPrefix:true WithProgressNotify:true WithPrevKV:false}

First one is 2 and revision is incremental.

@k8s-ci-robot k8s-ci-robot added size/M and removed size/S labels Jul 3, 2024
@ah8ad3
Copy link
Contributor Author

ah8ad3 commented Jul 3, 2024

Can you please take another look? @serathius

@serathius
Copy link
Member

Please rebase

ah8ad3 added 2 commits August 5, 2024 13:40
…ial to check memberID in events

Signed-off-by: ah8ad3 <[email protected]>
…revision based one time of response

Signed-off-by: ah8ad3 <[email protected]>
@ah8ad3 ah8ad3 force-pushed the robustness-test-watch-sequential branch from a6ec18c to f7c6c33 Compare August 5, 2024 10:11
@k8s-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: ah8ad3
Once this PR has been reviewed and has the lgtm label, please assign spzala for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ah8ad3
Copy link
Contributor Author

ah8ad3 commented Aug 5, 2024

Please rebase

Done, PTAL @serathius

At end i will squash.

for _, r := range reports {
for _, op := range r.Watch {
for _, resp := range op.Responses {
if len(resp.Events) == 0 {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to double check, but I think we could consider recording progress notify here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All the responses are aggregated here we can do.

for i, c := range combinedWatchResponses[resp.MemberId] {
// Reports are sorted by time, find first greater or equal and use previous one.
if resp.Time >= c.time {
if i == 0 {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why skip the first one?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for review, i'm using an logic here which is find the first equal or greater and use previous one. And there is nothing before 0.
And if i remember correctly we aggregate all responses here, and there is nothing before the first response.

if op.Request.Revision != 0 {
continue
}
for _, resp := range op.Responses {
Copy link
Member

@serathius serathius Aug 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if len(resp.Events) == 0 {
continue
}

if resp.Events[0].Revision < lastSeenRevision {
t.Errorf("Watch has gone back")
}
lastSeenRevision = resp.Events[len(resp.Events)-1].Revision

@k8s-ci-robot
Copy link

PR needs rebase.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Copy link

stale bot commented Apr 26, 2025

This issue has been automatically marked as stale because it has not had recent activity. It will be closed after 21 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Apr 26, 2025
Copy link

codecov bot commented Apr 26, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 0.00%. Comparing base (bb6ce78) to head (0302b16).
Report is 1197 commits behind head on main.

Current head 0302b16 differs from pull request most recent head f7c6c33

Please upload reports for the commit f7c6c33 to get more accurate results.

Additional details and impacted files
@@      Coverage Diff      @@
##   main   #18264   +/-   ##
=============================
=============================

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bb6ce78...f7c6c33. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

Test if watch is sequential
3 participants