Skip to content

Conversation

@jyemin
Copy link
Collaborator

@jyemin jyemin commented Jan 29, 2021

This is a patch to the 3.8.x branch to fulfill the goals for continuous matrix testing for the 4.0-era driver, which was 3.8.0. Similar PRs will be done for the 4.2 and 4.4 era release branches. What I've done here is two things:

  1. Modify or skip tests that will not pass against later server versions. Mostly because the features under test have been removed
  2. In cases where the server made breaking changes to commands that prevents the driver code from working, I changed the driver code to make it work with the later server versions. This seemed easier than disabling all the tests of that feature, though that is another option we could consider. Look at the changes to MapReduceToCollectionOperation for an example of this.

There's nothing really new here. All these changes have been applied already in one form or another to the master branch of the driver. It was just a matter of finding them and copying them to this branch.

JAVA-3942

Full patch build: https://spruce.mongodb.com/version/60133b4d9ccd4e019373ad0d/tasks?sorts=STATUS%3AASC%3BBASE_STATUS%3ADESC

jyemin added 13 commits January 27, 2021 18:13
There's an integration test that asserts an exception is thrown when a change stream
projects out the _id field.  Running against 3.6 and 4.0, this condition is checked
in the driver itself while processing the results.  But in 4.4 the server started
replying with an error on the getMore in this scenario.  A newer driver would know not to
retry in this case, because newer drivers implemented an allow list for resumeable change
stream errors when the server version. But older drivers don't have that logic, so
it will treat this command error as retryable and never actually report the error.

JAVA-3942
The reply format has changed in a way that breaks the test.  This test
has been disabled in subsequent releases and ultimately just removed.

JAVA-3942
Change the test so that it produces a non-zero score so that the score
won't be excluded by later server versions.

JAVA-3942
- command: attach.xunit_results
params:
file: ./src/*/build/test-results/TEST-*.xml
file: ./src/*/build/test-results/test/TEST-*.xml
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Test uploading was actually broken in the 3.x branch, so I just fixed it.

${PREPARE_SHELL}
echo '{"results": [{ "status": "FAIL", "test_file": "Build", "log_raw": "No test-results.json found was created" } ]}' > ${PROJECT_DIRECTORY}/test-results.json
"install dependencies":
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The presence of this function caused evergreen to refuse to load the file, so had to remove it.

Copy link
Member

Choose a reason for hiding this comment

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

Ack

}

private static int getInputCount(final BsonDocument result) {
return result.getDocument("counts").getNumber("input").intValue();
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

These changes are to prevent the driver from failing when no statistics are present in the reply. Without this change, we can't run mapReduce operations at all.

Copy link
Member

Choose a reason for hiding this comment

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

Ack

BsonDocument outputDocument = new BsonDocument(getAction(), new BsonString(getCollectionName()));
outputDocument.append("sharded", BsonBoolean.valueOf(isSharded()));
outputDocument.append("nonAtomic", BsonBoolean.valueOf(isNonAtomic()));
if (description != null && !serverIsAtLeastVersionFourDotFour(description)) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Without this change, the server will fail to execute the operation

@jyemin jyemin requested a review from rozza January 29, 2021 17:55
Copy link
Member

@rozza rozza left a comment

Choose a reason for hiding this comment

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

Minor nit but LGTM after that

${PREPARE_SHELL}
echo '{"results": [{ "status": "FAIL", "test_file": "Build", "log_raw": "No test-results.json found was created" } ]}' > ${PROJECT_DIRECTORY}/test-results.json
"install dependencies":
Copy link
Member

Choose a reason for hiding this comment

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

Ack

}

private static int getInputCount(final BsonDocument result) {
return result.getDocument("counts").getNumber("input").intValue();
Copy link
Member

Choose a reason for hiding this comment

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

Ack

@jyemin
Copy link
Collaborator Author

jyemin commented Feb 1, 2021

@jyemin jyemin closed this Feb 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants