File tree Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -10,9 +10,21 @@ use async_compression::tokio::write::ZstdEncoder;
1010use tokio:: io:: { AsyncWrite , AsyncWriteExt as _} ;
1111use tracing_subscriber:: fmt:: format:: FmtSpan ;
1212
13+ /// This issue covers our state machine being invalid when using adapters
14+ /// like [`tokio_util::codec`].
15+ ///
16+ /// After the first [`poll_shutdown`] call,
17+ /// we must expect any number of [`poll_flush`] and [`poll_shutdown`] calls,
18+ /// until [`poll_shutdown`] returns [`Poll::Ready`],
19+ /// according to the documentation on [`AsyncWrite`].
20+ ///
1321/// <https://github.com/Nullus157/async-compression/issues/246>
14- #[ tokio:: test]
15- async fn issue_246 ( ) {
22+ ///
23+ /// [`tokio_util::codec`](https://docs.rs/tokio-util/latest/tokio_util/codec)
24+ /// [`poll_shutdown`](AsyncWrite::poll_shutdown)
25+ /// [`poll_flush`](AsyncWrite::poll_flush)
26+ #[ test]
27+ fn issue_246 ( ) {
1628 tracing_subscriber:: fmt ( )
1729 . without_time ( )
1830 . with_ansi ( false )
@@ -23,7 +35,7 @@ async fn issue_246() {
2335 . init ( ) ;
2436 let mut zstd_encoder =
2537 Transparent :: new ( Trace :: new ( ZstdEncoder :: new ( DelayedShutdown :: default ( ) ) ) ) ;
26- zstd_encoder. shutdown ( ) . await . unwrap ( ) ;
38+ futures :: executor :: block_on ( zstd_encoder. shutdown ( ) ) . unwrap ( ) ;
2739}
2840
2941pin_project_lite:: pin_project! {
You can’t perform that action at this time.
0 commit comments