summaryrefslogtreecommitdiffstats
path: root/tokio-test/tests
AgeCommit message (Collapse)Author
2020-10-08time: rename `Delay` future to `Sleep` (#2932)Juan Alvarez
2020-10-01time: introduce `sleep` and `sleep_until` functions (#2826)Juan Alvarez
2020-08-20test: implement Drop for Mock to panic w/ unconsumed data (#2704)Blas Rodriguez Irizar
2020-04-02test: Added read_error() and write_error() (#2337)Benjamin Halsted
Enable testing of edge cases caused by io errors.
2019-12-13chore: remove benches and fix/work around clippy lints (#1952)Artem Vorotnikov
2019-11-20time: Eagerly bind delays to timer (#1800)Kevin Leimkuhler
## Motivation Similar to #1666, it is no longer necessary to lazily register delays with the executions default timer. All delays are expected to be created from within a runtime, and should panic if not done so. ## Solution `tokio::time` now assumes there to be a `CURRENT_TIMER` set when creating a delay; this can be assumed if called within a tokio runtime. If there is no current timer, the application will panic with a "no current timer" message. ## Follow-up Similar to #1666, `HandlePriv` can probably be removed, but this mainly prepares for 0.2 API changes. Because it is not in the public API, this can be done in a following change. Signed-off-by: Kevin Leimkuhler <kleimkuhler@icloud.com>
2019-11-15Limit `futures` dependency to `Stream` via feature flag (#1774)Carl Lerche
In an effort to reach API stability, the `tokio` crate is shedding its _public_ dependencies on crates that are either a) do not provide a stable (1.0+) release with longevity guarantees or b) match the `tokio` release cadence. Of course, implementing `std` traits fits the requirements. The on exception, for now, is the `Stream` trait found in `futures_core`. It is expected that this trait will not change much and be moved into `std. Since Tokio is not yet going reaching 1.0, I feel that it is acceptable to maintain a dependency on this trait given how foundational it is. Since the `Stream` implementation is optional, types that are logically streams provide `async fn next_*` functions to obtain the next value. Avoiding the `next()` name prevents fn conflicts with `StreamExt::next()`. Additionally, some misc cleanup is also done: - `tokio::io::io` -> `tokio::io::util`. - `delay` -> `delay_until`. - `Timeout::new` -> `timeout(...)`. - `signal::ctrl_c()` returns a future instead of a stream. - `{tcp,unix}::Incoming` is removed (due to lack of `Stream` trait). - `time::Throttle` is removed (due to lack of `Stream` trait). - Fix: `mpsc::UnboundedSender::send(&self)` (no more conflict with `Sink` fns).
2019-11-12reorganize modules (#1766)Carl Lerche
This patch started as an effort to make `time::Timer` private. However, in an effort to get the build compiling again, more and more changes were made. This probably should have been broken up, but here we are. I will attempt to summarize the changes here. * Feature flags are reorganized to make clearer. `net-driver` becomes `io-driver`. `rt-current-thread` becomes `rt-core`. * The `Runtime` can be created without any executor. This replaces `enter`. It also allows creating I/O / time drivers that are standalone. * `tokio::timer` is renamed to `tokio::time`. This brings it in line with `std`. * `tokio::timer::Timer` is renamed to `Driver` and made private. * The `clock` module is removed. Instead, an `Instant` type is provided. This type defaults to calling `std::time::Instant`. A `test-util` feature flag can be used to enable hooking into time. * The `blocking` module is moved to the top level and is cleaned up. * The `task` module is moved to the top level. * The thread-pool's in-place blocking implementation is cleaned up. * `runtime::Spawner` is renamed to `runtime::Handle` and can be used to "enter" a runtime context.
2019-11-06time: rename `tokio::timer` -> `tokio::time` (#1745)Carl Lerche
2019-10-21timer: move `tokio-timer` into `tokio` crate (#1674)Carl Lerche
A step towards collapsing Tokio sub crates into a single `tokio` crate (#1318). The `timer` implementation is now provided by the main `tokio` crate. The `timer` functionality may still be excluded from the build by skipping the `timer` feature flag.
2019-08-30test: fix assert format args (#1520)Geoff Shannon
2019-08-20chore: bump to newer nightly (#1485)Taiki Endo
2019-08-20timer: introduce delay function shortcut (#1440)Jakub Beránek
This commit adds a simple delay shortcut to avoid writing Delay::new everywhere and removes usages of Delay::new.
2019-08-13test: add a block_on function to tokio-test (#1431)Geoff Shannon
2019-08-10chore: change default lint level to warning and deny warnings in CI (#1416)Taiki Endo
2019-07-12tokio-test: add tokio_test::io mock builderSean McArthur
2019-06-27chore: format code and enable rustfmt CI task (#1212)Carl Lerche
2019-06-26test: get `cargo test --tests` working (#1205)Carl Lerche
Broken tests are disabled
2019-05-14Update Tokio to Rust 2018 (#1082)Carl Lerche
2019-04-23Introduce `tokio-test` crate (#1030)Lucio Franco