cpython/Lib/test
Victor Stinner 8fba9523cf
bpo-42398: Fix "make regen-all" race condition (GH-23362)
Fix a race condition in "make regen-all" when make -jN option is used
to run jobs in parallel. The clinic.py script now only use atomic
write to write files. Moveover, generated files are now left
unchanged if the content does not change, to not change the file
modification time.

The "make regen-all" command runs "make clinic" and "make
regen-importlib" targets:

* "make regen-importlib" builds object files (ex: Modules/_weakref.o)
  from source files (ex: Modules/_weakref.c) and clinic files (ex:
  Modules/clinic/_weakref.c.h)
* "make clinic" always rewrites all clinic files
  (ex: Modules/clinic/_weakref.c.h)

Since there is no dependency between "clinic" and "regen-importlib"
Makefile targets, these two targets can be run in parallel. Moreover,
half of clinic.py file writes are not atomic and so there is a race
condition when "make regen-all" runs jobs in parallel using make -jN
option (which can be passed in MAKEFLAGS environment variable).

Fix clinic.py to make all file writes atomic:

* Add write_file() function to ensure that all file writes are
  atomic: write into a temporary file and then use os.replace().
* Moreover, write_file() doesn't recreate or modify the file if the
  content does not change to avoid modifying the file modification
  file.
* Update test_clinic to verify these assertions with a functional
  test.
* Remove Clinic.force attribute which was no longer used, whereas
  Clinic.verify remains useful.
