Skip to content

Conversation

@TaranpreetNatt
Copy link

@TaranpreetNatt TaranpreetNatt commented Aug 23, 2025

What type of PR is this?
/kind test
/area conformance-test

What this PR does / why we need it:
Adds conformance tests for GRPCRoute request mirroring functionality to enable gradual implementation support across Gateway API implementations.

Which issue(s) this PR fixes:
Fixes #3514

Does this PR introduce a user-facing change?:

NONE

@k8s-ci-robot k8s-ci-robot added kind/test do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. area/conformance-test Issues or PRs related to Conformance tests. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Aug 23, 2025
@k8s-ci-robot
Copy link
Contributor

Welcome @TaranpreetNatt!

It looks like this is your first PR to kubernetes-sigs/gateway-api 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/gateway-api has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Aug 23, 2025
@k8s-ci-robot
Copy link
Contributor

Hi @TaranpreetNatt. Thanks for your PR.

I'm waiting for a kubernetes-sigs 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.

Details

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.

@TaranpreetNatt
Copy link
Author

/release-note-none

@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Aug 23, 2025
@LiorLieberman
Copy link
Member

/ok-to-test
/cc

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Sep 2, 2025
Copy link
Member

@LiorLieberman LiorLieberman left a comment

Choose a reason for hiding this comment

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

Thanks!

Copy link
Member

Choose a reason for hiding this comment

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

can you also add a test under conformance/tests/mesh?

Copy link
Author

Choose a reason for hiding this comment

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

Sure, I can look into it

Copy link
Author

@TaranpreetNatt TaranpreetNatt Sep 4, 2025

Choose a reason for hiding this comment

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

Hey Lior, I tried to implement gRPC conformance tests under mesh, but I ran into some issues that aren't trivial for me to solve. I encountered the following issues below and what I tried. Maybe my approach is wrong? Is this needed for this issue and PR?

  1. There is no method in the MeshPod struct to make a gRPC call to the other mesh pod. Looking at what the HTTP MakeRequestAndExpectEventuallyConsistentResponse does, it's essentially running a command on the MeshPod using the client.
  2. When I tried to replicate that behaviour for gRPC, I got the following. Main issue is the unknown service.

`application@echo-v1-699dd9bfc7-5rxvl:/$ client --http2 -H "content-type: application/grpc" --method=POST http://echo:7070/gateway_api_conformance.echo_basic.grpcecho.GrpcEcho/Echo
[0] Url=http://echo:7070/gateway_api_conformance.echo_basic.grpcecho.GrpcEcho/Echo
[0] Header=content-type:application/grpc
[0] Latency=24.388708ms
[0] ActiveRequests=1
[0] StatusCode=200
[0] ResponseHeader=Content-Type:application/grpc
[0] ResponseHeader=Grpc-Message:unknown service gateway_api_conformance.echo_basic.grpcecho.GrpcEcho
[0] ResponseHeader=Grpc-Status:12

2025-09-04T09:05:37.461782Z info All requests succeeded`

Copy link
Member

Choose a reason for hiding this comment

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

Thanks, this slipped out of my radar. Sorry!

Can you take a look at https://github.com/kubernetes-sigs/gateway-api/blob/main/conformance/tests/mesh/grpcroute-weight.go#L34-L84

I think it does the grpc call you need

Copy link
Author

Choose a reason for hiding this comment

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

Okay, I'll take a look this weekend.

@LiorLieberman
Copy link
Member

now I see that we already have a PR open for that -- #4013

…en HTTP and GRPC

Makes the HTTP mirror validation function configurable with a logPattern
parameter so it can be reused by gRPC tests, eliminating code duplication.

  - Parameterize logPattern in HTTP ExpectMirroredRequest
  - Update gRPC to use shared function with gRPC-specific pattern
  - Remove duplicate grpc/mirror.go implementation
  - Make error messages protocol-agnostic

  Addresses reviewer feedback in PR kubernetes-sigs#4015.
@TaranpreetNatt
Copy link
Author

now I see that we already have a PR open for that -- #4013

How does it work when two PRs are open for the same issue?

@LiorLieberman
Copy link
Member

now I see that we already have a PR open for that -- #4013

How does it work when two PRs are open for the same issue?

We usually go by who picked up the issue first. And it looks like you did. I will post a comment on the other PR to hold in the meatime, but this PR is good to continue.

@TaranpreetNatt
Copy link
Author

Sounds good, is there anything left on this PR you would like me to get done?

@TaranpreetNatt
Copy link
Author

Hi @LiorLieberman, Is there anything left to do in this PR you would like me to get done? I left a comment about the mesh tests as well.

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 4, 2025
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Nov 5, 2025
)

