()
| 1494 | |
| 1495 | #[tokio::test] |
| 1496 | async fn fill_backlog() { |
| 1497 | run_test(async |mut ctx: TestCtx| { |
| 1498 | let queue_id = ctx |
| 1499 | .add_queue( |
| 1500 | always_queued_handler(), |
| 1501 | QueueBuilder::default().backlog(4).max_workers_per_alloc(2), |
| 1502 | ) |
| 1503 | .await; |
| 1504 | |
| 1505 | let rq_id = ctx.default_rq_id(); |
| 1506 | ctx.create_simple_tasks(100, rq_id).await; |
| 1507 | ctx.assign_worker_resource(queue_id, WorkerConfigBuilder::default()); |
| 1508 | ctx.try_submit().await; |
| 1509 | |
| 1510 | let allocations = ctx.get_allocations(queue_id); |
| 1511 | assert_eq!(allocations.len(), 4); |
| 1512 | assert!( |
| 1513 | allocations |
| 1514 | .iter() |
| 1515 | .all(|alloc| alloc.target_worker_count == 2) |
| 1516 | ); |
| 1517 | }) |
| 1518 | .await; |
| 1519 | } |
| 1520 | |
| 1521 | // When we don't know worker resources, create only a single conservative "probe" allocation |
| 1522 | // if there are some tasks waiting for resources |
nothing calls this directly
no test coverage detected