Skip to content

Commit

Permalink
Fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tmpolaczyk committed Oct 31, 2023
1 parent 8630ab9 commit 09fc0df
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions node/src/container_chain_spawner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -800,6 +800,7 @@ mod tests {
call_collate_on,
chains_to_stop,
chains_to_start,
need_to_restart_current,
} = handle_update_assignment_state_change(
&mut *self.state.lock().unwrap(),
self.orchestrator_para_id,
Expand All @@ -810,11 +811,22 @@ mod tests {

// Assert we never start and stop the same container chain
for para_id in &chains_to_start {
assert!(
!chains_to_stop.contains(para_id),
"Tried to start and stop same container chain: {}",
para_id
);
if !need_to_restart_current {
assert!(
!chains_to_stop.contains(para_id),
"Tried to start and stop same container chain: {}",
para_id
);
} else {
// Will try to start and stop container chain with id "current", so ignore that
if Some(*para_id) != current {
assert!(
!chains_to_stop.contains(para_id),
"Tried to start and stop same container chain: {}",
para_id
);
}
}
}
// Assert we never start or stop the orchestrator chain
assert!(!chains_to_start.contains(&self.orchestrator_para_id));
Expand Down

0 comments on commit 09fc0df

Please sign in to comment.