File tree Expand file tree Collapse file tree 2 files changed +24
-0
lines changed
Expand file tree Collapse file tree 2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change 88 'test_code' ,
99 'test_enum' ,
1010 'test_functools' ,
11+ 'test_hashlib' ,
1112 'test_httpservers' ,
1213 'test_imaplib' ,
1314 'test_importlib' ,
Original file line number Diff line number Diff line change @@ -1196,6 +1196,29 @@ def test_file_digest(self):
11961196 with open (os_helper .TESTFN , "wb" ) as f :
11971197 hashlib .file_digest (f , "sha256" )
11981198
1199+ @unittest .skipUnless (support .check_sanitizer (thread = True ), "only meaningful on free-threading" )
1200+ def test_gh_128657 (self ):
1201+ def test_hashlib_sha256 ():
1202+ hash_obj = hashlib .sha256 ()
1203+
1204+ def closure (barrier ):
1205+ barrier .wait ()
1206+ test_hashlib_sha256 ()
1207+
1208+ num_workers = 40
1209+ num_runs = 20
1210+
1211+ for i in range (num_runs ):
1212+ barrier = threading .Barrier (num_workers )
1213+ thrds = []
1214+
1215+ for i in range (num_workers ):
1216+ thrds .append (thrd := threading .Thread (target = closure , args = (barrier ,)))
1217+ thrd .start ()
1218+
1219+ for thrd in thrds :
1220+ thrd .join ()
1221+
11991222
12001223if __name__ == "__main__" :
12011224 unittest .main ()
You can’t perform that action at this time.
0 commit comments