Fix broken eqErrGRPC helper function in integration tests#21131
Fix broken eqErrGRPC helper function in integration tests#21131zhijun42 wants to merge 1 commit into
eqErrGRPC helper function in integration tests#21131Conversation
|
Hi @zhijun42. Thanks for your PR. I'm waiting for a etcd-io member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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. |
65eb175 to
5b83768
Compare
5b83768 to
bfa1b9c
Compare
|
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed after 21 days if no further activity occurs. Thank you for your contributions. |
|
/ok-to-test |
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted filessee 20 files with indirect coverage changes @@ Coverage Diff @@
## main #21131 +/- ##
==========================================
- Coverage 70.27% 70.25% -0.02%
==========================================
Files 426 426
Lines 35215 35215
==========================================
- Hits 24747 24740 -7
- Misses 9072 9082 +10
+ Partials 1396 1393 -3 Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
b9d5128 to
3ea5465
Compare
|
/retest-required |
|
/retest |
|
@serathius All tests pass now. As I was fixing the CI, I found many more pre-existing bugs masked by the broken |
|
Can you resolve merge conflict? |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: serathius, zhijun42 The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
| presp, perr := clus.Client(0).Put(t.Context(), "abc", "aaa") | ||
| if perr != nil { | ||
| if eqErrGRPC(perr, rpctypes.ErrCorrupt) { | ||
| if errors.Is(perr, rpctypes.ErrCorrupt) { |
There was a problem hiding this comment.
not sure why change it? errors.Is might be doing almost the same thing as the new implementation of eqErrGRPC, but not sure if there are any differences.
There was a problem hiding this comment.
Yeah good catch! You're right, it's not really needed. Cleaned these up.
Signed-off-by: Zhijun <dszhijun@gmail.com> Further simplify code Signed-off-by: Zhijun <dszhijun@gmail.com> Undo TestV3CorruptAlarm changes Signed-off-by: Zhijun <dszhijun@gmail.com>
The test helper function
eqErrGRPChas always been flawed since introduced in 2016.When the first argument was non-nil (usually the case in tests), it will always return true. This has made all error assertions using this helper effectively no-ops.
Changes:
status.FromError()rpctypes.EtcdErrorsoeqErrGRPCworks in grpcproxy mode whereToGRPCadapters bypass the gRPC wirePre-existing test bugs exposed by the fix:
TestV3PutIgnoreValue: sentIgnoreValue=truewith a non-emptyValuefield, causingErrGRPCValueProvidedinstead of the expectedErrGRPCKeyNotFound. Fixed by clearingValue.TestV3TooLargeRequest: sent a 2MB value which exceeded the gRPCMaxRecvMsgSize(MaxRequestBytes1.5MB + 512KB overhead = 2MB), causing gRPCResourceExhaustedinstead of etcd'sErrGRPCRequestTooLarge. Fixed by reducing the value size to stay under the gRPC transport limit.TestV3LeaseRecoverKeyWithMultipleLease: after server restart,leaseExist()used the old client which hadn't reconnected yet. The brokeneqErrGRPCmasked the connection error by returning true. Fixed by addingWaitStartedto ensure client connectivity before checking leases.TestV3LargeRequests: skipped in grpcproxy mode as the proxy does not propagate customMaxRequestBytesto its internal gRPC client connection.