Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Run HTTPS E2E tests only when HTTPS endpoint is ready#16230

Merged
knative-prow[bot] merged 1 commit intoknative:mainfrom
linkvt:fix-flaky-https-tests
Nov 17, 2025
Merged

Run HTTPS E2E tests only when HTTPS endpoint is ready#16230
knative-prow[bot] merged 1 commit intoknative:mainfrom
linkvt:fix-flaky-https-tests

Conversation

@linkvt
Copy link
Contributor

@linkvt linkvt commented Nov 12, 2025

Fixes #14435

Proposed Changes

  • Wait for the HTTPS endpoint to be available to avoid flaky HTTPS E2E tests
    • KSvc is marked as Ready when the HTTP endpoint is available, even if the HTTPS endpoint is not Ready yet due to cert-manager being slow/under load
    • E2E tests start producing load on the HTTP endpoint
    • when the Certificate is Ready, KSvc becomes Ready and the HTTPS endpoint is set in the status
    • Switch to HTTPS is not as graceful as it seems when Istio creates a Gateway for access from external via HTTPS

Testing

I tried to reproduce it locally but didn't see the exact error message. I was able get similar ones though by replicating the E2E environment, scale cert-manager to 0, start the test and scale cert-manager up again after ~10sec or when the logs show errors (happens only in the unfixed code).
Requirement to test is a config-network like this and an appropriate cert-manager setup as in the E2E tests which is quite complicated, let me know if you need it.

apiVersion: v1
kind: ConfigMap
metadata:
  name: config-network
  namespace: knative-serving
data:
  autocreate-cluster-domain-claims: "true"
  cluster-local-domain-tls: Disabled
  external-domain-tls: Enabled
  system-internal-tls: Disabled

I also thought about adding some kind of polling to start the tests only when the first HTTPS request was successful, I'll add it in case this PR is not enough.

Release Note

Fix flaky HTTPS e2e tests by waiting for HTTPS endpoint to be Ready.

@knative-prow knative-prow bot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Nov 12, 2025
@linkvt
Copy link
Contributor Author

linkvt commented Nov 12, 2025

/remove-approve

@knative-prow knative-prow bot removed the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 12, 2025
@codecov
Copy link

codecov bot commented Nov 12, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.04%. Comparing base (92e5880) to head (bd64903).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #16230   +/-   ##
=======================================
  Coverage   80.04%   80.04%           
=======================================
  Files         214      214           
  Lines       13313    13313           
=======================================
  Hits        10657    10657           
+ Misses       2297     2296    -1     
- Partials      359      360    +1     

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

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

@dprotaso
Copy link
Member

/test https

@dprotaso
Copy link
Member

Should we simplify this and just have IsServiceReady wait for the https scheme in the URL when the HTTPS flag is true?

@linkvt linkvt force-pushed the fix-flaky-https-tests branch from 002c7c8 to 2b90e99 Compare November 17, 2025 08:13
@knative-prow knative-prow bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Nov 17, 2025
@linkvt linkvt force-pushed the fix-flaky-https-tests branch from 2b90e99 to 0957cb3 Compare November 17, 2025 08:15
@linkvt linkvt force-pushed the fix-flaky-https-tests branch from 0957cb3 to bd64903 Compare November 17, 2025 08:17
@linkvt
Copy link
Contributor Author

linkvt commented Nov 17, 2025

Should we simplify this and just have IsServiceReady wait for the https scheme in the URL when the HTTPS flag is true?

Makes sense, just realized test isn't just scoped to the test function...
PTAL

@linkvt
Copy link
Contributor Author

linkvt commented Nov 17, 2025

/retest

@dprotaso
Copy link
Member

/lgtm
/approve

@knative-prow knative-prow bot added the lgtm Indicates that a PR is ready to be merged. label Nov 17, 2025
@knative-prow
Copy link

knative-prow bot commented Nov 17, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dprotaso

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 knative-prow bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 17, 2025
@knative-prow knative-prow bot merged commit f09b209 into knative:main Nov 17, 2025
154 of 155 checks passed
@linkvt linkvt deleted the fix-flaky-https-tests branch November 17, 2025 23:05
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/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.

HTTPS tests are flakey

2 participants