[tests] Convert core e2e tests to gtest - #32603
Conversation
Automated fix for refs/heads/leaping-lizards
Automated fix for refs/heads/leaping-lizards
Automated fix for refs/heads/leaping-lizards
Automated fix for refs/heads/leaping-lizards
| CoreEnd2endTest::IncomingMessage client_message; | ||
| s.NewBatch(102) | ||
| .SendInitialMetadata({{"key3", "val3"}, {"key4", "val4"}}) | ||
| .RecvMessage(client_message); |
There was a problem hiding this comment.
I think this is just me unfamiliar with the test or how gRPC works and probably unrelated to this change. Is there any difference between checking the payload of the client_message right after the next Step() on line 49 or checking it at the end?
Is it more correct to check it right after the next Step() which completes this batch?
There was a problem hiding this comment.
I think we'd like to move these to just after the Step() function as soon as we can. It'd be better than what's here now. I avoided doing so because the earlier code didn't (mostly because it was easier to write the C89 at the time), and keeping that bit consistent made my first round of checking I'd gotten everything right a bit easier.
| .Set(GRPC_ARG_INITIAL_RECONNECT_BACKOFF_MS, 1000) | ||
| .Set(GRPC_ARG_MAX_RECONNECT_BACKOFF_MS, 1000) | ||
| .Set(GRPC_ARG_MIN_RECONNECT_BACKOFF_MS, 5000)); | ||
| SimpleDelayedRequestBody(*this); |
There was a problem hiding this comment.
Missed a comment // This timeout should be longer than a single retry; but aren't these 2 tests exactly the same? Should we remove one?
There was a problem hiding this comment.
There's a benefit for clearer code!
| grpc_core::CqVerifier::Maybe{&seen_status}); | ||
| cqv->Expect(grpc_core::CqVerifier::tag(104), true); | ||
| cqv->Verify(); | ||
| test.Expect(1, CoreEnd2endTest::Maybe{&seen_status}); |
There was a problem hiding this comment.
This should be CqVerifier::Maybe{&seen_status} no?
There was a problem hiding this comment.
CoreEnd2endTest aliases all of these, so we should use the alias. I expect to remove those aliases 'sometime' - but not sure how that plays out just yet.
| } | ||
|
|
||
| void resource_quota_server(const CoreTestConfiguration& config) { | ||
| TEST_P(ResourceQuotaTest, ResourceQuota) { |
There was a problem hiding this comment.
There seems to be some changes to the configuration, e.g. kNumCalls from 100 -> 8, resource quota from 5MiB to 1MiB. Are these intended?
There was a problem hiding this comment.
Yeah, we'd turned off the test for epoll1 a few years ago, effectively removing most of our coverage. I tuned down the values but ensured we were hitting the coverage we needed.
| GPR_ASSERT(GRPC_CALL_OK == grpc_call_cancel(c, nullptr)); | ||
| error = grpc_call_start_batch(c->c_call(), ops, static_cast<size_t>(op - ops), | ||
| CqVerifier::tag(1), nullptr); | ||
| EXPECT_EQ(call_start_batch_expected_result, error); |
There was a problem hiding this comment.
Maybe EXPECT_EQ(error, call_start_batch_expected_result); (i.e. EXPECT_EQ(actual, expected) seems more natural?)
| error = grpc_call_start_batch(c->c_call(), ops, static_cast<size_t>(op - ops), | ||
| CqVerifier::tag(1), nullptr); | ||
| EXPECT_EQ(call_start_batch_expected_result, error); | ||
| if (error == GRPC_CALL_OK) { |
There was a problem hiding this comment.
The original code this seems to be if (expectation == GRPC_CALL_OK) {. Not sure if there is any difference though.
There was a problem hiding this comment.
i think it's the same, and that this is more clear
| cqv.Verify(); | ||
| CoreEnd2endTest::IncomingStatusOnClient server_status; | ||
| CoreEnd2endTest::IncomingMetadata server_initial_metadata; | ||
| c.NewBatch(1) |
There was a problem hiding this comment.
On line 48 server's batch 102 has a RecvCloseOnServer op, but there is no SendCloseFromClient op here. Does it get send internally?
There was a problem hiding this comment.
it does not, but in this test we rely on the server to finish the call without the client doing so
|
|
||
| void no_op_pre_init(void) {} | ||
| namespace grpc_core { | ||
| TEST_P(CoreEnd2endTest, NoOp) {} |
|
This PR disabled the EventEngine experiment tests, which were previously enabled for all I see a few options with this new test structure:
(1) seems the most palatable to me because it keeps all test configurations declarative. The other options move a declarative experiment configuration into code, which is not great. Option (3) can easily become a mess of conditions around every test (or a map of tests to experiments, like we had before this PR). Option (4) seems the next most palatable to me, but the code will contain a lot of boilerplate The previous configuration which was nuked: |
|
Messaged you on chat, but to repeat here: I think (3) via feature flags, or (4) - I don't want to return to a place where we're managing 40-ish different binaries each with customized main functions as implied by (1) or (2). As much as possible we should choose to machine generate our build configuration and keep customization points in code. |
It already started hitting the limit resulting in continuous failure. #32603 is believed to contribute to this time increase but let's bump it first and visit this issue later.
Implement listeners, connection, endpoints for `FuzzingEventEngine`. Allows the fuzzer to select write sizes and delays, connection delays, and port assignments. I made a few modifications to the test suite to admit this event engine to pass the client & server tests: 1. the test factories return shared_ptr<> to admit us to return the same event engine for both the oracle and the implementation - necessary because FuzzingEventEngine forms a closed world of addresses & ports. 2. removed the WaitForSingleOwner calls - these seem unnecessary, and we don't ask our users to do this - tested existing linux tests 1000x across debug, asan, tsan with this change Additionally, the event engine overrides the global port picker logic so that port assignments are made by the fuzzer too. This PR is a step along a longer journey, and has some outstanding brethren PR's, and some follow-up work: * grpc#32603 will convert all the core e2e tests into a more malleable form * we'll then use grpc#32667 to turn all of these into fuzzers * finally we'll integrate this into that work and turn all core e2e tests into fuzzers over timer & callback reorderings and io size/spacings --------- Co-authored-by: ctiller <ctiller@users.noreply.github.com>
Discovered testing grpc#32603 <!-- If you know who should review your pull request, please assign it to that person, otherwise the pull request would get assigned randomly. If your pull request is for a specific language, please add the appropriate lang label. -->
Notes: - `+trace` fixtures haven't run since 2016, so they're disabled for now (grpc@7ad2d0b#diff-780fce7267c34170c1d0ea15cc9f65a7f4b79fefe955d185c44e8b3251cf9e38R76) - all current fixtures define `FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER` and hence `authority_not_supported` has not been run in years - deleted - bad_hostname similarly hasn't been triggered in a long while, so deleted - load_reporting_hook has never been enabled, so deleted (https://github.com/grpc/grpc/blame/f23fb4cf3114787806c330985c8fb3213597a09b/test/core/end2end/generate_tests.bzl#L145-L148) - filter_latency & filter_status_code rely on global variables and so don't convert particularly cleanly - and their value seems marginal, so deleted --------- Co-authored-by: ctiller <ctiller@users.noreply.github.com>
It already started hitting the limit resulting in continuous failure. grpc#32603 is believed to contribute to this time increase but let's bump it first and visit this issue later.
Implement listeners, connection, endpoints for `FuzzingEventEngine`. Allows the fuzzer to select write sizes and delays, connection delays, and port assignments. I made a few modifications to the test suite to admit this event engine to pass the client & server tests: 1. the test factories return shared_ptr<> to admit us to return the same event engine for both the oracle and the implementation - necessary because FuzzingEventEngine forms a closed world of addresses & ports. 2. removed the WaitForSingleOwner calls - these seem unnecessary, and we don't ask our users to do this - tested existing linux tests 1000x across debug, asan, tsan with this change Additionally, the event engine overrides the global port picker logic so that port assignments are made by the fuzzer too. This PR is a step along a longer journey, and has some outstanding brethren PR's, and some follow-up work: * #32603 will convert all the core e2e tests into a more malleable form * we'll then use #32667 to turn all of these into fuzzers * finally we'll integrate this into that work and turn all core e2e tests into fuzzers over timer & callback reorderings and io size/spacings --------- Co-authored-by: ctiller <ctiller@users.noreply.github.com>
Discovered testing #32603 <!-- If you know who should review your pull request, please assign it to that person, otherwise the pull request would get assigned randomly. If your pull request is for a specific language, please add the appropriate lang label. -->
Notes: - `+trace` fixtures haven't run since 2016, so they're disabled for now (7ad2d0b#diff-780fce7267c34170c1d0ea15cc9f65a7f4b79fefe955d185c44e8b3251cf9e38R76) - all current fixtures define `FEATURE_MASK_SUPPORTS_AUTHORITY_HEADER` and hence `authority_not_supported` has not been run in years - deleted - bad_hostname similarly hasn't been triggered in a long while, so deleted - load_reporting_hook has never been enabled, so deleted (https://github.com/grpc/grpc/blame/f23fb4cf3114787806c330985c8fb3213597a09b/test/core/end2end/generate_tests.bzl#L145-L148) - filter_latency & filter_status_code rely on global variables and so don't convert particularly cleanly - and their value seems marginal, so deleted --------- Co-authored-by: ctiller <ctiller@users.noreply.github.com>
It already started hitting the limit resulting in continuous failure. #32603 is believed to contribute to this time increase but let's bump it first and visit this issue later.
Notes:
+tracefixtures haven't run since 2016, so they're disabled for now (7ad2d0b#diff-780fce7267c34170c1d0ea15cc9f65a7f4b79fefe955d185c44e8b3251cf9e38R76)FEATURE_MASK_SUPPORTS_AUTHORITY_HEADERand henceauthority_not_supportedhas not been run in years - deleted