reimplement the batching of task with or without primary key in the autobatcher

This commit is contained in:
Tamo 2023-01-23 20:16:16 +01:00
parent 5672118bfa
commit 767cb725a5
No known key found for this signature in database
GPG key ID: 20CD8020AFA88D69
8 changed files with 206 additions and 234 deletions

View file

@ -3281,13 +3281,9 @@ mod tests {
snapshot!(primary_key, @"paw");
// We should be able to batch together the next two tasks that don't specify any primary key
// and it should succeed.
// + the last task that matches the current primary-key. Everything should succeed.
handle.advance_one_successful_batch();
snapshot!(snapshot_index_scheduler(&index_scheduler), name: "fourth_and_fifth_tasks_succeeds");
// Finally the last task should succeed since its primary key is the same as the valid one.
handle.advance_one_successful_batch();
snapshot!(snapshot_index_scheduler(&index_scheduler), name: "sixth_task_succeeds");
snapshot!(snapshot_index_scheduler(&index_scheduler), name: "all_other_tasks_succeeds");
// Is the primary key still what we expect?
let index = index_scheduler.index("doggos").unwrap();
@ -3360,13 +3356,9 @@ mod tests {
snapshot!(snapshot_index_scheduler(&index_scheduler), name: "third_task_succeeds");
// We should be able to batch together the next two tasks that don't specify any primary key
// and it should succeed.
// + the last task that matches the current primary-key. Everything should succeed.
handle.advance_one_successful_batch();
snapshot!(snapshot_index_scheduler(&index_scheduler), name: "fourth_and_fifth_tasks_succeeds");
// Finally the last task should succeed.
handle.advance_one_successful_batch();
snapshot!(snapshot_index_scheduler(&index_scheduler), name: "sixth_task_succeeds");
snapshot!(snapshot_index_scheduler(&index_scheduler), name: "all_other_tasks_succeeds");
// Is the primary key still what we expect?
let index = index_scheduler.index("doggos").unwrap();