Commit Graph

31 Commits

Author SHA1 Message Date
Victor Stinner 211a392cc1 bpo-30320: test_eintr now uses pthread_sigmask() (#1523)
Rewrite sigwaitinfo() and sigtimedwait() unit tests for EINTR using
pthread_sigmask() to fix a race condition between the child and the
parent process.

Remove the pipe which was used as a weak workaround against the race
condition.

sigtimedwait() is now tested with a child process sending a signal
instead of testing the timeout feature which is more unstable
(especially regarding to clock resolution depending on the platform).
2017-05-10 02:37:42 +02:00
Victor Stinner 5de85a1702 bpo-29972: Skip tests known to fail on AIX (#979)
* bpo-29972: Fix test_eintr on AIX

On AIX, sigtimedwait(0.2) sleeps 199.8 ms, whereas the test expects
200 ms or longer.

* bpo-29972: Skip some inet_pton() tests on AIX

Skip some inet_pton() tests of test_socket on AIX.

inet_pton() on AIX is less strict than on Linux and doesn't reject
some invalid IP addresses. The unit tests test more the libc than
Python itself.

* bpo-29972: Skip tests known to fail on AIX

* test_locale.test_strcoll_with_diacritic()
* test_locale.test_strxfrm_with_diacritic()
* test_strptime.test_week_of_year_and_day_of_week_calculation()
* test_tools.test_POT_Creation_Date()
2017-04-04 10:35:15 +02:00
Ned Deily de04644627 bpo-28087: Skip test_asyncore and test_eintr poll failures on macOS. (#462)
* bpo-28087: Skip test_asyncore and test_eintr poll failures on macOS

Skip some tests of select.poll when running on macOS due to unresolved
issues with the underlying system poll function on some macOS versions.
2017-03-04 06:00:37 -05:00
Xavier de Gaye 3a4e989324 Issue #28759: Fix the tests that fail with PermissionError when run as
a non-root user on Android where access rights are controled by SELinux MAC.
2016-12-13 10:00:01 +01:00
Victor Stinner c50cccfcc3 test_eintr: Fix ResourceWarning warnings 2016-09-10 04:19:48 -04:00
Martin Panter 8bde911115 Issue #27626: Merge spelling fixes from 3.5 2016-07-28 01:30:58 +00:00
Martin Panter eb9957065a Issue #27626: Spelling fixes in docs, comments and internal names
Based on patch by Ville Skyttä.
2016-07-28 01:11:04 +00:00
Serhiy Storchaka a6f26c1d34 Remove more unused imports in tests. 2016-04-25 00:05:30 +03:00
Brett Cannon 4b18dd339a Issue #25234: Skip test_eintr.test_open() under OS X to avoid hanging 2016-01-22 15:55:56 -08:00
Brett Cannon 838629a1fe Issue #25234: Skip test_eintr.test_os_open under OS X.
Test inconsistently hangs.
2015-12-28 17:23:35 -08:00
Victor Stinner 129a414490 Issue #25868: Try to make test_eintr.test_sigwaitinfo() more reliable
especially on slow buildbots

Use a pipe to synchronize the parent and the child processes.
2015-12-15 11:29:59 +01:00
Victor Stinner 397c42b8cc Merge 3.5 (test_eintr) 2015-10-12 23:37:31 +02:00
Victor Stinner 60f26691f5 Issue #25277: Use a longer sleep in test_eintr to reduce the risk of race
condition in test_eintr.
2015-10-12 23:37:02 +02:00
Victor Stinner 647dac9d6f Close #25368: Fix test_eintr when Python is compiled without thread support 2015-10-11 09:47:17 +02:00
Victor Stinner 98f223dfa0 Issue #25277: Set a timeout of 10 minutes in test_eintr using faulthandler to
try to debug a hang on the FreeBSD 9 buildbot.

Run also eintr_tester.py with python "-u" command line option to try to get the
full output on hang/crash.
2015-10-01 13:16:43 +02:00
Victor Stinner 6dae395ed5 Issue #25122: test_eintr: the FreeBSD fix will be released in FreeBSD 10.3 2015-09-21 14:05:02 +02:00
Victor Stinner 4b352171d2 Issue #25122: sync test_eintr with Python 3.6
* test_eintr: support verbose mode, don't redirect eintr_tester output into
  a pipe
* eintr_tester: replace os.fork() with subprocess to have a cleaner child
  process (ex: don't inherit setitimer())
* eintr_tester: kill the process if the unit test fails
* test_open/test_os_open(): write support.PIPE_MAX_SIZE bytes instead of
  support.PIPE_MAX_SIZE*3 bytes
2015-09-18 11:29:16 +02:00
Victor Stinner 45ca48b03d Issue #23485: select.devpoll.poll() is now retried when interrupted by a signal 2015-03-31 12:10:33 +02:00
Victor Stinner 4448c08451 Issue #23485: select.kqueue.control() is now retried when interrupted by a signal 2015-03-31 11:48:34 +02:00
Victor Stinner 41eba224de Issue #23485: select.epoll.poll() is now retried when interrupted by a signal 2015-03-30 21:59:21 +02:00
Victor Stinner 3c7d6e0693 Issue #23485: select.poll.poll() is now retried when interrupted by a signal 2015-03-30 21:38:00 +02:00
Victor Stinner f70e1ca0fc Issue #23485: select.select() is now retried automatically with the recomputed
timeout when interrupted by a signal, except if the signal handler raises an
exception. This change is part of the PEP 475.

The asyncore and selectors module doesn't catch the InterruptedError exception
anymore when calling select.select(), since this function should not raise
InterruptedError anymore.
2015-03-30 21:16:11 +02:00
Victor Stinner 59f6342c97 Issue #23715: Fix test_sigtimedwait() of test_eintr
sigtimedwait([], timeout) fails with OSError(EINVAL) on OpenIndiana, wait for a
signal which will never be received instead.
2015-03-27 14:32:22 +01:00
Victor Stinner 03129230c9 Issue #23715: Fix test_eintr, skip tests on signal.sigwaitinfo() and
signal.sigtimedwait() if functions are missing
2015-03-20 13:42:52 +01:00
Victor Stinner a453cd8d85 Issue #23715: signal.sigwaitinfo() and signal.sigtimedwait() are now retried
when interrupted by a signal not in the *sigset* parameter, if the signal
handler does not raise an exception. signal.sigtimedwait() recomputes the
timeout with a monotonic clock when it is retried.

Remove test_signal.test_sigwaitinfo_interrupted() because sigwaitinfo() doesn't
raise InterruptedError anymore if it is interrupted by a signal not in its
sigset parameter.
2015-03-20 12:54:28 +01:00
Victor Stinner 9a8089b32a Issue #23646: Enhance precision of time.sleep() and socket timeout when
interrupted by a signal

Add a new _PyTime_AddDouble() function and remove _PyTime_ADD_SECONDS() macro.
The _PyTime_ADD_SECONDS only supported an integer number of seconds, the
_PyTime_AddDouble() has subsecond resolution.
2015-03-20 01:42:20 +01:00
Victor Stinner 79d68f929d Issue #23646: If time.sleep() is interrupted by a signal, the sleep is now
retried with the recomputed delay, except if the signal handler raises an
exception (PEP 475).

Modify also test_signal to use a monotonic clock instead of the system clock.
2015-03-19 21:54:09 +01:00
Victor Stinner 0c2fd89777 Revert changeset d927047b1d8eb87738676980a24930d053ba2150
Sorry, it was a mistake, the patch is still under review: issue #23646.
2015-03-17 10:49:17 +01:00
Victor Stinner 945c82eea3 test 2015-03-12 16:19:01 +01:00
Charles-François Natali 6e6c59b508 Issue #23285: PEP 475 -- Retry system calls failing with EINTR. 2015-02-07 13:27:50 +00:00
Victor Stinner 8f475effbc Backport fixes on test_eintr
* Issue #25234: Skip test_eintr.test_open() under OS X to avoid hanging
* Issue #25868: Try to make test_eintr.test_sigwaitinfo() more reliable
  especially on slow buildbots. Use a pipe to synchronize the parent and the
  child processes.
2016-01-28 18:13:45 +01:00