2020-11-18 15:36:27 +01:00
..
audiodata
capath
cjkencodings
crashers
data
decimaltestdata
dtracedata
eintrdata
encoded_modules
imghdrdata
leakers
libregrtest
sndhdrdata
subprocessdata
support
test_asyncio bpo-42140: Improve asyncio.wait function (GH-22938) 2020-11-10 14:12:52 -08:00
test_email bpo-30681: Support invalid date format or value in email Date header (GH-22090) 2020-10-26 17:31:06 -07:00
test_import
test_importlib bpo-41490: `path and contents` to aggressively close handles (#22915) 2020-10-25 14:21:46 -04:00
test_json
test_peg_generator Disable peg generator tests when building with PGO (GH-23141) 2020-11-04 23:01:08 +00:00
test_tools bpo-36310: Allow pygettext.py to detect calls to gettext in f-strings. (GH-19875) 2020-11-10 01:50:45 +03:00
test_warnings
test_zoneinfo
tracedmodules
xmltestdata
ziptestdata
__init__.py
__main__.py
_test_embed_set_config.py bpo-42260: Compute the path config in the main init (GH-23211) 2020-11-10 13:21:52 +01:00
_test_multiprocessing.py
allsans.pem
ann_module.py
ann_module2.py
ann_module3.py
audiotest.au
audiotests.py
audit-tests.py
autotest.py
bad_coding.py
bad_coding2.py
bad_getattr.py
bad_getattr2.py
bad_getattr3.py
badcert.pem
badkey.pem
badsyntax_3131.py
badsyntax_future3.py
badsyntax_future4.py
badsyntax_future5.py
badsyntax_future6.py
badsyntax_future7.py
badsyntax_future8.py
badsyntax_future9.py
badsyntax_future10.py
badsyntax_pep3120.py
bisect_cmd.py
cfgparser.1
cfgparser.2
cfgparser.3
clinic.test
cmath_testcases.txt
coding20731.py
curses_tests.py
dataclass_module_1.py
dataclass_module_2.py
dataclass_textanno.py
datetimetester.py
dis_module.py
doctest_aliases.py
double_const.py
empty.vbs
exception_hierarchy.txt
ffdh3072.pem
final_a.py
final_b.py
floating_points.txt
fork_wait.py
formatfloat_testcases.txt
future_test1.py
future_test2.py
gdb_sample.py
good_getattr.py
idnsans.pem
ieee754.txt
imp_dummy.py
inspect_fodder.py
inspect_fodder2.py
keycert.passwd.pem
keycert.pem
keycert2.pem
keycert3.pem
keycert4.pem
keycertecc.pem
list_tests.py
lock_tests.py
mailcap.txt
make_ssl_certs.py
mapping_tests.py
math_testcases.txt
memory_watchdog.py
mime.types
mock_socket.py
mod_generics_cache.py
mp_fork_bomb.py
mp_preload.py
multibytecodec_support.py
nokia.pem
nullbytecert.pem
nullcert.pem
pickletester.py bpo-41052: Fix pickling heap types implemented in C with protocols 0 and 1 (GH-22870) 2020-10-24 21:14:23 +03:00
profilee.py
pstats.pck
pycacert.pem
pycakey.pem
pyclbr_input.py
pydoc_mod.py
pydocfodder.py
pythoninfo.py
randv2_32.pck
randv2_64.pck
randv3.pck
re_tests.py
recursion.tar
regrtest.py
relimport.py
reperf.py
revocation.crl
sample_doctest.py
sample_doctest_no_docstrings.py
sample_doctest_no_doctests.py
secp384r1.pem
selfsigned_pythontestdotnet.pem
seq_tests.py
sgml_input.html
signalinterproctester.py
Sine-1000Hz-300ms.aif
sortperf.py
ssl_cert.pem
ssl_key.passwd.pem
ssl_key.pem
ssl_servers.py
ssltests.py
string_tests.py
talos-2019-0758.pem
test___all__.py
test___future__.py
test__locale.py bpo-38324: Fix test__locale.py Windows failures (GH-20529) 2020-10-20 12:39:52 +01:00
test__opcode.py
test__osx_support.py
test__xxsubinterpreters.py
test_abc.py
test_abstract_numbers.py
test_aifc.py
test_annotations.py
test_argparse.py
test_array.py Fix typo in test_array.py (GH-23189) 2020-11-10 18:12:36 +05:30
test_asdl_parser.py
test_ast.py
test_asyncgen.py
test_asynchat.py
test_asyncore.py
test_atexit.py
test_audioop.py
test_audit.py
test_augassign.py
test_base64.py
test_baseexception.py
test_bdb.py
test_bigaddrspace.py
test_bigmem.py
test_binascii.py
test_binhex.py bpo-29566: binhex.binhex now consitently writes MacOS 9 line endings. (GH-23059) 2020-11-01 01:08:48 -08:00
test_binop.py
test_bisect.py bpo-4356: Add key function support to the bisect module (GH-20556) 2020-10-19 22:04:01 -07:00
test_bool.py
test_buffer.py
test_bufio.py
test_builtin.py
test_bytes.py bpo-41100: Support macOS 11 and Apple Silicon (GH-22855) 2020-11-08 10:05:27 +01:00
test_bz2.py
test_c_locale_coercion.py
test_calendar.py
test_call.py
test_capi.py bpo-41832: PyType_FromModuleAndSpec() now accepts NULL tp_doc (GH-23123) 2020-11-06 17:04:47 +01:00
test_cgi.py
test_cgitb.py
test_charmapcodec.py
test_check_c_globals.py
test_class.py
test_clinic.py bpo-42398: Fix "make regen-all" race condition (GH-23362) 2020-11-18 15:36:27 +01:00
test_cmath.py
test_cmd.py
test_cmd_line.py
test_cmd_line_script.py
test_code.py bpo-42246: Partial implementation of PEP 626. (GH-23113) 2020-11-12 09:43:29 +00:00
test_code_module.py
test_codeccallbacks.py
test_codecencodings_cn.py
test_codecencodings_hk.py
test_codecencodings_iso2022.py
test_codecencodings_jp.py
test_codecencodings_kr.py
test_codecencodings_tw.py
test_codecmaps_cn.py
test_codecmaps_hk.py
test_codecmaps_jp.py
test_codecmaps_kr.py
test_codecmaps_tw.py
test_codecs.py
test_codeop.py
test_collections.py
test_colorsys.py
test_compare.py
test_compile.py bpo-42349: Compiler clean up. More yak-shaving for PEP 626. (GH-23267) 2020-11-17 19:30:14 +00:00
test_compileall.py
test_complex.py
test_concurrent_futures.py
test_configparser.py
test_contains.py
test_context.py
test_contextlib.py
test_contextlib_async.py bpo-41543: contextlib.nullcontext can fill in for an async context manager (GH-21870) 2020-11-09 14:34:07 +02:00
test_copy.py
test_copyreg.py
test_coroutines.py
test_cprofile.py
test_crashers.py
test_crypt.py
test_csv.py
test_ctypes.py
test_curses.py
test_dataclasses.py bpo-41747: Ensure all dataclass methods uses their parents' qualname (GH-22155) 2020-10-21 09:49:22 -04:00
test_datetime.py
test_dbm.py
test_dbm_dumb.py
test_dbm_gnu.py
test_dbm_ndbm.py
test_decimal.py
test_decorators.py
test_defaultdict.py
test_deque.py
test_descr.py
test_descrtut.py
test_devpoll.py
test_dict.py
test_dict_version.py
test_dictcomps.py
test_dictviews.py
test_difflib.py
test_difflib_expect.html
test_dis.py bpo-42349: Compiler clean up. More yak-shaving for PEP 626. (GH-23267) 2020-11-17 19:30:14 +00:00
test_distutils.py
test_doctest.py
test_doctest.txt
test_doctest2.py
test_doctest2.txt
test_doctest3.txt
test_doctest4.txt
test_docxmlrpc.py
test_dtrace.py
test_dynamic.py
test_dynamicclassattribute.py
test_eintr.py
test_embed.py bpo-42260: PyConfig_Read() only parses argv once (GH-23168) 2020-11-05 18:58:07 +01:00
test_ensurepip.py
test_enum.py
test_enumerate.py
test_eof.py
test_epoll.py
test_errno.py
test_exception_hierarchy.py
test_exception_variations.py
test_exceptions.py bpo-41659: Disallow curly brace directly after primary (GH-22996) 2020-10-27 20:54:20 +02:00
test_extcall.py
test_faulthandler.py
test_fcntl.py bpo-41586: Attempt to make the pipesize tests more robust. (GH-22839) 2020-10-20 17:37:20 -07:00
test_file.py
test_file_eintr.py
test_filecmp.py
test_fileinput.py
test_fileio.py
test_finalization.py
test_float.py
test_flufl.py
test_fnmatch.py
test_fork1.py
test_format.py bpo-42224: Fix test_format when locale does not expect number grouping (GH-23067) 2020-11-02 17:27:30 +02:00
test_fractions.py
test_frame.py
test_frozen.py
test_fstring.py
test_ftplib.py
test_funcattrs.py
test_functools.py
test_future.py
test_future3.py
test_future4.py
test_future5.py
test_gc.py
test_gdb.py
test_generator_stop.py
test_generators.py
test_genericalias.py bpo-42332: Add weakref slot to types.GenericAlias (GH-23250) 2020-11-15 19:27:23 -08:00
test_genericclass.py
test_genericpath.py
test_genexps.py
test_getargs2.py
test_getopt.py
test_getpass.py
test_gettext.py
test_glob.py
test_global.py
test_grammar.py
test_graphlib.py
test_grp.py
test_gzip.py
test_hash.py
test_hashlib.py bpo-40637: Don't test builtin PBKDF2 without builtin hashes (GH-20980) 2020-11-17 15:40:35 +01:00
test_heapq.py
test_hmac.py
test_html.py
test_htmlparser.py
test_http_cookiejar.py bpo-38976: Add support for HTTP Only flag in MozillaCookieJar (#17471) 2020-10-23 15:48:55 -07:00
test_http_cookies.py
test_httplib.py
test_httpservers.py
test_idle.py
test_imaplib.py
test_imghdr.py
test_imp.py
test_index.py
test_inspect.py
test_int.py
test_int_literal.py
test_interpreters.py
test_io.py bpo-41919: Avoid resource leak in test_io (GH-22973) 2020-10-25 18:38:33 +00:00
test_ioctl.py
test_ipaddress.py
test_isinstance.py
test_iter.py
test_iterlen.py
test_itertools.py
test_keyword.py
test_keywordonlyarg.py
test_kqueue.py
test_largefile.py
test_lib2to3.py
test_linecache.py
test_list.py
test_listcomps.py
test_lltrace.py
test_locale.py
test_logging.py bpo-26789: Fix logging.FileHandler._open() at exit (GH-23053) 2020-11-02 23:17:46 +01:00
test_long.py
test_longexp.py
test_lzma.py
test_mailbox.py
test_mailcap.py
test_marshal.py
test_math.py
test_memoryio.py
test_memoryview.py
test_metaclass.py
test_mimetypes.py bpo-42208: Add _locale._get_locale_encoding() (GH-23052) 2020-10-31 01:32:11 +01:00
test_minidom.py
test_mmap.py
test_module.py
test_modulefinder.py
test_msilib.py
test_multibytecodec.py
test_multiprocessing_fork.py
test_multiprocessing_forkserver.py
test_multiprocessing_main_handling.py
test_multiprocessing_spawn.py
test_named_expressions.py bpo-42381: Allow walrus in set literals and set comprehensions (GH-23332) 2020-11-17 01:17:12 +00:00
test_netrc.py
test_nis.py
test_nntplib.py
test_ntpath.py
test_numeric_tower.py
test_opcache.py bpo-42266: Handle monkey-patching descriptors in LOAD_ATTR cache (GH-23157) 2020-11-05 09:23:15 +00:00
test_opcodes.py bpo-42246: Partial implementation of PEP 626. (GH-23113) 2020-11-12 09:43:29 +00:00
test_openpty.py
test_operator.py
test_optparse.py
test_ordered_dict.py
test_os.py bpo-41625: Skip os.splice() tests on AIX (GH-23354) 2020-11-17 23:08:10 +01:00
test_ossaudiodev.py
test_osx_env.py
test_pathlib.py bpo-23706: Add newline parameter to pathlib.Path.write_text (GH-22420) (GH-22420) 2020-10-20 19:08:19 -07:00
test_pdb.py bpo-42246: Partial implementation of PEP 626. (GH-23113) 2020-11-12 09:43:29 +00:00
test_peepholer.py bpo-42057: Add regression test to master. (GH-22893) 2020-10-23 00:42:26 +09:00
test_pickle.py
test_picklebuffer.py
test_pickletools.py
test_pipes.py
test_pkg.py
test_pkgutil.py
test_platform.py bpo-41100: Support macOS 11 and Apple Silicon (GH-22855) 2020-11-08 10:05:27 +01:00
test_plistlib.py bpo-42103: Improve validation of Plist files. (GH-22882) 2020-11-02 23:01:40 +02:00
test_poll.py
test_popen.py
test_poplib.py
test_positional_only_arg.py
test_posix.py bpo-41100: Support macOS 11 and Apple Silicon (GH-22855) 2020-11-08 10:05:27 +01:00
test_posixpath.py
test_pow.py
test_pprint.py
test_print.py
test_profile.py
test_property.py
test_pstats.py
test_pty.py
test_pulldom.py
test_pwd.py
test_py_compile.py
test_pyclbr.py bpo-39411: pyclbr rewrite on AST (#18103) 2020-11-11 10:14:12 +03:00
test_pydoc.py
test_pyexpat.py
test_queue.py
test_quopri.py
test_raise.py
test_random.py
test_range.py
test_re.py
test_readline.py
test_regrtest.py
test_repl.py
test_reprlib.py
test_resource.py
test_richcmp.py
test_rlcompleter.py
test_robotparser.py
test_runpy.py
test_sax.py
test_sched.py
test_scope.py
test_script_helper.py
test_secrets.py
test_select.py
test_selectors.py
test_set.py
test_setcomps.py
test_shelve.py bpo-34204: Use pickle.DEFAULT_PROTOCOL in shelve (GH-19639) 2020-10-29 02:44:35 -07:00
test_shlex.py
test_shutil.py bpo-40592: shutil.which will not return None anymore if ; is the last char in PATHEXT (GH-20088) 2020-10-23 11:08:24 +01:00
test_signal.py
test_site.py
test_slice.py
test_smtpd.py
test_smtplib.py
test_smtpnet.py
test_sndhdr.py
test_socket.py bpo-42172: Correct typo for test_socket.py (GH-23013) 2020-10-30 15:03:51 +09:00
test_socketserver.py Revert "bpo-37193: remove thread objects which finished process its request (GH-13893)" (GH-23107) 2020-11-02 16:48:56 +00:00
test_sort.py
test_source_encoding.py
test_spwd.py
test_sqlite.py
test_ssl.py bpo-41561: skip test_min_max_version_mismatch (GH-22308) 2020-11-18 13:10:53 +01:00
test_startfile.py
test_stat.py
test_statistics.py
test_strftime.py
test_string.py
test_string_literals.py
test_stringprep.py
test_strptime.py
test_strtod.py
test_struct.py
test_structmembers.py
test_structseq.py
test_subclassinit.py
test_subprocess.py bpo-42146: Fix memory leak in subprocess.Popen() in case of uid/gid overflow (GH-22966) 2020-10-25 17:09:32 -07:00
test_sunau.py
test_sundry.py
test_super.py
test_support.py
test_symtable.py
test_syntax.py bpo-42218: Correctly handle errors in left-recursive rules (GH-23065) 2020-10-31 20:31:41 +02:00
test_sys.py bpo-42085: Introduce dedicated entry in PyAsyncMethods for sending values (#22780) 2020-11-10 12:09:55 -08:00
test_sys_setprofile.py
test_sys_settrace.py bpo-42246: Eliminate jumps to exit blocks by copying those blocks. (#23251) 2020-11-12 19:49:33 +00:00
test_sysconfig.py
test_syslog.py
test_tabnanny.py
test_tarfile.py
test_tcl.py bpo-42318: Fix support of non-BMP characters in Tkinter on macOS (GH-23281) 2020-11-15 18:16:59 +02:00
test_telnetlib.py
test_tempfile.py tempfile: Use random.choises() instead of choise() (GH-23068) 2020-11-01 20:02:03 +09:00
test_textwrap.py
test_thread.py
test_threadedtempfile.py
test_threading.py bpo-42350: Fix Thread._reset_internal_locks() (GH-23268) 2020-11-16 15:20:34 +01:00
test_threading_local.py
test_threadsignals.py
test_time.py bpo-41100: Support macOS 11 and Apple Silicon (GH-22855) 2020-11-08 10:05:27 +01:00
test_timeit.py
test_timeout.py
test_tix.py
test_tk.py
test_tokenize.py
test_trace.py
test_traceback.py bpo-26389: Allow passing an exception object in the traceback module (GH-22610) 2020-11-05 22:18:44 +00:00
test_tracemalloc.py
test_ttk_guionly.py
test_ttk_textonly.py
test_tuple.py
test_turtle.py
test_type_comments.py
test_typechecks.py
test_types.py bpo-42233: Add union type expression support for GenericAlias and fix de-duplicating of GenericAlias (GH-23077) 2020-11-08 20:00:13 -08:00
test_typing.py bpo-42345: Fix three issues with typing.Literal parameters (GH-23294) 2020-11-16 18:23:19 -08:00
test_ucn.py
test_unary.py
test_unicode.py bpo-41100: Support macOS 11 and Apple Silicon (GH-22855) 2020-11-08 10:05:27 +01:00
test_unicode_file.py
test_unicode_file_functions.py
test_unicode_identifiers.py
test_unicodedata.py
test_unittest.py
test_univnewlines.py
test_unpack.py
test_unpack_ex.py
test_unparse.py
test_urllib.py
test_urllib2.py
test_urllib2_localnet.py
test_urllib2net.py
test_urllib_response.py
test_urllibnet.py
test_urlparse.py
test_userdict.py
test_userlist.py
test_userstring.py
test_utf8_mode.py bpo-42236: os.device_encoding() respects UTF-8 Mode (GH-23119) 2020-11-04 11:20:10 +01:00
test_utf8source.py
test_uu.py
test_uuid.py
test_venv.py
test_wait3.py
test_wait4.py
test_wave.py
test_weakref.py
test_weakset.py
test_webbrowser.py
test_winconsoleio.py
test_winreg.py
test_winsound.py
test_with.py
test_wsgiref.py
test_xdrlib.py
test_xml_dom_minicompat.py
test_xml_etree.py bpo-40624: Add support for the XPath != operator in xml.etree (GH-22147) 2020-11-09 08:02:39 +01:00
test_xml_etree_c.py
test_xmlrpc.py
test_xmlrpc_net.py
test_xxtestfuzz.py
test_yield_from.py
test_zipapp.py
test_zipfile.py bpo-42043: Add support for zipfile.Path subclasses (#22716) 2020-10-25 14:45:05 -04:00
test_zipfile64.py
test_zipimport.py bpo-42131: Add PEP 451-related methods to zipimport (GH-23187) 2020-11-13 15:14:58 -08:00
test_zipimport_support.py
test_zlib.py
testcodec.py
testtar.tar
tf_inherit_check.py
time_hashlib.py
tokenize_tests-latin1-coding-cookie-and-utf8-bom-sig.txt
tokenize_tests-no-coding-cookie-and-utf8-bom-sig-only.txt
tokenize_tests-utf8-coding-cookie-and-no-utf8-bom-sig.txt
tokenize_tests-utf8-coding-cookie-and-utf8-bom-sig.txt
tokenize_tests.txt
win_console_handler.py
xmltests.py
zip_cp437_header.zip
zipdir.zip