Commit Graph

104 Commits

Author SHA1 Message Date
Victor Stinner cf736f4e98 Issue #20505: Use even shorter sleep in test_timeout_rounding() to make the
test more reliable (= fail more often on Windows with HPET enabled).
2014-02-10 19:17:46 +01:00
Victor Stinner 1c143b19c8 Issue #20505: Add debug info to analyze sporaric failures of
test_timeout_rounding() on Windows XP buildbots.
2014-02-10 11:47:50 +01:00
Victor Stinner dc62b7e261 asyncio: Tulip issue 112: Inline make_handle() into Handle constructor 2014-02-10 00:45:44 +01:00
Victor Stinner 0c3949c963 asyncio: Remove Process.subprocess attribute; it's too easy to get inconsistent
Process and Popen objects
2014-02-09 02:51:40 +01:00
Guido van Rossum 313f829ce8 asyncio: Test fix. 2014-02-08 17:35:09 -08:00
Victor Stinner 87bf2772be asyncio tests: Remove scories of resolution/granularity 2014-02-09 01:25:52 +01:00
Victor Stinner 85310a50a9 Issue #20505: Remove resolution and _granularity from selectors and asyncio
* Remove selectors.BaseSelector.resolution attribute
* Remove asyncio.BaseEventLoop._granularity attribute
2014-02-07 23:34:58 +01:00
Yury Selivanov 622be340fd asyncio.tasks: Fix as_completed, gather & wait to work with duplicate coroutines 2014-02-06 22:06:16 -05:00
Yury Selivanov f0020f5d77 asyncio.streams.StreamReader: Add 'at_eof()' method 2014-02-06 00:14:30 -05:00
Yury Selivanov e694c9745f asyncio.streams: Use bytebuffer in StreamReader; Add assertion in feed_data 2014-02-05 18:11:13 -05:00
Guido van Rossum 3b55f0c622 asyncio: Cosmetic improvement to test__run_once_logging() mock argument. 2014-02-04 14:27:14 -08:00
Victor Stinner 1703bbbf89 Oops, undo unwanted changes in test_asyncio: mistakes of my the last sync with
Tulip (changeset d7ac90c0463a)
2014-02-03 23:59:52 +01:00
Victor Stinner b79eb0502c asyncio.subprocess: Replace Process.get_subprocess() method with a
Process.subprocess read-only property
2014-02-03 23:08:14 +01:00
Victor Stinner 9dd39f524d Issue #20472: test_asyncio: skip PTY tests on Mac OS X older than 10.6 2014-02-03 00:32:13 +01:00
Victor Stinner 915bcb0111 Issue #20400: Merge Tulip into Python: add the new asyncio.subprocess module
* Add a new asyncio.subprocess module
* Add new create_subprocess_exec() and create_subprocess_shell() functions
* The new asyncio.subprocess.SubprocessStreamProtocol creates stream readers
  for stdout and stderr and a stream writer for stdin.
* The new asyncio.subprocess.Process class offers an API close to the
  subprocess.Popen class:

  - pid, returncode, stdin, stdout and stderr attributes
  - communicate(), wait(), send_signal(), terminate() and kill() methods

* Remove STDIN (0), STDOUT (1) and STDERR (2) constants from base_subprocess
  and unix_events, to not be confused with the symbols with the same name of
  subprocess and asyncio.subprocess modules
* _ProactorBasePipeTransport.get_write_buffer_size() now counts also the size
  of the pending write
* _ProactorBaseWritePipeTransport._loop_writing() may now pause the protocol if
  the write buffer size is greater than the high water mark (64 KB by default)
2014-02-01 22:49:59 +01:00
Victor Stinner a0aa88ce89 test_asyncio: relax timing, the "AMD64 Windows Server 2008 [SB] 3.x" buildbot
looks to be slow
2014-02-01 04:11:16 +01:00
Victor Stinner 55effc6dd0 Issue #20452: Fix test_time_and_call_at() of test_asyncio on Windows
Use the granularity to check the minimum time delta, instead of arbitrary
value.
2014-02-01 02:18:52 +01:00
Victor Stinner 1144214639 Issue #20452: test_asyncio checks also the granularity 2014-02-01 02:17:54 +01:00
Victor Stinner 62510dced9 Issue #20452: test_asyncio: Add more info if the test fails 2014-01-31 16:39:10 +01:00
Victor Stinner 1506df2655 Issue #20455: Add a resolution attribute to IocpProactor (1 ms) 2014-01-31 16:26:38 +01:00
Victor Stinner 49d0f4e428 Issue #20452: Remove debug code, no more needed 2014-01-31 12:59:43 +01:00
Victor Stinner dcd9740ad2 Issue #20452: select and selectors round (again) timeout away from zero for
poll and epoll

Improve also debug info to analyze the issue
2014-01-31 12:12:53 +01:00
Victor Stinner 31f65044a9 Issue #20452: Oops, fix debug code :-/
Add also event more debug info
2014-01-31 10:55:55 +01:00
Victor Stinner 0278032110 Issue #20452: add more info in case of test_asyncio failure to try to debug the
failure on buildbot "x86 Ubuntu Shared 3.x"
2014-01-31 09:29:35 +01:00
Guido van Rossum a849be9c64 asyncio: Fix misc whitespace issues. 2014-01-30 16:05:28 -08:00
Victor Stinner 9572898282 asyncio: Future.set_exception(exc) should instantiate exc if it is a class. 2014-01-30 16:01:54 -08:00
Victor Stinner e623a12297 asyncio: subprocess_shell() and subprocess_exec() now raise ValueError instead of assert.
Moreover, bufsize different than 0 is now considered as an error.
2014-01-29 14:35:15 -08:00
Guido van Rossum 48c66c3dd8 asyncio: wait_for() now accepts None as timeout (Victor Stinner). 2014-01-29 14:30:38 -08:00
Guido van Rossum fef7098ef9 asyncio: Rename {Empty,Full} to {QueueEmpty,QueueFull} and no longer get them from queue.py. 2014-01-25 17:24:51 -08:00
Guido van Rossum ab3c88983b asyncio: Locks refactor: use a separate context manager; remove Semaphore._locked. 2014-01-25 16:51:57 -08:00
Victor Stinner 669eeaf933 Merge latest Tulip into asyncio
- Make the new granularity attribute private
- Simplify BaseEventLoop._run_once(): avoid math.ceil(), use simple arithmetic
  instead
2014-01-26 00:02:31 +01:00
Victor Stinner 128ee220e2 asyncio: Don't export BaseEventLoop, BaseSelectorEventLoop nor
BaseProactorEventLoop

Import them from submodules if you really need them.
2014-01-25 22:22:18 +01:00
Victor Stinner 8dffc456d7 Update asyncio from the Tulip project
Major changes:

- StreamReader.readexactly() now raises an IncompleteReadError if the
  end of stream is reached before we received enough bytes, instead of
  returning less bytes than requested.

- Unit tests use the main asyncio module instead of submodules like events

- _UnixWritePipeTransport now also supports character devices, as
  _UnixReadPipeTransport. Patch written by Jonathan Slenders.

- Export more symbols: BaseEventLoop, BaseProactorEventLoop,
  BaseSelectorEventLoop, Queue and Queue sublasses, Empty, Full
2014-01-25 15:32:06 +01:00
Victor Stinner f67255ab94 Issue #20311: asyncio: Add a granularity attribute to BaseEventLoop: maximum
between the resolution of the BaseEventLoop.time() method and the resolution of
the selector. The granuarility is used in the scheduler to round time and
deadline.
2014-01-25 15:01:33 +01:00
Victor Stinner 421e49b5c1 asyncio: wait_for() now cancels the future on timeout. Patch written by Gustavo
Carneiro.
2014-01-23 17:40:59 +01:00
Victor Stinner 8ce6e1100e Close #20365: Skip test_asyncio.test_events.test_read_pty_output() on Mac OS X
older than 10.9 (Maverick). kqueue doesn't support character devices (PTY) on
Mac OS X older than 10.9.
2014-01-23 17:26:06 +01:00
Victor Stinner 5e42354263 Fix ResourceWarning in test_asyncio.test_windows_events:
close the write end of the socket pair
2014-01-11 00:16:50 +01:00
Guido van Rossum 02757ea7e9 asyncio: Minimal pty support in UNIX read pipe, by Jonathan Slenders. 2014-01-10 13:30:04 -08:00
Guido van Rossum 9ba75db3c5 asyncio: Clean up formatting. 2013-12-19 13:49:32 -08:00
Victor Stinner 4c3c699e62 Close #19967: Thanks to the PEP 442, asyncio.Future can use a destructor in
Python 3.4 to log "uncatched" exceptions, instead of the dedicated
_TracebackLogger class.
2013-12-19 22:42:40 +01:00
Guido van Rossum 994bf4332f Shorten lines. 2013-12-19 12:47:38 -08:00
Christian Heimes a5f0eda91a Skip some tests that require server name indication (SNI) 2013-12-15 17:02:36 +01:00
Victor Stinner 24bd028092 Issue #19952: test_asyncio: relax timings of Windows events, buildbots are
sometimes busy
2013-12-13 02:45:18 +01:00
Zachary Ware 101d9e7250 Issue 19572: More silently skipped tests explicitly skipped. 2013-12-08 00:44:27 -06:00
Christian Heimes cd6f61137a copy 'n paste typo (thx Antoine) 2013-12-07 00:14:55 +01:00
Christian Heimes b82c915fa2 Skip new SSL tests with IocpEventLoop 2013-12-07 00:09:45 +01:00
Guido van Rossum 1a605ed5a3 asyncio: Add Task.current_task() class method. 2013-12-06 12:57:40 -08:00
Christian Heimes 6d8c1abb00 Issue #19509: Finish implementation of check_hostname
The new asyncio package now supports the new feature and comes with additional tests for SSL.
2013-12-06 00:23:13 +01:00
Guido van Rossum ebb8e58f0a asyncio: Write flow control for proactor event loop. 2013-12-04 12:12:07 -08:00
Guido van Rossum f10345e102 asyncio: Improve default writelines(). 2013-12-02 18:36:30 -08:00