Skip to content
This repository has been archived by the owner on Dec 8, 2021. It is now read-only.

test: write integration test for SessionPool #1442

Merged
merged 3 commits into from
Mar 23, 2020
Merged

test: write integration test for SessionPool #1442

merged 3 commits into from
Mar 23, 2020

Conversation

coryan
Copy link
Contributor

@coryan coryan commented Mar 20, 2020

Make sure the low-level functions to make async calls actually work,
the value of unit tests for these is limited (we would be re-testing
the retry loop, but we have tests for that). An integration test
verifies we are filling the protos with the right data. Note that
some of these functions are not exercised in the other integration
tests because they run too infrequently.


This change is Reviewable

Make sure the low-level functions to make async calls actually work,
the value of unit tests for these is limited (we would be re-testing
the retry loop, but we have tests for that). An integration test
verifies we are filling the protos with the right data. Note that
some of these functions are not exercised in the other integration
tests because they run too infrequently.
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Mar 20, 2020
@codecov
Copy link

codecov bot commented Mar 20, 2020

Codecov Report

Merging #1442 into master will increase coverage by 2.03%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1442      +/-   ##
==========================================
+ Coverage   93.55%   95.58%   +2.03%     
==========================================
  Files         193      192       -1     
  Lines       15852    15793      -59     
==========================================
+ Hits        14830    15096     +266     
+ Misses       1022      697     -325     
Impacted Files Coverage Δ
google/cloud/spanner/internal/session_pool.h 0.00% <ø> (ø)
...integration_tests/session_pool_integration_test.cc 100.00% <100.00%> (ø)
google/cloud/spanner/results.h 95.83% <0.00%> (-4.17%) ⬇️
...gle/cloud/spanner/internal/logging_spanner_stub.cc 82.35% <0.00%> (-0.99%) ⬇️
google/cloud/spanner/testing/mock_spanner_stub.h 88.23% <0.00%> (-0.66%) ⬇️
google/cloud/spanner/client.cc 96.91% <0.00%> (-0.62%) ⬇️
...on_tests/rpc_failure_threshold_integration_test.cc 85.55% <0.00%> (-0.16%) ⬇️
.../spanner/benchmarks/multiple_rows_cpu_benchmark.cc 91.96% <0.00%> (-0.01%) ⬇️
google/cloud/spanner/internal/session_pool_test.cc 99.57% <0.00%> (-0.01%) ⬇️
google/cloud/spanner/keys.h 100.00% <0.00%> (ø)
... and 26 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fefe9f2...5ee6a4c. Read the comment docs.

@coryan coryan marked this pull request as ready for review March 20, 2020 15:54
Copy link
Contributor

@devjgm devjgm left a comment

Choose a reason for hiding this comment

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

This change LGTM, but I was hoping to let @mr-salty approve too since he's the session-pool-person.

Reviewable status: 0 of 4 files reviewed, all discussions resolved (waiting on @devbww, @devjgm, @mr-salty, and @scotthart)

Copy link
Contributor

@mr-salty mr-salty left a comment

Choose a reason for hiding this comment

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

Reviewed 2 of 4 files at r1.
Reviewable status: 2 of 4 files reviewed, 1 unresolved discussion (waiting on @coryan, @devbww, @mr-salty, and @scotthart)


google/cloud/spanner/internal/session_pool.h, line 100 at r1 (raw file):

  std::shared_ptr<SpannerStub> GetStub(Session const& session);

  // Asynchronous calls used to maintain the pool.

These are not part of the SessionPool API; I'd prefer to keep them private and use friendship.

Alternatively, they could be factored out to another class - looks like the only member variables they access are the policies which could be passed in.

Copy link
Contributor Author

@coryan coryan left a comment

Choose a reason for hiding this comment

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

PTAL

Reviewable status: 1 of 4 files reviewed, 1 unresolved discussion (waiting on @devbww, @mr-salty, and @scotthart)


google/cloud/spanner/internal/session_pool.h, line 100 at r1 (raw file):

Previously, mr-salty (Todd Derr) wrote…

These are not part of the SessionPool API; I'd prefer to keep them private and use friendship.

Alternatively, they could be factored out to another class - looks like the only member variables they access are the policies which could be passed in.

I kept then private and introduced a friend class.

Copy link
Contributor

@mr-salty mr-salty left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 1 of 4 files at r1, 2 of 2 files at r2.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @devbww and @scotthart)

@coryan coryan merged commit 8b555af into googleapis:master Mar 23, 2020
@coryan coryan deleted the integration-test-for-session-pool branch March 23, 2020 18:48
devjgm pushed a commit to devjgm/google-cloud-cpp that referenced this pull request May 7, 2020
…-cpp-spanner#1442)

Make sure the low-level functions to make async calls actually work,
the value of unit tests for these is limited (we would be re-testing
the retry loop, but we have tests for that). An integration test
verifies we are filling the protos with the right data. Note that
some of these functions are not exercised in the other integration
tests because they run too infrequently.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants