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;
10
10
use tokio:: io:: { AsyncWrite , AsyncWriteExt as _} ;
11
11
use tracing_subscriber:: fmt:: format:: FmtSpan ;
12
12
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
+ ///
13
21
/// <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 ( ) {
16
28
tracing_subscriber:: fmt ( )
17
29
. without_time ( )
18
30
. with_ansi ( false )
@@ -23,7 +35,7 @@ async fn issue_246() {
23
35
. init ( ) ;
24
36
let mut zstd_encoder =
25
37
Transparent :: new ( Trace :: new ( ZstdEncoder :: new ( DelayedShutdown :: default ( ) ) ) ) ;
26
- zstd_encoder. shutdown ( ) . await . unwrap ( ) ;
38
+ futures :: executor :: block_on ( zstd_encoder. shutdown ( ) ) . unwrap ( ) ;
27
39
}
28
40
29
41
pin_project_lite:: pin_project! {
You can’t perform that action at this time.
0 commit comments