@@ -763,7 +763,7 @@ def pipe_data_received(self, fd, data) -> None:
763
763
events .append (('pipe_data_received' , fd , data ))
764
764
765
765
def pipe_connection_lost (self , fd , exc ) -> None :
766
- events .append ('pipe_connection_lost' )
766
+ events .append (( 'pipe_connection_lost' , fd ) )
767
767
768
768
def process_exited (self ) -> None :
769
769
events .append ('process_exited' )
@@ -777,13 +777,16 @@ async def main() -> None:
777
777
sys .executable , '-c' , code , stdin = None )
778
778
await exit_future
779
779
transport .close ()
780
- self .assertEqual (events , [
780
+
781
+ expected = [
781
782
('pipe_data_received' , 1 , b'stdout' ),
782
783
('pipe_data_received' , 2 , b'stderr' ),
783
- 'pipe_connection_lost' ,
784
- 'pipe_connection_lost' ,
784
+ ( 'pipe_connection_lost' , 1 ) ,
785
+ ( 'pipe_connection_lost' , 2 ) ,
785
786
'process_exited' ,
786
- ])
787
+ ]
788
+ # gh-108973: Events can be delivered in any order
789
+ self .assertSetEqual (set (events ), set (expected ))
787
790
788
791
self .loop .run_until_complete (main ())
789
792
0 commit comments