func ExpectMirroredRequest(t *testing.T, client client.Client, clientset clientset.Interface, mirrorPods []MirroredBackend, path string, timeoutConfig config.TimeoutConfig) {
func ExpectMirroredRequest(t *testing.T, client client.Client, clientset clientset.Interface, mirrorPods []MirroredBackend, logPattern string, timeoutConfig config.TimeoutConfig) {
Copy link
Member

Choose a reason for hiding this comment

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

Dont we have other occasions where ExpectMirroredRequest is called and would need to be changed? Can we instead have in the function a logic to determine if its grpc or http and validate based on this?

Copy link
Author

Choose a reason for hiding this comment

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

I changed the approach here. Writing the logic inside the http.ExpectMirroredRequest worked but it was messy and the code was confusing. Instead I extracted the common logic into ExpectMirroredRequestWithPattern and wrapped the http.ExpectMirroredRequest and grpc.ExpectMirroredRequest to call ExpectMirroredRequestWithPattern. This way we keep the same function signature and we aren't using the http package in grpc tests.

TaranpreetNatt and others added 3 commits January 21, 2026 20:59
…ences

- Add http.ExpectMirroredRequestWithPattern() with shared validation
logic
- Both protocols now share the same core validation: goroutine spawning,
log reading, regex matching, and error handling
@TaranpreetNatt TaranpreetNatt force-pushed the tests/add-grpcRoute-coverage-in-request-mirror-tests branch from 14ea540 to 36e5a4d Compare January 22, 2026 05:00
@LiorLieberman
Copy link
Member

/retest

@LiorLieberman
Copy link
Member

/lgtm
/approve

Thanks @TaranpreetNatt !!

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 22, 2026
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: LiorLieberman, TaranpreetNatt
Once this PR has been reviewed and has the lgtm label, please assign shaneutt for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

@TaranpreetNatt
Copy link
Author

/assign @shaneutt

@@ -0,0 +1,113 @@
/*
Copyright 2025 The Kubernetes Authors.
Copy link
Member

Choose a reason for hiding this comment

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

2026

)

func ExpectMirroredRequest(t *testing.T, client client.Client, clientset clientset.Interface, mirrorPods []MirroredBackend, path string, timeoutConfig config.TimeoutConfig) {
logPattern := fmt.Sprintf("Echoing back request made t \\%s to client", path)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
logPattern := fmt.Sprintf("Echoing back request made t \\%s to client", path)
logPattern := fmt.Sprintf("Echoing back request made to \\%s to client", path)

@LiorLieberman
Copy link
Member

actually, did you get to handle this comment? https://github.com/kubernetes-sigs/gateway-api/pull/4015/files#r2317173510

Adding the mesh tests?

/hold

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 23, 2026
@TaranpreetNatt
Copy link
Author

actually, did you get to handle this comment? https://github.com/kubernetes-sigs/gateway-api/pull/4015/files#r2317173510

Adding the mesh tests?

/hold

I'll take a look

Copy link
Member

@LiorLieberman LiorLieberman left a comment

Choose a reason for hiding this comment

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

Also, just tested locally with istio and it fails

grpc.go:333: 2026-01-23T19:13:20.719413473Z: Response expectation failed for request: {<nil>  <nil> 0xc000eba258 {OK 0xc0000aaf48 <nil> <nil> [X-Header-Remove]} grpc-infra-backend-v1 gateway-conformance-infra [{{grpc-infra-backend-v2 gateway-conformance-infra} <nil>}] }  not ready yet: expected pod name to start with grpc-infra-backend-v1, got grpc-infra-backend-v2-5d756c89dd-rtlbv (after 29.085549379s)

will be great if you can fix it, run it and report back

@LiorLieberman
Copy link
Member

/lgtm cancel

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 23, 2026
@TaranpreetNatt
Copy link
Author

Also, just tested locally with istio and it fails

grpc.go:333: 2026-01-23T19:13:20.719413473Z: Response expectation failed for request: {<nil>  <nil> 0xc000eba258 {OK 0xc0000aaf48 <nil> <nil> [X-Header-Remove]} grpc-infra-backend-v1 gateway-conformance-infra [{{grpc-infra-backend-v2 gateway-conformance-infra} <nil>}] }  not ready yet: expected pod name to start with grpc-infra-backend-v1, got grpc-infra-backend-v2-5d756c89dd-rtlbv (after 29.085549379s)

will be great if you can fix it, run it and report back

Okay, I'll take a look at this as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/conformance-test Issues or PRs related to Conformance tests. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. kind/test ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add GRPCRoute coverage in request-mirror tests

4 participants