Skip to content

Improve Netty test variants #1721

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 4 commits into from
Jun 17, 2025
Merged

Improve Netty test variants #1721

merged 4 commits into from
Jun 17, 2025

Conversation

jyemin
Copy link
Collaborator

@jyemin jyemin commented May 28, 2025

  • Only run driver-core and driver-reactive-streams test suites, each in its own task (as we do in other variants).
  • Use Netty configuration in all unified reactive tests, increasing coverage of Netty in driver-reactive-streams

JAVA-5887

@jyemin jyemin requested a review from Copilot May 28, 2025 15:07
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR improves the Netty test variants by ensuring that unified reactive tests use the Netty configuration for increased coverage and by streamlining async transport settings across test suites. Key changes include:

  • Modifying UnifiedReactiveStreamsTest to override MongoClientSettings with custom TransportSettings.
  • Removing duplicate client creation logic from ClientSideOperationTimeoutTest.
  • Updating ClusterFixture and Evergreen configuration to use the new ASYNC_TRANSPORT property.
  • Adjusting .evergreen run-tests scripts and matrix configurations accordingly.

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/unified/UnifiedReactiveStreamsTest.java Applies overridden TransportSettings when present.
driver-reactive-streams/src/test/functional/com/mongodb/reactivestreams/client/unified/ClientSideOperationTimeoutTest.java Removes the custom createMongoClient override.
driver-core/src/test/functional/com/mongodb/ClusterFixture.java Updates property retrieval to use "org.mongodb.test.async.transport".
.evergreen/run-tests.sh Adjusts environment variable usage from STREAM_TYPE to ASYNC_TRANSPORT.
.evergreen/.evg.yml Updates matrix specs and tasks to reflect the new async transport settings.
Comments suppressed due to low confidence (1)

driver-core/src/test/functional/com/mongodb/ClusterFixture.java:523

  • [nitpick] Consider renaming 'asyncTransport' to 'asyncTransportType' to clarify that the variable represents a transport type configuration.
String asyncTransport = System.getProperty("org.mongodb.test.async.transport", "nio2");

display_name: "Netty SSL provider: ${version} ${topology} ${ssl} SslProvider.${netty-ssl-provider} ${auth} ${jdk} ${os} "
tags: ["tests-netty-variant"]
tasks:
- name: "netty-test"
- name: "test-reactive"
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Spilt into the two tasks to make it run faster, as has already been done for the main test matrix. Core and reactive are the only two modules that pay attention to the transport settings.

# MONGODB_URI Set the suggested connection MONGODB_URI (including credentials and topology info)
# TOPOLOGY Allows you to modify variables and the MONGODB_URI based on test topology
# Supported values: "server", "replica_set", "sharded_cluster"
# COMPRESSOR Set to enable compression. Values are "snappy" and "zlib" (default is no compression)
# STREAM_TYPE Set the stream type. Values are "nio2" or "netty". Defaults to "nio2".
# ASYNC_TRANSPORT Set the async transport. Values are "nio2" or "netty".
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Changed the name to match the new TransportSettings class introduced in 5.0

@@ -34,13 +34,14 @@ SSL=${SSL:-nossl}
MONGODB_URI=${MONGODB_URI:-}
TOPOLOGY=${TOPOLOGY:-server}
COMPRESSOR=${COMPRESSOR:-}
STREAM_TYPE=${STREAM_TYPE:-nio2}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No need to default it since it's already defaulted in ClusterFixture

@jyemin jyemin requested a review from katcharov May 29, 2025 14:05
@jyemin jyemin marked this pull request as ready for review May 29, 2025 14:05
Copy link
Collaborator

@katcharov katcharov left a comment

Choose a reason for hiding this comment

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

LGTM!

@jyemin
Copy link
Collaborator Author

jyemin commented May 29, 2025

@rozza do you want me to hold off on merging this?

@jyemin jyemin requested a review from a team as a code owner June 17, 2025 15:26
@jyemin jyemin requested review from rozza and removed request for a team June 17, 2025 15:26
* Only run driver-core and driver-reactive-streams test suites, each in its
  own task (as we do in other variants).
* Use Netty configuration in all unified reactive tests, increasing coverage of Netty in
  driver-reactive-streams

JAVA-5887
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.

Looks good added some suggestions for minor nits.

jyemin and others added 2 commits June 17, 2025 12:03
Co-authored-by: Ross Lawley <ross.lawley@gmail.com>
@jyemin jyemin requested a review from rozza June 17, 2025 16:11
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.

LGTM!

* Add space between '"' and ']''.  Otherwise, it silently fails
@jyemin jyemin merged commit 2d15c2a into mongodb:main Jun 17, 2025
55 of 58 checks passed
@jyemin jyemin deleted the JAVA-5887 branch June 17, 2025 19:23
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