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

Test getMore integration test using one connection pool #2878

Merged
merged 35 commits into from Jun 29, 2023

Conversation

chilagrow
Copy link
Contributor

@chilagrow chilagrow commented Jun 21, 2023

Description

Closes #1807.

Readiness checklist

  • I added/updated unit tests.
  • I added/updated integration/compatibility tests.
  • I added/updated comments and checked rendering.
  • I made spot refactorings.
  • I updated user documentation.
  • I ran task all, and it passed.
  • I ensured that PR title is good enough for the changelog.
  • (for maintainers only) I set Reviewers (@FerretDB/core), Labels, Project and project's Sprint fields.
  • I marked all done items in this checklist.

@chilagrow chilagrow self-assigned this Jun 21, 2023
@codecov
Copy link

codecov bot commented Jun 21, 2023

Codecov Report

Merging #2878 (676af8a) into main (2d8f797) will increase coverage by 5.17%.
The diff coverage is 93.75%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2878      +/-   ##
==========================================
+ Coverage   58.86%   64.04%   +5.17%     
==========================================
  Files         451      451              
  Lines       23847    23861      +14     
==========================================
+ Hits        14038    15282    +1244     
+ Misses       8816     7616    -1200     
+ Partials      993      963      -30     
Impacted Files Coverage Δ
integration/setup/client.go 70.96% <ø> (-10.29%) ⬇️
integration/setup/listener.go 67.97% <88.88%> (+6.23%) ⬆️
ferretdb/ferretdb.go 83.33% <100.00%> (ø)
integration/setup/setup.go 72.02% <100.00%> (+2.24%) ⬆️
integration/setup/setup_compat.go 75.73% <100.00%> (+0.17%) ⬆️
integration/setup/test_helpers.go 93.02% <100.00%> (+1.59%) ⬆️
internal/util/teststress/stress.go 100.00% <100.00%> (ø)

... and 43 files with indirect coverage changes

Flag Coverage Δ
integration 57.44% <90.00%> (+5.67%) ⬆️
mongodb 4.55% <27.50%> (+0.21%) ⬆️
pg 57.37% <90.00%> (+5.81%) ⬆️
shard-1 42.29% <83.75%> (+0.31%) ⬆️
shard-2 45.44% <76.25%> (+1.35%) ⬆️
shard-3 42.21% <90.00%> (?)
unit 24.13% <100.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

@chilagrow chilagrow added the code/chore Code maintenance improvements label Jun 21, 2023
@chilagrow chilagrow changed the title Analyse session error Run getMore integration test in one connection pool Jun 21, 2023
@chilagrow chilagrow marked this pull request as ready for review June 23, 2023 05:38
@chilagrow chilagrow requested a review from a team as a code owner June 23, 2023 05:38
@chilagrow chilagrow enabled auto-merge (squash) June 23, 2023 05:38
integration/query_test.go Outdated Show resolved Hide resolved
integration/setup/client.go Outdated Show resolved Hide resolved
integration/setup/setup.go Outdated Show resolved Hide resolved
@AlekSi
Copy link
Member

AlekSi commented Jun 23, 2023

Do we want to test this only for FerretDB?

First of all, we want to understand how MongoDB works. We can't do that if we don't run tests for it.

As far as I know, MongoDB does not provide information related to uniquely identifying a connection for commands.

That's why we fix *mongo.Client's pool size to 1 – it is easy to uniquely identify a connection if there is only one of them.

create a separate client like the first one, ensuring that different clients use different connections.

Also this can be implemented for FerretDB, but I didn't find equivalent check for MongoDB.

Not sure I understand why we can't create a separate *mongo.Client instance for MongoDB. See TestCommandsDiagnosticWhatsMyURI for example.

If we want to ensure FerretDB does use the same connection,

It will use the same connection if there is only one. And if there is only one, if we configure *mongo.Client to use the only one.

@chilagrow chilagrow marked this pull request as draft June 23, 2023 08:55
auto-merge was automatically disabled June 23, 2023 08:55

Pull request was converted to draft

@chilagrow chilagrow marked this pull request as ready for review June 26, 2023 03:28
@chilagrow chilagrow enabled auto-merge (squash) June 26, 2023 03:28
@chilagrow chilagrow changed the title Run getMore integration test in one connection pool Test getMore integration test using one connection pool Jun 26, 2023
@chilagrow chilagrow requested a review from AlekSi June 27, 2023 10:13
noisersup
noisersup previously approved these changes Jun 27, 2023
Copy link
Member

@noisersup noisersup left a comment

Choose a reason for hiding this comment

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

Looks great!

integration/query_test.go Outdated Show resolved Hide resolved
integration/commands_diagnostic_test.go Outdated Show resolved Hide resolved
integration/commands_diagnostic_test.go Outdated Show resolved Hide resolved
integration/commands_diagnostic_test.go Outdated Show resolved Hide resolved
integration/query_test.go Outdated Show resolved Hide resolved
integration/query_test.go Outdated Show resolved Hide resolved
integration/setup/client.go Outdated Show resolved Hide resolved
@AlekSi AlekSi added the not ready Issues that are not ready to be worked on; PRs that should skip CI label Jun 28, 2023
@AlekSi AlekSi added this to the Next milestone Jun 28, 2023
@AlekSi AlekSi removed the not ready Issues that are not ready to be worked on; PRs that should skip CI label Jun 28, 2023
@AlekSi AlekSi requested review from a team June 28, 2023 18:06
integration/setup/setup.go Outdated Show resolved Hide resolved
Copy link
Member

@noisersup noisersup left a comment

Choose a reason for hiding this comment

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

👍

@chilagrow chilagrow merged commit 7b6ccf3 into FerretDB:main Jun 29, 2023
25 of 28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
code/chore Code maintenance improvements
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Investigate TestGetMoreErrors sessions errors
3 participants