Skip to content
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

Wait for events with poll interval after finished event received #7668

Merged
merged 5 commits into from
Feb 14, 2024

Conversation

mgencur
Copy link
Contributor

@mgencur mgencur commented Feb 12, 2024

When "Finished" event is received in upgrade tests, check the number of received events periodically until a timeout is reached. This has two advantages:

  • When all events are delivered quickly, the receiver will wait for a very short time instead of the fixed timeout
  • When events get stuck in the system-under-test, the timeout can be much longer (e.g. 10 minutes) and the receiver will be able to wait for the events before timing out. These cases are rare.

Proposed Changes

  • Introduce interval property for the receiver which can be set like this (default is 1 second):
[receiver]
[receiver.teardown]
# 20 seconds
duration = 20000000000
# 1 second
interval = 1000000000
  • The receiver will poll the received events with given interval until the timeout is reached. The poll starts when the "finished" event is received.
  • Change default timeout to 60 seconds.

Pre-review Checklist

  • At least 80% unit test coverage
  • E2E tests for any new behavior
  • Docs PR for any user-facing impact
  • Spec PR for any new API feature
  • Conformance test for any change to the spec

Release Note


Docs

@knative-prow knative-prow bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. area/test-and-release Test infrastructure, tests or release labels Feb 12, 2024
Copy link

codecov bot commented Feb 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (6f2eaed) 73.98% compared to head (08c0540) 73.98%.
Report is 4 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #7668   +/-   ##
=======================================
  Coverage   73.98%   73.98%           
=======================================
  Files         262      262           
  Lines       15178    15178           
=======================================
  Hits        11229    11229           
  Misses       3343     3343           
  Partials      606      606           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mgencur mgencur changed the title [WIP] Wait for events with poll interval after finished event received Wait for events with poll interval after finished event received Feb 12, 2024
@knative-prow knative-prow bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Feb 12, 2024
@mgencur mgencur changed the title Wait for events with poll interval after finished event received [WIP] Wait for events with poll interval after finished event received Feb 12, 2024
@knative-prow knative-prow bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Feb 12, 2024
@mgencur mgencur changed the title [WIP] Wait for events with poll interval after finished event received Wait for events with poll interval after finished event received Feb 12, 2024
@knative-prow knative-prow bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Feb 12, 2024
@Cali0707 Cali0707 self-requested a review February 14, 2024 03:39
Copy link
Member

@matzew matzew left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@knative-prow knative-prow bot added the lgtm Indicates that a PR is ready to be merged. label Feb 14, 2024
Copy link

knative-prow bot commented Feb 14, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: matzew, mgencur

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

The pull request process is described 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

@knative-prow knative-prow bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 14, 2024
@knative-prow knative-prow bot merged commit eac7384 into knative:main Feb 14, 2024
37 of 39 checks passed
mgencur added a commit to mgencur/eventing that referenced this pull request Feb 15, 2024
…tive#7668)

* Wait for events with poll interval after finished event received

* Use PollUntilContextCancel

* Change default timeout to 30 seconds

* Call cancel

* Simplify
mgencur added a commit to mgencur/eventing that referenced this pull request Feb 15, 2024
…tive#7668)

* Wait for events with poll interval after finished event received

* Use PollUntilContextCancel

* Change default timeout to 30 seconds

* Call cancel

* Simplify
openshift-merge-bot bot pushed a commit to openshift-knative/eventing that referenced this pull request Feb 20, 2024
…tive#7668) (#530)

* Wait for events with poll interval after finished event received (knative#7668)

* Wait for events with poll interval after finished event received

* Use PollUntilContextCancel

* Change default timeout to 30 seconds

* Call cancel

* Simplify

* Use wait.PollImmediate

The function PollUntilContextTimeout is not yet available in
k8s.io/apimachinery v0.26.5
openshift-cherrypick-robot pushed a commit to openshift-cherrypick-robot/knative-eventing that referenced this pull request Feb 20, 2024
…tive#7668)

* Wait for events with poll interval after finished event received

* Use PollUntilContextCancel

* Change default timeout to 30 seconds

* Call cancel

* Simplify
openshift-merge-bot bot pushed a commit to openshift-knative/eventing that referenced this pull request Feb 28, 2024
…nt received (knative#7668) (#540)

* Wait for events with poll interval after finished event received (knative#7668)

* Wait for events with poll interval after finished event received

* Use PollUntilContextCancel

* Change default timeout to 30 seconds

* Call cancel

* Simplify

* Use wait.PollImmediate

The function PollUntilContextTimeout is not yet available in
k8s.io/apimachinery v0.26.5

---------

Co-authored-by: Martin Gencur <mgencur@redhat.com>
pierDipi pushed a commit to pierDipi/eventing that referenced this pull request Mar 28, 2024
…tive#7668)

* Wait for events with poll interval after finished event received

* Use PollUntilContextCancel

* Change default timeout to 30 seconds

* Call cancel

* Simplify
openshift-merge-bot bot pushed a commit to openshift-knative/eventing that referenced this pull request Apr 2, 2024
…nt received (knative#7668) (#580)

* Wait for events with poll interval after finished event received (knative#7668)

* Wait for events with poll interval after finished event received

* Use PollUntilContextCancel

* Change default timeout to 30 seconds

* Call cancel

* Simplify

* wathola receiver, annotate span by step number (knative#7667)

wathole receiver, annotate span by step number

---------

Co-authored-by: Martin Gencur <mgencur@redhat.com>
Co-authored-by: Marek Schmidt <maschmid@redhat.com>
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. area/test-and-release Test infrastructure, tests or release lgtm Indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants