summaryrefslogtreecommitdiffstats
path: root/Lib/test/libregrtest
Commit message (Collapse)AuthorAgeFilesLines
* Revert "bpo-28533: Remove asyncore, asynchat, smtpd modules (GH-29521)" ↵Victor Stinner2021-12-071-1/+11
| | | | | (GH-29951) This reverts commit 9bf2cbc4c498812e14f20d86acb61c53928a5a57.
* bpo-28533: Remove asyncore, asynchat, smtpd modules (GH-29521)Victor Stinner2021-11-151-11/+1
| | | | | | | | | | | | | | | | Remove the asyncore and asynchat modules, deprecated in Python 3.6: use the asyncio module instead. Remove the smtpd module, deprecated in Python 3.6: the aiosmtpd module can be used instead, it is based on asyncio. * Remove asyncore, asynchat and smtpd documentation * Remove test_asyncore, test_asynchat and test_smtpd * Rename Lib/asynchat.py to Lib/test/support/_asynchat.py * Rename Lib/asyncore.py to Lib/test/support/_asyncore.py * Rename Lib/smtpd.py to Lib/test/support/_smtpd.py * Remove DeprecationWarning from private _asyncore, _asynchat and _smtpd modules * _smtpd: remove deprecated properties
* bpo-45745: Remove regrtest --findleaks options (GH-29514)Victor Stinner2021-11-123-10/+3
| | | | | Remove the --findleaks command line option of regrtest: use the --fail-env-changed option instead. Since Python 3.7, it was a deprecated alias to the --fail-env-changed option.
* bpo-10572: Fixup Lib/test/libregrtest/pgo.py (GH-29327)Erlend Egeberg Aasland2021-11-011-1/+1
|
* bpo-43592: Raise RLIMIT_NOFILE in test.libregrtest (GH-29127)Gregory P. Smith2021-10-221-0/+24
| | | | | | | Raise RLIMIT_NOFILE in test.libregrtest. On macOS the default is often too low for our testsuite to succeed. Co-authored by reviewer: Victor Stinner
* bpo-45410: regrtest replaces print_warning.orig_stderr (GH-28926)Victor Stinner2021-10-132-3/+13
| | | | | | When running Python tests with -W, runtest() now replaces support.print_warning.orig_stderr to preserve the messages order. Add an unit test.
* bpo-45410: regrtest -W leaves stdout/err FD unchanged (GH-28915)Victor Stinner2021-10-135-67/+12
| | | | | | | | | | | | support.print_warning() now stores the original value of sys.__stderr__ and uses it to log warnings. libregrtest uses the same stream to log unraisable exceptions and uncaught threading exceptions. Partially revert commit dbe213de7ef28712bbfdb9d94a33abb9c33ef0c2: libregrtest no longer replaces sys.__stdout__, sys.__stderr__, and stdout and stderr file descriptors. Remove also a few unused imports in libregrtest.
* bpo-45410: Enhance libregrtest -W/--verbose3 option (GH-28908)Victor Stinner2021-10-122-14/+69
| | | | | | | | | | | libregrtest -W/--verbose3 now also replace sys.__stdout__, sys.__stderr__, and stdout and stderr file descriptors (fd 1 and fd 2). support.print_warning() messages are now logged in the expected order. The "./python -m test test_eintr -W" command no longer logs into stdout if the test pass.
* bpo-45410: Add test.support.flush_std_streams() (GH-28885)Victor Stinner2021-10-111-9/+2
| | | support.print_warning() now flushs sys.stdout.
* bpo-45410: libregrtest -jN writes stderr into stdout (GH-28819)Victor Stinner2021-10-081-22/+18
| | | | | | When libregrtest spawns a worker process, stderr is now written into stdout to keep messages order. Use a single pipe for stdout and stderr, rather than two pipes. Previously, messages were out of order which made analysis of buildbot logs harder
* Fix typos in the Lib directory (GH-28775)Christian Clauss2021-10-061-1/+1
| | | | | Fix typos in the Lib directory as identified by codespell. Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
* bpo-45118: Fix regrtest second summary for re-run tests (GH-28183)Victor Stinner2021-09-071-4/+7
| | | | Fix regrtest second summary when using -w/--verbose2 command line option: lists re-run tests in the second test summary.
* bpo-44895: libregrtest: refleak check clears types later (GH-28113)Victor Stinner2021-09-013-14/+15
| | | | | | | | | | | libregrtest now clears the type cache later to reduce the risk of false alarm when checking for reference leaks. Previously, the type cache was cleared too early and libregrtest raised a false alarm about reference leaks under very specific conditions. Move also support.gc_collect() outside clear/cleanup functions to make the garbage collection more explicit. Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
* bpo-44708: Only re-run test methods that match names of previously failing ↵Łukasz Langa2021-07-224-162/+312
| | | | | | | | | | | test methods (GH-27287) * Move to a static argparse.Namespace subclass * Roughly annotate runtest.py * Refactor libregrtest to use lossless test result objects * Only re-run test methods that match names of previously failing test methods * Adopt tests to cover test method name matching Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
* bpo-44647: Add a permanent Unicode-valued env var to regrtest (#27187)Łukasz Langa2021-07-161-0/+10
|
* Remove sys._deactivate_opcache() now that is not needed (GH-27154)Pablo Galindo Salgado2021-07-151-1/+0
|
* Delete line that was accidentally copied. (GH-26624)Mark Shannon2021-06-091-1/+0
|
* bpo-44187: Quickening infrastructure (GH-26264)Mark Shannon2021-06-071-2/+3
| | | | | | | | | | | | | | * Add co_firstinstr field to code object. * Implement barebones quickening. * Use non-quickened bytecode when tracing. * Add NEWS item * Add new file to Windows build. * Don't specialize instructions with EXTENDED_ARG.
* bpo-43843: libregrtest uses threading.excepthook (GH-25400)Victor Stinner2021-04-162-1/+36
| | | | | | | | | test.libregrtest now marks a test as ENV_CHANGED (altered the execution environment) if a thread raises an exception but does not catch it. It sets a hook on threading.excepthook. Use --fail-env-changed option to mark the test as failed. libregrtest regrtest_unraisable_hook() explicitly flushs sys.stdout, sys.stderr and sys.__stderr__.
* bpo-41718: libregrtest avoids importing datetime (GH-24985)Victor Stinner2021-03-231-3/+5
| | | | * libregrtest reimplements datetime.timedelta.__str__() * support.testresult only imports datetime if USE_XML is true.
* bpo-41718: Disable support.testresult XML output by default (GH-24982)Victor Stinner2021-03-231-0/+4
| | | | | | | RegressionTestResult.USE_XML must now be set to True to get the JUnit XML output. Reduce the number of imports when --junit-xml=FILE option is not used: 153 => 144 (-9).
* bpo-41718: libregrtest runtest avoids import_helper (GH-24983)Victor Stinner2021-03-231-2/+4
| | | | Inline import_helper.unload() in libregrtest.runtest to avoid one import.
* bpo-41718: Reduce libregrtest runtest imports (GH-24980)Victor Stinner2021-03-223-97/+107
| | | | | | Move clear_caches() from libregrtest.refleak to libregrtest.utils to avoid importing libregrtest.refleak when it's not needed. clear_caches() now only calls re.purge() if 're' is in sys.modules.
* bpo-41718: regrtest saved_test_environment avoids imports (GH-24934)Victor Stinner2021-03-222-42/+69
| | | | | | | | | | | | | | | | | | | | | | | | | Reduce the number of modules imported by libregrtest. saved_test_environment no longer imports modules at startup, but try to get them from sys.modules. If an module is missing, skip the test. It also sets directly support.environment_altered. runtest() now now two saved_test_environment instances: one before importing the test module, one after importing it. Remove imports from test.libregrtest.save_env: * asyncio * logging * multiprocessing * shutil * sysconfig * urllib.request * warnings When a test method imports a module (ex: warnings) and the test has a side effect (ex: add a warnings filter), the side effect is not detected, because the module was not imported when Python enters the saved_test_environment context manager.
* bpo-37146: Deactivate opcode cache only when using huntrleaks in the test ↵Pablo Galindo2021-02-281-0/+1
| | | | suite (GH-24643)
* bpo-42128: Structural Pattern Matching (PEP 634) (GH-22917)Brandt Bucher2021-02-261-0/+1
| | | | | Co-authored-by: Guido van Rossum <guido@python.org> Co-authored-by: Talin <viridia@gmail.com> Co-authored-by: Pablo Galindo <pablogsal@gmail.com>
* bpo-40275: Use new test.support helper submodules in tests (GH-21785)Hai Shi2020-08-081-3/+3
|
* bpo-40275: Use new test.support helper submodules in tests (GH-21772)Hai Shi2020-08-072-4/+8
|
* bpo-38912: regrtest logs unraisable exception into sys.__stderr__ (GH-21718)Victor Stinner2020-08-031-1/+6
| | | | regrtest_unraisable_hook() temporarily replaces sys.stderr with sys.__stderr__ to help to display errors when a test captures stderr.
* bpo-40275: Use new test.support helper submodules in tests (GH-21219)Hai Shi2020-06-303-8/+10
|
* bpo-41069: Make TESTFN and the CWD for tests containing non-ascii ↵Serhiy Storchaka2020-06-251-0/+1
| | | | characters. (GH-21035)
* bpo-40275: Use new test.support helper submodules in tests (GH-20849)Hai Shi2020-06-253-4/+8
|
* bpo-41043: Escape literal part of the path for glob(). (GH-20994)Serhiy Storchaka2020-06-201-1/+1
|
* bpo-40826: Fix test_repl.test_close_stdin() on Windows (GH-20779)Victor Stinner2020-06-101-26/+1
| | | | | | | | | | | | test_repl.test_close_stdin() now calls support.suppress_msvcrt_asserts() to fix the test on Windows. * Move suppress_msvcrt_asserts() from test.libregrtest.setup to test.support. Make its verbose parameter optional: verbose=False by default. * Add msvcrt.GetErrorMode(). * SuppressCrashReport now uses GetErrorMode() and SetErrorMode() of the msvcrt module, rather than using ctypes. * Remove also an unused variable (deadline) in wait_process().
* bpo-39983: Add test.support.print_warning() (GH-19683)Victor Stinner2020-04-232-2/+2
| | | | | | | Log "Warning -- ..." test warnings into sys.__stderr__ rather than sys.stderr, to ensure to display them even if sys.stderr is captured. test.libregrtest.utils.print_warning() now calls test.support.print_warning().
* regrtest: log timeout at startup (GH-19514)Victor Stinner2020-04-142-4/+15
| | | Reduce also worker timeout.
* bpo-37957: Allow regrtest to receive a file with test (and subtests) to ↵Pablo Galindo2019-11-193-3/+17
| | | | | | | ignore (GH-16989) When building Python in some uncommon platforms there are some known tests that will fail. Right now, the test suite has the ability to ignore entire tests using the -x option and to receive a filter file using the --matchfile filter. The problem with the --matchfile option is that it receives a file with patterns to accept and when you want to ignore a couple of tests and subtests, is too cumbersome to lists ALL tests that are not the ones that you want to accept and he problem with -x is that is not easy to ignore just a subtests that fail and the whole test needs to be ignored. For these reasons, add a new option to allow to ignore a list of test and subtests for these situations.
* bpo-38614: Add timeout constants to test.support (GH-16964)Victor Stinner2019-10-301-0/+11
| | | | | | | | Add timeout constants to test.support: * LOOPBACK_TIMEOUT * INTERNET_TIMEOUT * SHORT_TIMEOUT * LONG_TIMEOUT
* bpo-38502: regrtest uses process groups if available (GH-16829)Victor Stinner2019-10-181-7/+22
| | | | | test.regrtest now uses process groups in the multiprocessing mode (-jN command line option) if process groups are available: if os.setsid() and os.killpg() functions are available.
* bpo-37531: regrtest now catchs ProcessLookupError (GH-16827)Victor Stinner2019-10-161-0/+5
| | | | Fix a warning on a race condition on TestWorkerProcess.kill(): ignore silently ProcessLookupError rather than logging an useless warning.
* bpo-37531: regrtest ignores output on timeout (GH-16659)Victor Stinner2019-10-081-27/+37
| | | | | | | | | | | bpo-37531, bpo-38207: On timeout, regrtest no longer attempts to call `popen.communicate() again: it can hang until all child processes using stdout and stderr pipes completes. Kill the worker process and ignores its output. Reenable test_regrtest.test_multiprocessing_timeout(). bpo-37531: Change also the faulthandler timeout of the main process from 1 minute to 5 minutes, for Python slowest buildbots.
* bpo-36670: Enhance regrtest (GH-16556)Victor Stinner2019-10-034-50/+89
| | | | | | | | | | | | | | * Add log() method: add timestamp and load average prefixes to main messages. * WindowsLoadTracker: * LOAD_FACTOR_1 is now computed using SAMPLING_INTERVAL * Initialize the load to the arithmetic mean of the first 5 values of the Processor Queue Length value (so over 5 seconds), rather than 0.0. * Handle BrokenPipeError and when typeperf exit. * format_duration(1.5) now returns '1.5 sec', rather than '1 sec 500 ms'
* bpo-36670: Enhance regrtest WindowsLoadTracker (GH-16553)Victor Stinner2019-10-031-26/+42
| | | | The last line is now passed to the parser even if it does not end with a newline, but only if it's a valid value.
* bpo-36670, regrtest: Fix WindowsLoadTracker() for partial line (GH-16550)Victor Stinner2019-10-021-1/+4
| | | | WindowsLoadTracker.read_output() now uses a short buffer for incomplete line.
* bpo-36670: regrtest bug fixes (GH-16537)Victor Stinner2019-10-021-10/+12
| | | | | | | | * Fix TestWorkerProcess.__repr__(): start_time is only valid if _popen is not None. * Fix _kill(): don't set _killed to True if _popen is None. * _run_process(): only set _killed to False after calling run_test_in_subprocess().
* bpo-36670: Multiple regrtest bugfixes (GH-16511)Victor Stinner2019-10-013-133/+175
| | | | | | | | | | | | | | | | * Windows: Fix counter name in WindowsLoadTracker. Counter names are localized: use the registry to get the counter name. Original change written by Lorenz Mende. * Regrtest.main() now ensures that the Windows load tracker is also killed if an exception is raised * TestWorkerProcess now ensures that worker processes are no longer running before exiting: kill also worker processes when an exception is raised. * Enhance regrtest messages and warnings: include test name, duration, add a worker identifier, etc. * Rename MultiprocessRunner to TestWorkerProcess * Use print_warning() to display warnings. Co-Authored-By: Lorenz Mende <Lorenz.mende@gmail.com>
* bpo-38203: faulthandler.dump_traceback_later() is always available (GH-16249)Victor Stinner2019-09-181-5/+0
| | | | dump_traceback_later() and cancel_dump_traceback_later() functions of the faulthandler module are always available since Python 3.7.
* bpo-38203: regrtest: put a 2 min timeout on Python exit (GH-16250)Victor Stinner2019-09-181-10/+24
|
* bpo-37531: regrtest main process uses shorter timeout (GH-16220)Victor Stinner2019-09-171-6/+6
| | | | | | When using multiprocesss (-jN), the main process now uses a timeout of 60 seconds instead of the double of the --timeout value. The buildbot server stops a job which does not produce any output in 1200 seconds.
* bpo-37936: Systematically distinguish rooted vs. unrooted in .gitignore ↵Greg Price2019-09-111-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (GH-15823) A root cause of bpo-37936 is that it's easy to write a .gitignore rule that's intended to apply to a specific file (e.g., the `pyconfig.h` generated by `./configure`) but actually applies to all similarly-named files in the tree (e.g., `PC/pyconfig.h`.) Specifically, any rule with no non-trailing slashes is applied in an "unrooted" way, to files anywhere in the tree. This means that if we write the rules in the most obvious-looking way, then * for specific files we want to ignore that happen to be in subdirectories (like `Modules/config.c`), the rule will work as intended, staying "rooted" to the top of the tree; but * when a specific file we want to ignore happens to be at the root of the repo (like `platform`), then the obvious rule (`platform`) will apply much more broadly than intended: if someone tries to add a file or directory named `platform` somewhere else in the tree, it will unexpectedly get ignored. That's surprising behavior that can make the .gitignore file's behavior feel finicky and unpredictable. To avoid it, we can simply always give a rule "rooted" behavior when that's what's intended, by systematically using leading slashes. Further, to help make the pattern obvious when looking at the file and minimize any need for thinking about the syntax when adding new rules: separate the rules into one group for each type, with brief comments identifying them. For most of these rules it's clear whether they're meant to be rooted or unrooted, but in a handful of cases I've only guessed. In that case the safer default (the choice that won't hide information) is the narrower, rooted meaning, with a leading slash. If for some of these the unrooted meaning is desired after all, it'll be easy to move them to the unrooted section at the top.