Skip to content

[testing] Update orca-* tests for better compatibility#32630

Merged
eugeneo merged 2 commits intogrpc:masterfrom
eugeneo:tasks/bug/reset-config-interop-test
Mar 16, 2023
Merged

[testing] Update orca-* tests for better compatibility#32630
eugeneo merged 2 commits intogrpc:masterfrom
eugeneo:tasks/bug/reset-config-interop-test

Conversation

@eugeneo
Copy link
Copy Markdown
Contributor

@eugeneo eugeneo commented Mar 15, 2023

  1. Make channel creation lazy. This allows test cases to update the configuration before the connection is made.
  2. Pass load reports tracker when creating the policy. This way other test cases do not see any changes to ChannelArguments.

Using grpc_core::CoreConfiguration::RunWithSpecialConfiguration was considered but did not work as it removes other builders setup prior to starting the test cases.

1. Make channel creation lazy
2. Instantiate custom LB policy in Orca tests.
@eugeneo eugeneo force-pushed the tasks/bug/reset-config-interop-test branch from c1855d4 to 8c58296 Compare March 16, 2023 17:58
@eugeneo
Copy link
Copy Markdown
Contributor Author

eugeneo commented Mar 16, 2023

@markdroth I reverted most changes so the tracker is now passed through the channel arguments. Please take another look.

Copy link
Copy Markdown
Member

@markdroth markdroth left a comment

Choose a reason for hiding this comment

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

Just a couple of minor comments, otherwise looks great!

if (!new_stub_every_call_) {
stub_ = TestService::NewStub(channel_);
}
channel_ = absl::nullopt;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Can just say:

channel_.reset();
stub_.reset();

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

private:
ChannelCreationFunc channel_creation_func_;
std::unique_ptr<TestService::Stub> stub_;
absl::optional<std::unique_ptr<TestService::Stub>> stub_;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

There's no need for absl::optional<> for the stub or the channel, since we don't need to differentiate between nullptr and nullopt.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

Copy link
Copy Markdown
Contributor Author

@eugeneo eugeneo left a comment

Choose a reason for hiding this comment

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

I addressed the comments. Thank you for the review.

private:
ChannelCreationFunc channel_creation_func_;
std::unique_ptr<TestService::Stub> stub_;
absl::optional<std::unique_ptr<TestService::Stub>> stub_;
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

if (!new_stub_every_call_) {
stub_ = TestService::NewStub(channel_);
}
channel_ = absl::nullopt;
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

@eugeneo eugeneo merged commit 65fa0f6 into grpc:master Mar 16, 2023
@copybara-service copybara-service bot added the imported Specifies if the PR has been imported to the internal repository label Mar 17, 2023
eugeneo pushed a commit to eugeneo/grpc that referenced this pull request Mar 20, 2023
XuanWang-Amos pushed a commit to XuanWang-Amos/grpc that referenced this pull request May 1, 2023
1. Make channel creation lazy. This allows test cases to update the
configuration before the connection is made.
2. Pass load reports tracker when creating the policy. This way other
test cases do not see any changes to ChannelArguments.

Using grpc_core::CoreConfiguration::RunWithSpecialConfiguration was
considered but did not work as it removes other builders setup prior to
starting the test cases.
wanlin31 pushed a commit that referenced this pull request May 18, 2023
1. Make channel creation lazy. This allows test cases to update the
configuration before the connection is made.
2. Pass load reports tracker when creating the policy. This way other
test cases do not see any changes to ChannelArguments.

Using grpc_core::CoreConfiguration::RunWithSpecialConfiguration was
considered but did not work as it removes other builders setup prior to
starting the test cases.
@eugeneo eugeneo deleted the tasks/bug/reset-config-interop-test branch August 8, 2023 00:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bloat/none imported Specifies if the PR has been imported to the internal repository lang/c++ per-call-memory/neutral per-channel-memory/neutral release notes: no Indicates if PR should not be in release notes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants