GH-49783: [C++][FlightRPC][ODBC] Reuse connections across test suite#49784
GH-49783: [C++][FlightRPC][ODBC] Reuse connections across test suite#49784justing-bq wants to merge 4 commits intoapache:mainfrom
Conversation
|
|
There was a problem hiding this comment.
Pull request overview
This PR refactors the Flight SQL ODBC C++ test suite to reuse ODBC environment/connection handles across the entire test run (global SetUp/TearDown), reducing connect/disconnect churn that can crash tests on Linux.
Changes:
- Introduces shared handle pools (remote/mock, ODBC v2/v3, plus “non-connection” handles) and rewires fixtures to point
env/conn/stmtat the appropriate shared handles. - Moves remote/mock connection establishment into a global
::testing::Environmentand updates helper APIs (Connect,Disconnect, etc.) to accept explicit handle references. - Adjusts a few tests to use the new connection helper signature and adds a Windows-only CMake source tweak.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| cpp/src/arrow/flight/sql/odbc/tests/odbc_test_suite.h | Adds shared handle structs/pools and updates test base APIs to take explicit handles. |
| cpp/src/arrow/flight/sql/odbc/tests/odbc_test_suite.cc | Implements a global test environment that connects once and reuses handles across suites/tests. |
| cpp/src/arrow/flight/sql/odbc/tests/connection_info_test.cc | Updates handle-based tests to call ConnectWithString(..., conn). |
| cpp/src/arrow/flight/sql/odbc/tests/connection_attr_test.cc | Allocates a local env/conn for a DM-only attribute test and uses new helpers. |
| cpp/src/arrow/flight/sql/odbc/tests/CMakeLists.txt | Adds a Windows-only extra source intended to address a Windows crash. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
lidavidm
left a comment
There was a problem hiding this comment.
Is there an issue for tracking down the cause of the crash?
We have an issue here: #48270 |
|
Could we resolve the merge conflict? |
f497c6b to
eb7732b
Compare
eb7732b to
12386aa
Compare
12386aa to
f43b2ce
Compare
f43b2ce to
e13e14c
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 12 out of 12 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
1580dbd to
0f25fe5
Compare
Co-Authored-By: Alina (Xi) Li <96995091+alinaliBQ@users.noreply.github.com>
0f25fe5 to
1f5db13
Compare
Rationale for this change
We avoid crashing tests on Linux if we minimize the number of connect/disconnect attempts. So now we are reusing the same connection as much as possible throughout the tests.
What changes are included in this PR?
All our necessary connections happen during global
SetUp()and then they get disconnected during globalTearDown().Test Fixture SetUp logic is now about updating pointers to the correct environment, connection, and statement handles for those tests.
Are these changes tested?
Yes.
Are there any user-facing changes?
No.