@@ -234,8 +234,10 @@ impl Drop for PubsubStream {
234234#[ cfg( test) ]
235235mod test {
236236 use std:: mem;
237+ use std:: time:: Duration ;
237238
238239 use futures:: { try_join, StreamExt , TryStreamExt } ;
240+ use tokio:: time:: sleep;
239241
240242 use crate :: { client, resp} ;
241243
@@ -357,6 +359,9 @@ mod test {
357359 // Unsubscribe from topic 2
358360 pubsub. unsubscribe ( UNSUBSCRIBE_TOPIC_2 ) ;
359361
362+ // Ensure unsubscription is processed
363+ sleep ( Duration :: from_millis ( 1000 ) ) . await ;
364+
360365 // Drop the subscription for topic 3
361366 mem:: drop ( topic_3) ;
362367
@@ -414,6 +419,9 @@ mod test {
414419 // Unsubscribe from topic 1
415420 pubsub. unsubscribe ( RESUBSCRIBE_TOPIC ) ;
416421
422+ // Yes, I know, just testing...
423+ sleep ( Duration :: from_millis ( 1000 ) ) . await ;
424+
417425 // Send some more messages
418426 paired. send_and_forget ( resp_array ! [
419427 "PUBLISH" ,
@@ -423,7 +431,6 @@ mod test {
423431
424432 // Get the next message for topic 1
425433 let result1 = topic_1. next ( ) . await ;
426- println ! ( "{:?}" , result1) ;
427434 assert ! ( result1. is_none( ) ) ;
428435
429436 // Resubscribe to topic 1
0 commit comments