Skip to content

Refactor waiting loop to use resourceVersion#1333

Merged
knative-prow-robot merged 5 commits intoknative:mainfrom
dsimansk:waiting-loop-refactor
Jul 1, 2021
Merged

Refactor waiting loop to use resourceVersion#1333
knative-prow-robot merged 5 commits intoknative:mainfrom
dsimansk:waiting-loop-refactor

Conversation

@dsimansk
Copy link
Copy Markdown
Contributor

Description

@rhuss per our conversation opening the PR with refactor of waiting loop. It was reverted before 0.23 release due to unstable tests probably cause by the changes.
#1321

Changes

  • Refactor waiting loop to use resourceVersion

Reference

Fixes #1287

@knative-prow-robot knative-prow-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 31, 2021
@google-cla google-cla bot added the cla: yes Indicates the PR's author has signed the CLA. label May 31, 2021
@knative-prow-robot knative-prow-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 31, 2021
Copy link
Copy Markdown
Contributor

@knative-prow-robot knative-prow-robot left a comment

Choose a reason for hiding this comment

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

@dsimansk: 4 warnings.

Details

In response to this:

Description

@rhuss per our conversation opening the PR with refactor of waiting loop. It was reverted before 0.23 release due to unstable tests probably cause by the changes.
#1321

Changes

  • Refactor waiting loop to use resourceVersion

Reference

Fixes #1287

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/test-infra repository.


