let client handle empty task list
@@ -1043,8 +1043,6 @@ impl GooseAttack {
) = mpsc::unbounded_channel();
client_channels.push(parent_sender);
- // We can only launch tasks if the task list is non-empty
- if !thread_client.weighted_tasks.is_empty() {
// Copy the client-to-parent sender channel, used by all threads.
thread_client.parent = Some(all_threads_sender.clone());
@@ -1069,12 +1067,6 @@ impl GooseAttack {
self.active_clients += 1;
debug!("sleeping {:?} milliseconds...", sleep_duration);
tokio::time::delay_for(sleep_duration).await;
- } else {
- warn!(
- "no tasks for thread {} to run",
- self.task_sets[thread_client.task_sets_index].name
- );
- }
}
// Restart the timer now that all threads are launched.
started = time::Instant::now();
@@ -1448,8 +1440,10 @@ fn weight_tasks(task_set: &GooseTaskSet) -> (Vec<Vec<usize>>, Vec<Vec<usize>>, V
let mut tasks = vec![task.tasks_index; weight];
weighted_unsequenced_tasks.append(&mut tasks);
}
- // Unsequenced tasks come lost.
+ // Unsequenced tasks come last.
+ if !weighted_unsequenced_tasks.is_empty() {
weighted_tasks.push(weighted_unsequenced_tasks);
+ }
// Apply weight to on_start sequenced tasks.
let mut weighted_on_start_tasks: Vec<Vec<usize>> = Vec::new();
