@@ -132,7 +132,11 @@ def get_encryption_expansions(encryption):
132132 display_name = get_variant_name (encryption , host , ** expansions )
133133 tasks = [".test-non-standard" ]
134134 if host != "rhel8" :
135- tasks = [".test-non-standard !.pypy" ]
135+ # Exclude PyPy (not tested with encryption on macOS/win64) and coverage tasks
136+ # (encryption suites exceed the 60-min timeout with coverage overhead on macOS/win64).
137+ # Also include the non-coverage companion tasks (test-non-standard-no-cov) which
138+ # carry the "latest" server tasks without COVERAGE=1.
139+ tasks = [".test-non-standard !.pypy !.cov" , ".test-non-standard-no-cov !.pypy" ]
136140 variant = create_variant (
137141 tasks ,
138142 display_name ,
@@ -644,8 +648,9 @@ def create_test_non_standard_tasks():
644648 tasks = []
645649 task_combos = set ()
646650 # For each version and topology, rotate through the CPythons.
651+ # Only the sharded_cluster topology runs on PRs to keep patch build size manageable.
647652 for (version , topology ), python in zip_cycle (list (product (ALL_VERSIONS , TOPOLOGIES )), CPYTHONS ):
648- pr = version == "latest"
653+ pr = version == "latest" and topology == "sharded_cluster"
649654 task_combos .add ((version , topology , python , pr ))
650655 # For each PyPy and topology, rotate through the MongoDB versions.
651656 for (python , topology ), version in zip_cycle (list (product (PYPYS , TOPOLOGIES )), ALL_VERSIONS ):
@@ -670,12 +675,33 @@ def create_test_non_standard_tasks():
670675 expansions ["TEST_MIN_DEPS" ] = "1"
671676 elif pr :
672677 expansions ["COVERAGE" ] = "1"
678+ tags .append ("cov" )
673679 name = get_task_name ("test-non-standard" , python = python , ** expansions )
674680 server_func = FunctionCall (func = "run server" , vars = expansions )
675681 test_vars = expansions .copy ()
676682 test_vars ["TOOLCHAIN_VERSION" ] = python
677683 test_func = FunctionCall (func = "run tests" , vars = test_vars )
678684 tasks .append (EvgTask (name = name , tags = tags , commands = [server_func , test_func ]))
685+ # For each coverage task, also emit a non-coverage companion so that
686+ # macOS/Win64 encryption variants (which filter out .cov due to timeout
687+ # constraints) still have a "latest" task to activate in patch builds.
688+ if pr and "cov" in tags :
689+ nc_expansions = {k : v for k , v in expansions .items () if k != "COVERAGE" }
690+ # Use a distinct primary tag so companions are not selected by existing
691+ # ".test-non-standard" selectors (e.g. load-balancer, PyOpenSSL variants).
692+ nc_tags = [
693+ "test-non-standard-no-cov" if t == "test-non-standard" else t
694+ for t in tags
695+ if t != "cov"
696+ ]
697+ nc_name = get_task_name ("test-non-standard" , python = python , ** nc_expansions )
698+ nc_server_func = FunctionCall (func = "run server" , vars = nc_expansions )
699+ nc_test_vars = nc_expansions .copy ()
700+ nc_test_vars ["TOOLCHAIN_VERSION" ] = python
701+ nc_test_func = FunctionCall (func = "run tests" , vars = nc_test_vars )
702+ tasks .append (
703+ EvgTask (name = nc_name , tags = nc_tags , commands = [nc_server_func , nc_test_func ])
704+ )
679705 return tasks
680706
681707
0 commit comments