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

Refactor Retry-After backoff tests #5981

Conversation

travis-minke-sap
Copy link
Contributor

Fixes #5967 #5968 #5969

The original implementation used a test http server to validate the timing between successive requests in order to validate the correct backoff calculation. This is rather heavy-weight, and as we've seen is very timing dependent. Overall the test is sound and on consistent/fast hardware runs reliably, but was complicated to understand and brittle on slower/inconsistent hardware.

This most recent flakiness could easily be resolved by adjusting the test's timings to provide a larger buffer to allow for slower runtimes, but there will always be an inherent "limit" at which test slowness will cause a failure. Further this results in the tests themselves taking longer.

Therefore, I am rewriting the test in a (hopefully) simpler fashion. The new test is directly verifying the backoff calculation and skips the eventing sending aspect. This should make them easier to understand and maintain, faster to execute, and no longer subject to slow execution failures (flaky-ness)

The diff is a confusing mess due to overlap with old implementation and I would recommend reviewing the new test on it's own - up to you though ; )

Proposed Changes

  • 🧹 Refactor the Retry-After header backoff test.

Pre-review Checklist

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

Release Note


Docs

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

codecov bot commented Dec 7, 2021

Codecov Report

Merging #5981 (49e0ad3) into main (e00a9f4) will decrease coverage by 0.02%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #5981      +/-   ##
==========================================
- Coverage   82.33%   82.31%   -0.03%     
==========================================
  Files         220      220              
  Lines        7564     7564              
==========================================
- Hits         6228     6226       -2     
- Misses        902      903       +1     
- Partials      434      435       +1     
Impacted Files Coverage Δ
pkg/kncloudevents/message_sender.go 86.27% <0.00%> (-3.93%) ⬇️

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 e00a9f4...49e0ad3. Read the comment docs.

@matzew
Copy link
Member

matzew commented Dec 8, 2021

/test all

@knative-metrics-robot
Copy link

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

File Old Coverage New Coverage Delta
pkg/kncloudevents/message_sender.go 92.5% 90.0% -2.5

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-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Dec 8, 2021
@knative-prow-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: matzew, travis-minke-sap

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-robot knative-prow-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 8, 2021
@matzew
Copy link
Member

matzew commented Dec 8, 2021

SourceToSinkWithDLQ

that is a flake from @gabo1208 's PR

/retest

@matzew
Copy link
Member

matzew commented Dec 8, 2021 via email

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. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
4 participants