@@ -90,14 +90,33 @@ class UnixBuild(BaseBuild):
9090 test_environ = {}
9191 build_out_of_tree = False
9292
93+ def create_test_opts (self , branch , worker ):
94+ testopts = [* self .testFlags , * get_j_opts (worker , 2 )]
95+ if not has_option ("-R" , self .testFlags ):
96+ testopts .extend (("--junit-xml" , JUNIT_FILENAME ))
97+
98+ # Add excluded test resources
99+ exclude_test_resources = worker .exclude_test_resources
100+ if exclude_test_resources :
101+ u_loc = None
102+ for i , opt in enumerate (testopts ):
103+ if opt .startswith ("-u" ):
104+ u_loc = i
105+ break
106+ if u_loc is not None :
107+ for resource in exclude_test_resources :
108+ testopts [u_loc ] += f",-{ resource } "
109+ else :
110+ testopts .append (f"-uall,{ "," .join (f"-{ r } " for r in exclude_test_resources )} " )
111+
112+ return testopts
113+
93114 def setup (self , branch , worker , test_with_PTY = False , ** kwargs ):
94115 out_of_tree_dir = "build_oot"
95116
96117 # Adjust the timeout for this worker
97118 self .test_timeout *= worker .timeout_factor
98119
99- exclude_test_resources = worker .exclude_test_resources
100-
101120 # In 3.10, test_asyncio wasn't split out, and refleaks tests
102121 # need more time.
103122 if branch .monolithic_test_asyncio and has_option ("-R" , self .testFlags ):
@@ -125,22 +144,8 @@ def setup(self, branch, worker, test_with_PTY=False, **kwargs):
125144 Configure (command = configure_cmd , ** oot_kwargs )
126145 )
127146 compile = ["make" , * get_j_opts (worker ), self .makeTarget ]
128- testopts = [* self .testFlags , * get_j_opts (worker , 2 )]
129- if not has_option ("-R" , self .testFlags ):
130- testopts .extend (("--junit-xml" , JUNIT_FILENAME ))
131- # Add excluded test resources
132- if exclude_test_resources :
133- u_loc = None
134- for i , opt in enumerate (testopts ):
135- if opt .startswith ("-u" ):
136- u_loc = i
137- break
138- if u_loc is not None :
139- for resource in exclude_test_resources :
140- testopts [u_loc ] += f",-{ resource } "
141- else :
142- testopts .append (f"-uall,{ "," .join (f"-{ r } " for r in exclude_test_resources )} " )
143147
148+ testopts = self .create_test_opts (branch , worker )
144149 test = [
145150 "make" ,
146151 "buildbottest" ,
@@ -221,7 +226,7 @@ def setup(self, branch, worker, test_with_PTY=False, **kwargs):
221226 major , minor = branch .version_tuple
222227 executable_name = f'python{ major } .{ minor } '
223228 else :
224- executable_name = f 'python3'
229+ executable_name = 'python3'
225230 installed_python = f"./target/bin/{ executable_name } "
226231 self .addStep (
227232 Configure (
@@ -459,6 +464,16 @@ class RHEL8Build(UnixBuild):
459464 # /builddir/build/BUILD/Python-3.11/build/optimized: configure, make, tests
460465 build_out_of_tree = True
461466
467+ def create_test_opts (self , branch , worker ):
468+ testops = super ().create_test_opts (branch , worker )
469+ if branch .version_tuple and branch .version_tuple < (3 , 13 ):
470+ # In 2026, test_dtrace was enhanced and fixed which made it
471+ # possible to enable it on Fedora/RHEL. But these changes were
472+ # only backported up to the 3.13 branch.
473+ # https://github.com/python/cpython/issues/98894
474+ testops .extend (('-x' , 'test_dtrace' ))
475+ return testops
476+
462477
463478class CentOS9Build (RHEL8Build ):
464479 # Build on 64-bit CentOS Stream 9.
0 commit comments