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

fix(NODE-3183,NODE-3249): bring versioned API impl up to date #2814

Merged
merged 3 commits into from
May 25, 2021

Conversation

addaleax
Copy link
Contributor

Description

What changed?

Bring the versioned API code up to date by addressing NODE-3183 and
NODE-3249.

Specifically:

  • Bump the versioned API tests to the latest version using
    ./etc/update-spec-tests.sh versioned-api.
  • Manually apply the SDAM updates from
    mongodb/specifications@9946950
    (because a full update would have also come with load balancer
    changes that do not pass yet).
  • Update the test runner slightly to account for the fact that some
    fields may have only a $$unsetOrMatches operator as its contents
    and thus the set of expected keys in an “expected” object is
    not a fixed-size set. (This was necessary in order for the updated
    versioned-api tests to pass)
  • Remove the special check for getMore and transaction commands, and
    now pass the apiVersion for them as well when it is specified.
  • Use the hello command instead of isMaster when an API version is
    specified; make sure that the slightly different response format
    does not break anything by setting the ismaster property manually
    in that case.
  • Updating the mock server message handlers to account for both types
    of handshakes, everywhere.

Are there any files to ignore?

I mean, the spec tests were really just updated automatically. The mock tests updates were performed semi-automatically, i.e. I did an automatic replacement and then went through all update sites + all message handlers manually to verify that they were not invalid changes. (Some of the tests are using replies like mock.DEFAULT_ISMASTER_36. I’m not sure if it makes sense to actually update those, considering that the name implies a MongoDB 3.6 response. I don’t think it hurts, though.)

Bring the versioned API code up to date by addressing NODE-3183 and
NODE-3249.

Specifically:
- Bump the versioned API tests to the latest version using
  `./etc/update-spec-tests.sh versioned-api`.
- Manually apply the SDAM updates from
  mongodb/specifications@9946950
  (because a full update would have also come with load balancer
  changes that do not pass yet).
- Update the test runner slightly to account for the fact that some
  fields may have only a `$$unsetOrMatches` operator as its contents
  and thus the set of expected keys in an “expected” object is
  not a fixed-size set.
- Remove the special check for getMore and transaction commands, and
  now pass the apiVersion for them as well when it is specified.
- Use the `hello` command instead of `isMaster` when an API version is
  specified; make sure that the slightly different response format
  does not break anything by setting the `ismaster` property manually
  in that case.
- Updating the mock server message handlers to account for both types
  of handshakes, everywhere.
src/cmap/connect.ts Outdated Show resolved Hide resolved
@dariakp dariakp requested review from a team, emadum, nbbeeken and dariakp and removed request for a team May 21, 2021 13:41
Copy link
Member

@durran durran left a comment

Choose a reason for hiding this comment

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

LGTM. I think the suggestions I would have had are part of NODE-3281 and don't need to happen here.

Copy link
Contributor

@nbbeeken nbbeeken left a comment

Choose a reason for hiding this comment

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

There seems to be a failure still, it is the same test it just happens to be one of the duplicated tests meant to test the unified test runner.
A successful find event with a getmore and the server kills the cursor in test/spec/unified-test-format/valid-pass/poc-command-monitoring.yml

I tried debugging a bit and it appears the server isn't killing the cursor (which I believe is returning a 0 cursor id) so this line is kind of the source of the error. I'll check with other drivers if this test is an issue for all of us.

Copy link
Contributor

@nbbeeken nbbeeken left a comment

Choose a reason for hiding this comment

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

NODE-3308
It is a shared failure so we can go ahead and merge this. It LGTM!

Copy link
Contributor

@emadum emadum left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

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