diff --git a/src/connectivity/bluetooth/tests/bt-manifest-integration-tests/src/bt_a2dp_smoke_test.rs b/src/connectivity/bluetooth/tests/bt-manifest-integration-tests/src/bt_a2dp_smoke_test.rs index 2d5f9257c72..ecc6e0c932d 100644 --- a/src/connectivity/bluetooth/tests/bt-manifest-integration-tests/src/bt_a2dp_smoke_test.rs +++ b/src/connectivity/bluetooth/tests/bt-manifest-integration-tests/src/bt_a2dp_smoke_test.rs @@ -26,7 +26,7 @@ use { fuchsia_component_test::{ Capability, ChildOptions, LocalComponentHandles, RealmBuilder, Ref, Route, }, - futures::{channel::mpsc, SinkExt, StreamExt}, + futures::{channel::mpsc, pending, SinkExt, StreamExt}, realmbuilder_mock_helpers::add_fidl_service_handler, std::{collections::HashSet, iter::FromIterator}, tracing::info, @@ -145,6 +145,9 @@ async fn mock_a2dp_client( .send(Event::A2dpMediaStream(Some(a2dp_media_stream_svc))) .await .expect("failed sending ack to test"); + // TODO(fxbug.dev/303919602): pending! is a workaround to never exit this component so + // we don't trigger this bug, which can cause a flake. + pending!(); Ok(()) } diff --git a/src/connectivity/bluetooth/tests/bt-manifest-integration-tests/src/bt_avrcp_smoke_test.rs b/src/connectivity/bluetooth/tests/bt-manifest-integration-tests/src/bt_avrcp_smoke_test.rs index b2a57f4c9f0..9e4a7456eeb 100644 --- a/src/connectivity/bluetooth/tests/bt-manifest-integration-tests/src/bt_avrcp_smoke_test.rs +++ b/src/connectivity/bluetooth/tests/bt-manifest-integration-tests/src/bt_avrcp_smoke_test.rs @@ -10,7 +10,7 @@ use { fuchsia_component_test::{ Capability, ChildOptions, LocalComponentHandles, RealmBuilder, Ref, Route, }, - futures::{channel::mpsc, SinkExt, StreamExt}, + futures::{channel::mpsc, pending, SinkExt, StreamExt}, realmbuilder_mock_helpers::mock_component, tracing::info, }; @@ -52,6 +52,9 @@ async fn mock_avrcp_client( .send(Event::PeerManagerExt(Some(peer_manager_ext_svc))) .await .expect("failed sending ack to test"); + // TODO(fxbug.dev/303919602): pending! is a workaround to never exit this component so + // we don't trigger this bug, which can cause a flake. + pending!(); Ok(()) } diff --git a/src/connectivity/bluetooth/tests/bt-manifest-integration-tests/src/bt_avrcp_target_smoke_test.rs b/src/connectivity/bluetooth/tests/bt-manifest-integration-tests/src/bt_avrcp_target_smoke_test.rs index 90b36ea4bb0..fae1826b53e 100644 --- a/src/connectivity/bluetooth/tests/bt-manifest-integration-tests/src/bt_avrcp_target_smoke_test.rs +++ b/src/connectivity/bluetooth/tests/bt-manifest-integration-tests/src/bt_avrcp_target_smoke_test.rs @@ -80,19 +80,16 @@ async fn mock_avrcp_target_client( handles: LocalComponentHandles, ) -> Result<(), Error> { let lifecycle_svc = handles.connect_to_protocol::()?; - fasync::Task::local(async move { - let lifecycle = lifecycle_svc.clone(); - loop { - match lifecycle_svc.get_state().await.unwrap() { - LifecycleState::Initializing => {} - LifecycleState::Ready => break, - } - fasync::Timer::new(fasync::Time::after(1_i64.millis())).await; + let lifecycle = lifecycle_svc.clone(); + loop { + match lifecycle_svc.get_state().await.unwrap() { + LifecycleState::Initializing => {} + LifecycleState::Ready => break, } - info!("Client successfully connected to Lifecycle service"); - sender.send(Event::Lifecycle(Some(lifecycle))).await.expect("failed sending ack to test"); - }) - .detach(); + fasync::Timer::new(fasync::Time::after(1_i64.millis())).await; + } + info!("Client successfully connected to Lifecycle service"); + sender.send(Event::Lifecycle(Some(lifecycle))).await.expect("failed sending ack to test"); Ok(()) } diff --git a/src/connectivity/bluetooth/tests/bt-manifest-integration-tests/src/bt_gap_smoke_test.rs b/src/connectivity/bluetooth/tests/bt-manifest-integration-tests/src/bt_gap_smoke_test.rs index f61a079ea77..3e83a1a036e 100644 --- a/src/connectivity/bluetooth/tests/bt-manifest-integration-tests/src/bt_gap_smoke_test.rs +++ b/src/connectivity/bluetooth/tests/bt-manifest-integration-tests/src/bt_gap_smoke_test.rs @@ -19,7 +19,7 @@ use { fuchsia_component_test::{ Capability, ChildOptions, LocalComponentHandles, RealmBuilder, Ref, Route, }, - futures::{channel::mpsc, SinkExt, StreamExt}, + futures::{channel::mpsc, pending, SinkExt, StreamExt}, realmbuilder_mock_helpers::{mock_dev, provide_bt_gap_uses}, std::sync::Arc, tracing::info, @@ -130,6 +130,9 @@ async fn mock_client( let pairing_svc = handles.connect_to_protocol::()?; sender.send(Event::Pairing(Some(pairing_svc))).await.expect("failed sending ack to test"); + // TODO(fxbug.dev/303919602): pending! is a workaround to never exit this component so + // we don't trigger this bug, which can cause a flake. + pending!(); Ok(()) } diff --git a/src/connectivity/bluetooth/tests/bt-manifest-integration-tests/src/bt_hfp_audio_gateway_smoke_test.rs b/src/connectivity/bluetooth/tests/bt-manifest-integration-tests/src/bt_hfp_audio_gateway_smoke_test.rs index bf34996edb8..9a2feb163c2 100644 --- a/src/connectivity/bluetooth/tests/bt-manifest-integration-tests/src/bt_hfp_audio_gateway_smoke_test.rs +++ b/src/connectivity/bluetooth/tests/bt-manifest-integration-tests/src/bt_hfp_audio_gateway_smoke_test.rs @@ -15,7 +15,7 @@ use { fuchsia_component_test::{ Capability, ChildOptions, LocalComponentHandles, RealmBuilder, Ref, Route, }, - futures::{channel::mpsc, SinkExt, StreamExt}, + futures::{channel::mpsc, pending, SinkExt, StreamExt}, realmbuilder_mock_helpers::{add_fidl_service_handler, mock_component, mock_dev}, std::{collections::HashSet, iter::FromIterator}, tracing::info, @@ -91,6 +91,10 @@ async fn mock_hfp_client( let hfp_test_svc = handles.connect_to_protocol::()?; sender.send(Event::HfpTest(Some(hfp_test_svc))).await.expect("failed sending ack to test"); + + // TODO(fxbug.dev/303919602): pending! is a workaround to never exit this component so + // we don't trigger this bug, which can cause a flake. + pending!(); Ok(()) } diff --git a/src/connectivity/bluetooth/tests/bt-manifest-integration-tests/src/bt_init_smoke_test.rs b/src/connectivity/bluetooth/tests/bt-manifest-integration-tests/src/bt_init_smoke_test.rs index 998a7d49e71..15f50afdb63 100644 --- a/src/connectivity/bluetooth/tests/bt-manifest-integration-tests/src/bt_init_smoke_test.rs +++ b/src/connectivity/bluetooth/tests/bt-manifest-integration-tests/src/bt_init_smoke_test.rs @@ -20,7 +20,7 @@ use { fuchsia_component_test::{ Capability, ChildOptions, LocalComponentHandles, RealmBuilder, Ref, Route, }, - futures::{channel::mpsc, SinkExt, StreamExt}, + futures::{channel::mpsc, pending, SinkExt, StreamExt}, realmbuilder_mock_helpers::{add_fidl_service_handler, mock_dev, provide_bt_gap_uses}, std::sync::Arc, tracing::info, @@ -135,6 +135,9 @@ async fn mock_client( .await .expect("failed sending ack to test"); + // TODO(fxbug.dev/303919602): pending! is a workaround to never exit this component so + // we don't trigger this bug, which can cause a flake. + pending!(); Ok(()) } diff --git a/src/connectivity/bluetooth/tests/bt-manifest-integration-tests/src/bt_rfcomm_smoke_test.rs b/src/connectivity/bluetooth/tests/bt-manifest-integration-tests/src/bt_rfcomm_smoke_test.rs index 940bf494ca4..89a64a1ac60 100644 --- a/src/connectivity/bluetooth/tests/bt-manifest-integration-tests/src/bt_rfcomm_smoke_test.rs +++ b/src/connectivity/bluetooth/tests/bt-manifest-integration-tests/src/bt_rfcomm_smoke_test.rs @@ -10,7 +10,7 @@ use { fuchsia_component_test::{ Capability, ChildOptions, LocalComponentHandles, RealmBuilder, Ref, Route, }, - futures::{channel::mpsc, SinkExt, StreamExt}, + futures::{channel::mpsc, pending, SinkExt, StreamExt}, realmbuilder_mock_helpers::add_fidl_service_handler, tracing::info, }; @@ -47,6 +47,10 @@ async fn mock_rfcomm_client( let test_svc = handles.connect_to_protocol::()?; sender.send(Event::Test(Some(test_svc))).await.expect("failed sending ack to test"); + + // TODO(fxbug.dev/303919602): pending! is a workaround to never exit this component so + // we don't trigger this bug, which can cause a flake. + pending!(); Ok(()) }