etcd icon indicating copy to clipboard operation
etcd copied to clipboard

validate: Refactor linearization handling and visualization in operations.go

Open VidhuSarwal opened this issue 1 year ago • 13 comments

Closes #19089

Changes made: Refactored operations.go

  • Refactored the validateLinearizableOperationsAndVisualize function
  • Eliminated the anonymous function for visualization.
  • Introduced a Results struct to store LinearizationInfo, Model, and the logger.
  • The Results struct simplifies the code by removing the need to pass these components separately.

VidhuSarwal avatar Dec 20 '24 14:12 VidhuSarwal

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: VidhuSarwal 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

k8s-ci-robot avatar Dec 20 '24 14:12 k8s-ci-robot

Hi @VidhuSarwal. 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.

k8s-ci-robot avatar Dec 20 '24 14:12 k8s-ci-robot

/ok-to-test

serathius avatar Dec 21 '24 08:12 serathius

High level looks good, just couple of nits.

serathius avatar Dec 21 '24 08:12 serathius

Tests failed with stderr: robustness/validate/operations.go:36:18: undefined: porcupine.LinearizationInfo

Think you need to upgrade the porcupine version.

serathius avatar Dec 21 '24 08:12 serathius

updated porcupine to v1.0.0, Made the change in go.mod (bumped the version number) ran go mod tidy and now getting these errors.

test like pull-etcd-e2e-arm64 suggests go.sum entry is missing, but go.sum did make it (evident in changes) so not able to understand what exact issue is. Even manually ran go get github.com/anishathalye/[email protected]

Also one test (robustness) suggests I update the test file to the new return type of ValidateAndReturnVisualize (result struct)

VidhuSarwal avatar Dec 21 '24 10:12 VidhuSarwal

Codecov Report

:white_check_mark: All modified and coverable lines are covered by tests. :white_check_mark: Project coverage is 68.81%. Comparing base (9fa35e5) to head (e451f4f). :warning: Report is 1382 commits behind head on main.

Additional details and impacted files

see 25 files with indirect coverage changes

@@            Coverage Diff             @@
##             main   #19094      +/-   ##
==========================================
- Coverage   68.85%   68.81%   -0.04%     
==========================================
  Files         420      420              
  Lines       35642    35642              
==========================================
- Hits        24541    24527      -14     
- Misses       9676     9689      +13     
- Partials     1425     1426       +1     

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 9fa35e5...e451f4f. Read the comment docs.

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

codecov[bot] avatar Dec 21 '24 10:12 codecov[bot]

updated porcupine to v1.0.0, Made the change in go.mod (bumped the version number) ran go mod tidy and now getting these errors.

test like pull-etcd-e2e-arm64 suggests go.sum entry is missing, but go.sum did make it (evident in changes) so not able to understand what exact issue is. Even manually ran go get github.com/anishathalye/[email protected]

Also one test (robustness) suggests I update the test file to the new return type of ValidateAndReturnVisualize (result struct)

I think main_test.go needs a small update as follows since the return type of ValidateAndReturnVisualize is changed. After applying the following change make test-robustness passed in my local.

git diff
diff --git a/tests/robustness/main_test.go b/tests/robustness/main_test.go
index 32e032838..345fe7957 100644
--- a/tests/robustness/main_test.go
+++ b/tests/robustness/main_test.go
@@ -103,7 +103,7 @@ func testRobustness(ctx context.Context, t *testing.T, lg *zap.Logger, s scenari
                client.ValidateGotAtLeastOneProgressNotify(t, r.Client, s.Watch.RequestProgress || watchProgressNotifyEnabled)
        }
        validateConfig := validate.Config{ExpectRevisionUnique: s.Traffic.ExpectUniqueRevision()}
-       r.Visualize = validate.ValidateAndReturnVisualize(t, lg, validateConfig, r.Client, persistedRequests, 5*time.Minute)
+       r.Visualize = validate.ValidateAndReturnVisualize(t, lg, validateConfig, r.Client, persistedRequests, 5*time.Minute).Visualize

        panicked = false
 }

jmao-dd avatar Jan 03 '25 02:01 jmao-dd

@VidhuSarwal Can you fix the PR so the test pass?

serathius avatar Jan 20 '25 09:01 serathius

@VidhuSarwal Can you fix the PR so the test pass?

Sure, Working on it.

VidhuSarwal avatar Jan 20 '25 09:01 VidhuSarwal

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.

k8s-ci-robot avatar Feb 06 '25 05:02 k8s-ci-robot

This pull request 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.

github-actions[bot] avatar May 17 '25 00:05 github-actions[bot]

@VidhuSarwal: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-etcd-verify e451f4feb48395cac1a6d2b168e0dff0e659d77e link true /test pull-etcd-verify
pull-etcd-robustness-arm64 e451f4feb48395cac1a6d2b168e0dff0e659d77e link true /test pull-etcd-robustness-arm64
pull-etcd-unit-test-386 e451f4feb48395cac1a6d2b168e0dff0e659d77e link true /test pull-etcd-unit-test-386
pull-etcd-unit-test-arm64 e451f4feb48395cac1a6d2b168e0dff0e659d77e link true /test pull-etcd-unit-test-arm64
pull-etcd-unit-test-amd64 e451f4feb48395cac1a6d2b168e0dff0e659d77e link true /test pull-etcd-unit-test-amd64
pull-etcd-robustness-amd64 e451f4feb48395cac1a6d2b168e0dff0e659d77e link true /test pull-etcd-robustness-amd64
pull-etcd-integration-1-cpu-amd64 e451f4feb48395cac1a6d2b168e0dff0e659d77e link true /test pull-etcd-integration-1-cpu-amd64
ci-etcd-robustness-release36-amd64 e451f4feb48395cac1a6d2b168e0dff0e659d77e link true /test ci-etcd-robustness-release36-amd64
ci-etcd-robustness-release35-amd64 e451f4feb48395cac1a6d2b168e0dff0e659d77e link true /test ci-etcd-robustness-release35-amd64
ci-etcd-robustness-release34-amd64 e451f4feb48395cac1a6d2b168e0dff0e659d77e link true /test ci-etcd-robustness-release34-amd64
pull-etcd-govulncheck-main e451f4feb48395cac1a6d2b168e0dff0e659d77e link true /test pull-etcd-govulncheck-main

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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. I understand the commands that are listed here.

k8s-ci-robot avatar Jun 13 '25 19:06 k8s-ci-robot

This pull request 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.

github-actions[bot] avatar Aug 13 '25 00:08 github-actions[bot]