@@ -394,8 +394,11 @@ where
394
394
let mut resp = time:: timeout ( Duration :: from_millis ( self . timeout ) , async {
395
395
// we want to ignore all other messages sent by the server at this point and let the
396
396
// background loop handle them
397
+ // We also want to ignore all messages emitted by the server to its stdout that does
398
+ // not deserialize into a valid JsonRpcMessage (they are not supposed to do this but
399
+ // too many people complained about this so we are adding this safeguard in)
397
400
loop {
398
- if let JsonRpcMessage :: Response ( resp) = listener. recv ( ) . await ? {
401
+ if let Ok ( JsonRpcMessage :: Response ( resp) ) = listener. recv ( ) . await {
399
402
if resp. id == id {
400
403
break Ok :: < JsonRpcResponse , TransportError > ( resp) ;
401
404
}
@@ -461,10 +464,8 @@ where
461
464
. await
462
465
. map_err ( send_map_err) ??;
463
466
let resp = time:: timeout ( Duration :: from_millis ( self . timeout ) , async {
464
- // we want to ignore all other messages sent by the server at this point and let the
465
- // background loop handle them
466
467
loop {
467
- if let JsonRpcMessage :: Response ( resp) = listener. recv ( ) . await ? {
468
+ if let Ok ( JsonRpcMessage :: Response ( resp) ) = listener. recv ( ) . await {
468
469
if resp. id == id {
469
470
break Ok :: < JsonRpcResponse , TransportError > ( resp) ;
470
471
}
@@ -630,6 +631,8 @@ mod tests {
630
631
}
631
632
632
633
#[ tokio:: test( flavor = "multi_thread" ) ]
634
+ // For some reason this test is quite flakey when ran in the CI but not on developer's
635
+ // machines. As a result it is hard to debug, hence we are ignoring it for now.
633
636
#[ ignore]
634
637
async fn test_client_stdio ( ) {
635
638
std:: process:: Command :: new ( "cargo" )
0 commit comments