// Wait until the expected EventDone is satisfied
func (w *waitForEvent) Wait(ctx context.Context, watcher watch.Interface, name string, options Options, msgCallback MessageCallback) (error, time.Duration) {
func (w *waitForEvent) Wait(ctx context.Context, name string, initialVersion string, options Options, msgCallback MessageCallback) (error, time.Duration) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Golint arg-order: error should be the last type when returning multiple items.

// msgCallback gets called for every event with an 'Ready' condition == UNKNOWN with the event's message.
func (w *waitForReadyConfig) Wait(ctx context.Context, watcher watch.Interface, name string, options Options, msgCallback MessageCallback) (error, time.Duration) {

func (w *waitForReadyConfig) Wait(ctx context.Context, name string, initialVersion string, options Options, msgCallback MessageCallback) (error, time.Duration) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Golint arg-order: error should be the last type when returning multiple items.

}

func TestWaitTimeout(t *testing.T) {
fakeWatchApi := NewFakeWatch([]watch.Event{})
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Golint naming: var fakeWatchApi should be fakeWatchAPI. More info.


func TestAddWaitForReadyWithChannelClose(t *testing.T) {
for i, tc := range prepareTestCases("test-service") {
fakeWatchApi := NewFakeWatch(tc.events)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Golint naming: var fakeWatchApi should be fakeWatchAPI. More info.

@knative-prow-robot knative-prow-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label May 31, 2021
@codecov
Copy link
Copy Markdown

codecov bot commented May 31, 2021

Codecov Report

Merging #1333 (5adb9c0) into main (a905959) will increase coverage by 0.28%.
The diff coverage is 78.72%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1333      +/-   ##
==========================================
+ Coverage   74.09%   74.37%   +0.28%     
==========================================
  Files         160      160              
  Lines        8202     8215      +13     
==========================================
+ Hits         6077     6110      +33     
+ Misses       1420     1402      -18     
+ Partials      705      703       -2     
Impacted Files Coverage Δ
pkg/wait/poll_watcher.go 55.07% <0.00%> (-0.81%) ⬇️
pkg/serving/v1/client.go 62.79% <64.70%> (+5.18%) ⬆️
pkg/eventing/v1/client.go 81.81% <100.00%> (+2.65%) ⬆️
pkg/serving/v1/client_mock.go 93.42% <100.00%> (+0.27%) ⬆️
pkg/wait/wait_for_ready.go 73.68% <100.00%> (+7.33%) ⬆️
pkg/wait/test_wait_helper.go 100.00% <0.00%> (+5.00%) ⬆️

Continue to review full report at Codecov.

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

@dsimansk
Copy link
Copy Markdown
Contributor Author

/test all

@rhuss
Copy link
Copy Markdown
Contributor

rhuss commented Jun 1, 2021

/retest

@rhuss
Copy link
Copy Markdown
Contributor

rhuss commented Jun 1, 2021

/test pull-knative-client-integration-tests
/test pull-knative-client-integration-tests-latest-release

2 similar comments
@rhuss
Copy link
Copy Markdown
Contributor

rhuss commented Jun 1, 2021

/test pull-knative-client-integration-tests
/test pull-knative-client-integration-tests-latest-release

@rhuss
Copy link
Copy Markdown
Contributor

rhuss commented Jun 1, 2021

/test pull-knative-client-integration-tests
/test pull-knative-client-integration-tests-latest-release

Copy link
Copy Markdown
Contributor

@maximilien maximilien left a comment

Choose a reason for hiding this comment

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

Ping me when you are ready for a second pair of eyes review on this. Best.

@rhuss
Copy link
Copy Markdown
Contributor

rhuss commented Jun 8, 2021

/test pull-knative-client-integration-tests
/test pull-knative-client-integration-tests-latest-release

@dsimansk
Copy link
Copy Markdown
Contributor Author

/retest

@navidshaikh
Copy link
Copy Markdown
Contributor

/assign @rhuss

@dsimansk
Copy link
Copy Markdown
Contributor Author

/test all

@rhuss
Copy link
Copy Markdown
Contributor

rhuss commented Jun 24, 2021

/retest

@dsimansk dsimansk force-pushed the waiting-loop-refactor branch from acc4baa to 8c57394 Compare June 25, 2021 12:58
@rhuss
Copy link
Copy Markdown
Contributor

rhuss commented Jun 28, 2021

@dsimansk any idea how we should proceed with this PR ? Do you remember the original error that we have observed ? Doesn't look like that it occurs very often ...

@rhuss
Copy link
Copy Markdown
Contributor

rhuss commented Jun 29, 2021

We decided in the WG call that we want to merge this or after the release, and then have 6 week time to detect and fix any potential issues that only occurred once in the past (not sure anymore whether this was a flake)

@dsimansk dsimansk force-pushed the waiting-loop-refactor branch from 8c57394 to 375fc85 Compare July 1, 2021 10:29
@dsimansk dsimansk changed the title WIP: Refactor waiting loop to use resourceVersion Refactor waiting loop to use resourceVersion Jul 1, 2021
@dsimansk
Copy link
Copy Markdown
Contributor Author

dsimansk commented Jul 1, 2021

/test all

@knative-prow-robot knative-prow-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 1, 2021
@dsimansk dsimansk force-pushed the waiting-loop-refactor branch from 7f3804f to 7aa1aee Compare July 1, 2021 11:38
@knative-prow-robot knative-prow-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Jul 1, 2021
@knative-metrics-robot
Copy link
Copy Markdown

The following is the coverage report on the affected files.
Say /test pull-knative-client-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/eventing/v1/client.go 85.8% 87.7% 1.9
pkg/serving/v1/client.go 69.3% 75.0% 5.7
pkg/serving/v1/client_mock.go 94.2% 94.4% 0.2
pkg/wait/wait_for_ready.go 76.1% 81.0% 4.9

Copy link
Copy Markdown
Contributor

@rhuss rhuss left a comment

Choose a reason for hiding this comment

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

Thanks !

Let's get the merged back in and watch the nightly builds

/lgtm
/approve

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Jul 1, 2021
@knative-prow-robot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dsimansk, rhuss

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

The pull request process is described here

Details 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

@knative-prow-robot knative-prow-robot merged commit 090ba0c into knative:main Jul 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cla: yes Indicates the PR's author has signed the CLA. lgtm Indicates that a PR is ready to be merged. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor watch functions to pass resourceVersion

6 participants