Skip to content

Commit 055fa4e

Browse files
apollo_integration_tests: map executables by service in running node (#10351)
1 parent a7093af commit 055fa4e

File tree

1 file changed

+13
-10
lines changed

1 file changed

+13
-10
lines changed

crates/apollo_integration_tests/src/integration_test_manager.rs

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -214,15 +214,18 @@ impl NodeSetup {
214214

215215
pub fn run(self) -> RunningNode {
216216
let executable_handles = self
217-
.get_executables()
218-
.map(|executable| {
219-
info!("Running {}.", executable.node_execution_id);
220-
spawn_run_node(
221-
vec![executable.node_config_path.clone()],
222-
executable.node_execution_id.into(),
217+
.executables
218+
.iter()
219+
.map(|(service, executable)| {
220+
(
221+
*service,
222+
spawn_run_node(
223+
vec![executable.node_config_path.clone()],
224+
executable.node_execution_id.into(),
225+
),
223226
)
224227
})
225-
.collect::<Vec<_>>();
228+
.collect::<HashMap<NodeService, AbortOnDropHandle<()>>>();
226229

227230
RunningNode { node_setup: self, executable_handles }
228231
}
@@ -246,7 +249,7 @@ impl NodeSetup {
246249

247250
pub struct RunningNode {
248251
node_setup: NodeSetup,
249-
executable_handles: Vec<AbortOnDropHandle<()>>,
252+
executable_handles: HashMap<NodeService, AbortOnDropHandle<()>>,
250253
}
251254

252255
impl RunningNode {
@@ -263,7 +266,7 @@ impl RunningNode {
263266
}
264267

265268
fn propagate_executable_panic(&self) {
266-
for handle in &self.executable_handles {
269+
for handle in self.executable_handles.values() {
267270
// A finished handle implies a running node executable has panicked.
268271
if handle.is_finished() {
269272
// Panic, dropping all other handles, which should drop.
@@ -478,7 +481,7 @@ impl IntegrationTestManager {
478481
.running_nodes
479482
.remove(&index)
480483
.unwrap_or_else(|| panic!("Node {index} is not in the running map."));
481-
running_node.executable_handles.iter().for_each(|handle| {
484+
running_node.executable_handles.values().for_each(|handle| {
482485
assert!(!handle.is_finished(), "Node {index} should still be running.");
483486
handle.abort();
484487
});

0 commit comments

Comments
 (0)