Skip to content

CDRIVER-4275 and CDRIVER-4275 #1158

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

Merged
merged 10 commits into from
Dec 9, 2022
Merged

CDRIVER-4275 and CDRIVER-4275 #1158

merged 10 commits into from
Dec 9, 2022

Conversation

kevinAlbs
Copy link
Collaborator

@kevinAlbs kevinAlbs commented Dec 7, 2022

Summary

Resolves CDRIVER-4275 and CDRIVER-4387.

Background & Motivation

integration-tests.sh and orchestration configs have been updated for load balancer support. The orchestration configs were added in mongodb-labs/drivers-evergreen-tools#183 and later updated in mongodb-labs/drivers-evergreen-tools#186.

The C driver maintains a modified copy of the drivers-evergreen-tools script run-orchestration.sh as integration-tests.sh. integration-tests.sh may be removed in CDRIVER-4029.

The JSON tests in src/libmongoc/tests/json/initial_seedlist_dns_discovery/load-balanced were updated to account for mongodb/specifications#1148.

Here is a full patch build: https://spruce.mongodb.com/version/6390ffd0850e613823e658de

This matches expectation of integration-tests.sh.
This was only needed when MongoDB servers did not return a serviceId in the hello response.
Tests were updated in mongodb/specifications commit: 5d1b42a05017ba27ffdbe6fd068a45e93e5b68c5
@kevinAlbs kevinAlbs marked this pull request as ready for review December 8, 2022 01:46
Copy link
Contributor

@rcsanchez97 rcsanchez97 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'll leave it up to you as to whether you want to go to the trouble of changing the semantics of the LOAD_BALANCER variable, but it's not worth holding up the PR so I'm going ahead and approving.

@@ -61,6 +61,10 @@ if [ -z "$ORCHESTRATION_FILE" ]; then
if [ "$SSL" != "nossl" ]; then
ORCHESTRATION_FILE="${ORCHESTRATION_FILE}-ssl"
fi

if [ -n "$LOAD_BALANCER" ]; then
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not super excited about using -n to test a variable that is set with the value true in config.yml. This seems to create the possibility that someone could think that setting LOAD_BALANCER=false would disable load balancer tests, but that would clearly not happen. I can't decide on a clearly better approach, but what about testing for = "on" as is done for IPV4_ONLY? The the on/off semantics seem a bit more natural.

Copy link
Contributor

@eramongodb eramongodb Dec 8, 2022

Choose a reason for hiding this comment

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

Agreed; suggest using same pattern as $IPV4_ONLY check above:

if [ "$LOAD_BALANCER" = "on" ]; then

Also suggest adding LOAD_BALANCER=${LOAD_BALANCER:-off} above to document script parameters and default behavior.

Note: if this script is unconditionally executed in Bash, the VAR=${VAR:-value} pattern used above can be rewritten as:

: "${VAR:=value}"

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This seems to create the possibility that someone could think that setting LOAD_BALANCER=false would disable load balancer tests, but that would clearly not happen.

Good point. Updated to check for the value "on".

Note: if this script is unconditionally executed in Bash, the VAR=${VAR:-value} pattern used above can be rewritten

Thank you for the suggestion. Updated to explicitly run with bash and declare the LOAD_BALANCER variable.

@@ -61,6 +61,10 @@ if [ -z "$ORCHESTRATION_FILE" ]; then
if [ "$SSL" != "nossl" ]; then
ORCHESTRATION_FILE="${ORCHESTRATION_FILE}-ssl"
fi

if [ -n "$LOAD_BALANCER" ]; then
Copy link
Contributor

@eramongodb eramongodb Dec 8, 2022

Choose a reason for hiding this comment

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

Agreed; suggest using same pattern as $IPV4_ONLY check above:

if [ "$LOAD_BALANCER" = "on" ]; then

Also suggest adding LOAD_BALANCER=${LOAD_BALANCER:-off} above to document script parameters and default behavior.

Note: if this script is unconditionally executed in Bash, the VAR=${VAR:-value} pattern used above can be rewritten as:

: "${VAR:=value}"

@kevinAlbs kevinAlbs requested a review from eramongodb December 8, 2022 21:14
@kevinAlbs kevinAlbs merged commit eea8bb7 into mongodb:master Dec 9, 2022
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.

3 participants