Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH-43677: [C++][FlightRPC] Move the FlightTestServer to its own .cc and .h files #43678

Merged
merged 3 commits into from
Aug 14, 2024

Conversation

felipecrv
Copy link
Contributor

@felipecrv felipecrv commented Aug 13, 2024

Rationale for this change

One way of learning about a codebase is reading the tests. As it is now, it's hard to see the minimal FlightServerBase sub-class in flight/test_util.cc, so I moved it to its own file.

What changes are included in this PR?

  • Renaming FlightTestServer to TestFlightServer
  • Moving the class to test_flight_server.{h,cc}
  • Bonus: Moving the server and client auth handlers to test_auth_handlers.{h,cc}

Are these changes tested?

By existing tests.

Are there any user-facing changes?

ExampleTestServer is removed from the testing library in favor of FlightTestServer::Make.

@felipecrv
Copy link
Contributor Author

Pushed a commit moving the auth handlers as well.

Copy link
Member

@lidavidm lidavidm left a comment

Choose a reason for hiding this comment

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

I'll just note that these are very much not meant as pedagogical examples

@github-actions github-actions bot added awaiting merge Awaiting merge and removed awaiting committer review Awaiting committer review labels Aug 14, 2024
Copy link
Member

@kou kou left a comment

Choose a reason for hiding this comment

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

+1

Comment on lines +81 to +83
std::unique_ptr<FlightServerBase> TestFlightServer::Make() {
return std::make_unique<TestFlightServer>();
}
Copy link
Member

Choose a reason for hiding this comment

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

Do we need this factory method?
How about using std::make_unique<TestFlightServer>() directly in callers?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It's used quite a lot and is handy to not have to write the longer make_unique invocation. This is replacing the old free function called ExampleTestServer.

@github-actions github-actions bot added awaiting changes Awaiting changes and removed awaiting merge Awaiting merge labels Aug 14, 2024
@felipecrv felipecrv merged commit 69bce8f into apache:main Aug 14, 2024
42 of 43 checks passed
@felipecrv felipecrv removed the awaiting changes Awaiting changes label Aug 14, 2024
@felipecrv felipecrv deleted the test_flight_server branch August 14, 2024 00:28
Copy link

After merging your PR, Conbench analyzed the 4 benchmarking runs that have been run so far on merge-commit 69bce8f.

There were no benchmark performance regressions. 🎉

The full Conbench report has more details. It also includes information about 4 possible false positives for unstable benchmarks that are known to sometimes produce them.

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

Successfully merging this pull request may close these issues.

3 participants